摘要: GCD and LCMTime Limit : 1 sec, Memory Limit : 65536 KB Japanese version is hereGCD and LCMWrite a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given a and b (0 2 #include 3 #include 4 #include 5 6 using namespace std; 7 8 typedef long long ll;... 阅读全文
posted @ 2014-03-09 14:53 hyx1 阅读(209) 评论(0) 推荐(0) 编辑
摘要: DNA LaboratoryTime Limit: 5000MSMemory Limit: 30000KTotal Submissions: 1425Accepted: 280DescriptionBackground Having started to build his own DNA lab just recently, the evil doctor Frankenstein is not quite up to date yet. He wants to extract his DNA, enhance it somewhat and clone himself. He has al 阅读全文
posted @ 2014-03-09 13:32 hyx1 阅读(586) 评论(0) 推荐(0) 编辑
摘要: 114. Telecasting stationtime limit per test: 0.25 sec.memory limit per test: 4096 KBEvery city in Berland is situated on Ox axis. The government of the country decided to build new telecasting station. After many experiments Berland scientists came to a conclusion that in any city citizensdispleasur 阅读全文
posted @ 2014-03-08 21:29 hyx1 阅读(213) 评论(0) 推荐(0) 编辑
摘要: E. Inna and Binary Logictime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputInna is fed up with jokes about female logic. So she started using binary logic instead.Inna has an array ofnelementsa1[1], a1[2], ..., a1[n]. Girl likes to train in her bina 阅读全文
posted @ 2014-03-08 20:26 hyx1 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 104. Little shop of flowers time limit per test: 0.25 sec. memory limit per test: 4096 KBPROBLEMYou want to arrange the window of your flower shop in a most pleasant way. You have F bunches of flowers, each being of a different kind, and at least as many vases ordered in a row. The vases are glued . 阅读全文
posted @ 2014-03-08 16:45 hyx1 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 107. 987654321 problem time limit per test: 0.25 sec. memory limit per test: 4096 KBFor given number N you must output amount of N-digit numbers, such, that last digits of their square is equal to 987654321. InputInput contains integer number N (1 2 #include 3 #include 4 #include 5 6 using name... 阅读全文
posted @ 2014-03-08 13:39 hyx1 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 113. Nearly prime numbers time limit per test: 0.25 sec. memory limit per test: 4096 KBNearly prime number is an integer positive number for which it is possible to find such primes P1 and P2 that given number is equal to P1*P2. There is given a sequence on N integer positive numbers, you are to wr. 阅读全文
posted @ 2014-03-06 21:09 hyx1 阅读(247) 评论(0) 推荐(0) 编辑
摘要: D. Dima and Bacteriatime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDima took up the biology of bacteria, as a result of his experiments, he invented k types of bacteria. Overall, there are n bacteria at his laboratory right now, and the number o 阅读全文
posted @ 2014-03-06 20:05 hyx1 阅读(288) 评论(0) 推荐(0) 编辑
摘要: There is sequence 1, 12, 123, 1234, ..., 12345678910, ... . Given first N elements of that sequence. You must determine amount of numbers in it that are divisible by 3.InputInput contains N (1 2 #include 3 4 using namespace std; 5 6 long long n; 7 int a[3] = {0,0,1}; 8 int main() 9 {10 scanf(... 阅读全文
posted @ 2014-03-04 22:04 hyx1 阅读(166) 评论(0) 推荐(0) 编辑
摘要: For given integer N (1 2 #include 3 #include 4 #include 5 using namespace std; 6 7 #define maxn 10005 8 9 int n,len = 0;10 int ele[20];11 bool prime[maxn],vis[maxn];12 13 void solve() {14 for(int i = 3; i <= n; i++) {15 prime[i] = i % 2;16 }17 18 prime[2] = 1;19 int ... 阅读全文
posted @ 2014-03-04 22:01 hyx1 阅读(217) 评论(0) 推荐(0) 编辑