随笔分类 -  SGU

摘要: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 阅读(223) 评论(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 阅读(231) 评论(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 阅读(171) 评论(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 阅读(262) 评论(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 阅读(172) 评论(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 阅读(223) 评论(0) 推荐(0)
摘要:Dominoes – game played with small, rectangular blocks of wood or other material, each identified by a number of dots, or pips, on its face. The blocks usually are called bones, dominoes, or pieces and sometimes men, stones, or even cards. The face of each piece is divided, by a line or ridge, into t 阅读全文
posted @ 2014-03-04 21:58 hyx1 阅读(263) 评论(0) 推荐(0)
摘要:Read integers A and B from input file and write their sum in output file.InputInput file contains A and B (0 2 #include 3 using namespace std; 4 5 i... 阅读全文
posted @ 2014-03-04 21:54 hyx1 阅读(192) 评论(0) 推荐(0)