- 博客(25)
- 资源 (1)
- 收藏
- 关注
原创 POJ - 2115 C Looooops
A Compiler Mystery: We are given a C-language style for loop of type for (variable = A; variable != B; variable += C) statement;I.e., a loop which starts by setting variable to value A and while vari...
2018-05-24 16:54:58 138
原创 SGU - 106 The equation(扩展欧几里德)
There is an equation ax + by + c = 0. Given a,b,c,x1,x2,y1,y2 you must determine, how many integer roots of this equation are satisfy to the following conditions : x1<=x<=x2, y1<=y<=y2. ...
2018-05-24 15:43:35 222
原创 LightOJ - 1138 Trailing Zeroes (III)
You task is to find minimal natural number N, so that N! contains exactly Q zeroes on the trail in decimal notation. As you know N! = 1*2*...*N. For example, 5! = 120, 120 contains one zero on the tra...
2018-05-21 20:50:46 195
原创 Sliding Window POJ - 2823
An array of size n ≤ 10 6 is given to you. There is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each tim...
2018-05-17 08:57:41 155
原创 LightOJ - 1197 Help Hanzo筛素数
Amakusa, the evil spiritual leader has captured the beautiful princess Nakururu. The reason behind this is he had a little problem with Hanzo Hattori, the best ninja and the love of Nakururu. After he...
2018-05-16 09:56:57 137
原创 Poj 2082 Terrible Sets
Terrible SetsTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 5466 Accepted: 2792DescriptionLet N be the set of all natural numbers {0 , 1 , 2 , . . . }, and R be the set of all real number...
2018-05-15 20:40:41 145
原创 LightOJ - 1213 Fantasy of a Summation
If you think codes, eat codes then sometimes you may get stressed. In your dreams you may see huge codes, as I have seen once. Here is the code I saw in my dream.#include <stdio.h>int cases, cas...
2018-05-15 20:18:48 137
原创 POJ - 2116 Death to Binary?
The group of Absurd Calculation Maniacs has discovered a great new way how to count. Instead of using the ordinary decadic numbers, they use Fibonacci base numbers. Numbers in this base are expressed ...
2018-05-15 17:41:36 236
原创 LightOJ - 1220 Mysterious Bacteria
Dr. Mob has just discovered a Deathly Bacteria. He named it RC-01. RC-01 has a very strange reproduction system. RC-01 lives exactly x days. Now RC-01 produces exactly p new deadly Bacteria where x = ...
2018-05-15 16:10:37 157
原创 51Nod - 1188 最大公约数之和 V2
给出一个数N,输出小于等于N的所有数,两两之间的最大公约数之和。相当于计算这段程序(程序中的gcd(i,j)表示i与j的最大公约数):G=0;for(i=1;i<N;i++)for(j=i+1;j<=N;j++){ G+=gcd(i,j);}Input第1行:1个数T,表示后面用作输入测试的数的数量。(1 <= T <= 50000)第2 - T + 1行:每行一个数...
2018-05-15 15:22:55 156
原创 LightOJ - 1236 Pairs Forming LCM
Find the result of the following code:long long pairsFormLCM( int n ) { long long res = 0; for( int i = 1; i <= n; i++ ) for( int j = i; j <= n; j++ ) if( lcm(i, j) == n )...
2018-05-12 20:51:26 114
原创 求a%b
求高精度浮点数a%b....... #include<stack> #include<queue> #include<math.h> #include<vector> #include<string> #include<stdio.h> #include<map> #include<iostream&g...
2018-05-12 20:22:28 251
原创 LightOJ - 1245 Harmonic Number (II)
I was trying to solve problem '1234 - Harmonic Number', I wrote the following codelong long H( int n ) { long long res = 0; for( int i = 1; i <= n; i++ ) res = res + n / i; return r...
2018-05-12 09:18:24 125
原创 LightOJ - 1259 Goldbach`s Conjecture(素数筛法)
Goldbach's conjecture is one of the oldest unsolved problems in number theory and in all of mathematics. It states:Every even integer, greater than 2, can be expressed as the sum of two primes [1].Now...
2018-05-11 16:34:48 152
原创 Steps POJ - 2590
StepsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 8219 Accepted: 3747DescriptionOne steps through integer points of the straight line. The length of a step must be nonnegative and can b...
2018-05-11 10:31:06 114
原创 LightOJ - 1336 Sigma Function (因子和)
Sigma function is an interesting function in Number Theory. It is denoted by the Greek letter Sigma (σ). This function actually denotes the sum of all divisors of a number. For example σ(24) = 1+2+3+4...
2018-05-11 09:41:58 271
原创 LightOJ - 1341 Aladdin and the Flying Carpet (筛素数+找素因子+算数基本原理)
It's said that Aladdin had to solve seven mysteries before getting the Magical Lamp which summons a powerful Genie. Here we are concerned about the first mystery.Aladdin was about to enter to a magica...
2018-05-10 20:13:57 154
原创 FZU - 2261 浪里个浪
Problem 2261 浪里个浪 Accept: 253 Submit: 797 Time Limit: 1500 mSec Memory Limit : 32768 KB Problem Description TonyY是一个喜欢到处浪的男人,他的梦想是带着兰兰姐姐浪遍天朝的各个角落,不过在此之前,他需要做好规划。 现在他的手上有一份天朝地图,上面有n个城市,m
2018-05-10 15:58:09 207
原创 Cinema in Akiba(线段树)
I - Cinema in Akiba Cinema in Akiba (CIA) is a small but very popular cinema in Akihabara. Every night the cinema is full of people. The layout of CIA is very interesting, as there is only one row so
2018-05-09 16:13:24 213
原创 SGU - 518 Kidnapping(搜索dfs)
Kidnapping Berland's Police has a serious problem. A foreign ambassador arrived to Berland with an important mission, and his daughter was kidnapped just from the Royal Palace! Inspired by adventures
2018-05-09 10:25:47 142
原创 632-掷骰子
632-掷骰子 内存限制:64MB 时间限制:3000ms Special Judge: No accepted:9 submit:54 题目描述: 小明有m个骰子,小红有n个骰子。每一个骰子都是标准六面骰子。他们分别掷出自己的骰子,如果小明的点数和大,则小明胜;否则小红胜。求小明胜利的概率。 输入描述: 有T组数据。每组数据一行,m和n,用空格隔开。1 输出描述:
2018-05-07 20:57:31 253
原创 ZOJ - 2625 (大数)
Rearrange Them N people stand in a line, and we numbered them 1,2...n, and now you are asked to rearrange them. The ith people is considred in the front of the (i+1)th, after the rearrange, everyon
2018-05-05 20:53:54 213
原创 nyoj 1129 Salvation(搜索)
Salvation 时间限制:1000 ms | 内存限制:65535 KB 难度:3 描述 神秘瀑布镇是一个神秘的地方,那里有吸血鬼,狼人,巫师,二重身。 Klaus(吸血鬼祖先) 为了利用 Elena 的血液发展他的混血大军(吸血鬼&狼人),也来到了神秘瀑布镇。Stefan 因为深爱着 Elena ,于是 Stefan 决定去唤醒吸血鬼猎人,来解救 Ele
2018-05-05 16:56:33 157
原创 poj 1679 The Unique MST
The Unique MST Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 34254 Accepted: 12473 Description Given a connected undirected graph, tell if its minimum spanning tree is unique. D
2018-05-02 21:21:31 95
原创 ZOJ - 3336(Friend Number II)
Given a positive integer x, let S(x) denotes the sum of all x's digits. Two integers x and y are friend numbers if S(x)=S(y). Here comes the problem: Given a positive integer x, of course it has a lot
2018-05-02 21:03:06 167
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人