Search found 139 matches

by metaphysis
Sun Feb 11, 2018 4:06 am
Forum: Volume 15 (1500-1599)
Topic: 1566 - John
Replies: 1
Views: 402

Re: 1566 - John

Test data generator. #include <ctime> #include <cstdlib> #include <iostream> using namespace std; int main(int argc, char *argv[]) { srand(time(NULL)); int cases = 1000; cout << cases << '\n'; for (int c = 1; c <= cases; c++) { int n = rand() % 47 + 1; cout << n << '\n'; for (int i = 1; i <= n; i++)...
by metaphysis
Sun Feb 11, 2018 4:05 am
Forum: Volume 106 (10600-10699)
Topic: 10690 - Expression Again
Replies: 23
Views: 8573

Re: 10690 - Expression Again

Test data generator. #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main(int argc, char *argv[]) { srand(time(NULL)); int number[101]; for (int i = 1; i <= 110; i++) { int N = rand() % 50; N++; int M = rand() % 50; M++; int T = (N + M); cout << N << ' ' << M << '\n'...
by metaphysis
Sun Feb 11, 2018 4:04 am
Forum: Volume 9 (900-999)
Topic: 915 - Stack of Cylinders
Replies: 5
Views: 5199

Re: 915 - Stack of Cylinders

Test data generator. #include <iostream> #include <cstdlib> #include <ctime> using namespace std; const int MAX_CASES = 100; int main(int argc, char *argv[]) { srand(time(NULL)); for (int c = 1; c <= MAX_CASES; c++) { int circles = rand() % 90 + 10; cout << circles << '\n'; for (int i = 1; i <= circ...
by metaphysis
Sun Feb 11, 2018 4:03 am
Forum: Volume 3 (300-399)
Topic: 345 - It's Ir-Resist-Able!
Replies: 1
Views: 1608

Re: 345 - It's Ir-Resist-Able!

Test data generator. #include <iostream> #include <cstdlib> #include <ctime> #include <vector> using namespace std; int main(int argc, char *argv[]) { srand(time(NULL)); for (int i = 1; i <= 100; i++) { int N = rand() % 30 + 2; vector<string> items; int S = 1, E = 2; for (int j = 1; j <= N; j++) { i...
by metaphysis
Sun Feb 11, 2018 4:02 am
Forum: Volume 3 (300-399)
Topic: 308 - Tin Cutter
Replies: 1
Views: 664

Re: 308 - Tin Cutter

Test data generator. #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main(int argc, char * argv[]) { srand(time(NULL)); for (int c = 1; c <= 100; c++) { int n = 30; cout << n << '\n'; for (int i = 1; i <= n; i++) { if ((rand() % 2) == 1) { int x = rand() % 1000, y1 =...
by metaphysis
Sun Feb 11, 2018 4:01 am
Forum: Volume 113 (11300-11399)
Topic: 11378 - Bey Battle
Replies: 10
Views: 4590

Re: 11378 - Bey Battle

Test data generator. #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main(int argc, char *argv[]) { srand(time(NULL)); cout << "100000\n"; for (int c = 1; c <= 100000; c++) { int n = rand() % 1000000; if (rand() % 2 == 0) cout << n; else cout << -n; cout << ' '; n = ...
by metaphysis
Sun Feb 11, 2018 4:00 am
Forum: Volume 113 (11300-11399)
Topic: 11301 - Great Wall of China
Replies: 6
Views: 4145

Re: 11301 - Great Wall of China

Test data generator. #include <iostream> #include <string> #include <cstdlib> #include <ctime> using namespace std; string c[10] = { "@@@00", "@@0@0", "@0@@0", "0@@@0", "@@00@", "@00@@", "00@@@", "@0@0@", "0@0@@", "0@@0@" }; int main(int argc, char *argv[]) { srand(time(NULL)); for (int i = 1; i <= ...
by metaphysis
Sun Feb 11, 2018 3:57 am
Forum: Volume 121 (12100-12199)
Topic: 12190 - Electric Bill
Replies: 1
Views: 1150

Re: 12190 - Electric Bill

Test data generator. #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <...
by metaphysis
Sat Feb 10, 2018 6:15 pm
Forum: Volume 2 (200-299)
Topic: 248 - Cutting Corners
Replies: 1
Views: 823

Re: 248 - Cutting Corners

Test data generator. #include <iostream> #include <cstdlib> #include <ctime> #include <vector> using namespace std; int main(int argc, char *argv[]) { srand(time(NULL)); for (int c = 1; c <= 100; c++) { int n = rand() % 21; cout << n << '\n'; cout << (rand() % 1000) << ' ' << (rand() % 10) << ' '; c...
by metaphysis
Sat Feb 10, 2018 6:12 pm
Forum: Volume 106 (10600-10699)
Topic: 10659 - Fitting Text into Slides
Replies: 17
Views: 7745

Re: 10659 - Fitting Text into Slides

Test data generator. #include <iostream> #include <string> #include <cstdlib> #include <ctime> using namespace std; int main(int argc, char *argv[]) { srand(time(NULL)); string cs = "abcdefghijklmnopqrstyuwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`1234567890-=+_)(*&^%$#@!~|}{[]\\\":;\'?><,./"; int cases = 100, ...
by metaphysis
Sat Feb 10, 2018 6:07 pm
Forum: Volume 10 (1000-1099)
Topic: 1027 - Toll
Replies: 1
Views: 461

Re: 1027 - Toll

Test data generator. #include <iostream> #include <cstdlib> #include <ctime> #include <cstring> using namespace std; int visited[52], edges[52][52]; void dfs(int u) { visited[u] = 1; for (int v = 0; v < 52; v++) if (edges[u][v] && !visited[v]) dfs(v); } char getChar(int x) { if (x <= 25) return (cha...
by metaphysis
Thu Jan 04, 2018 4:10 am
Forum: Volume 106 (10600-10699)
Topic: 10646 - What is the Card?
Replies: 17
Views: 6122

Re: 10646 - What is the Card?

Bad problem statement!
by metaphysis
Thu Dec 07, 2017 5:33 pm
Forum: Volume 115 (11500-11599)
Topic: 11505 - Logo
Replies: 8
Views: 4593

Re: 11505 - Logo

"bk" just means move back, the turtle would not turn its head back.
by metaphysis
Thu Dec 07, 2017 2:32 pm
Forum: Volume 113 (11300-11399)
Topic: 11343 - Isolated Segments
Replies: 1
Views: 1077

Re: 11343 - Isolated Segments

Test data generator. #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main(int argc, char *argv[]) { srand(time(NULL)); cout << 1000 << '\n'; for (int c = 1; c <= 1000; c++) { int M = rand() % 101; cout << M << '\n'; for (int i = 0; i < M; i++) { int px = rand() % 100...
by metaphysis
Tue Nov 14, 2017 4:58 pm
Forum: Volume 8 (800-899)
Topic: 868 - Numerical Maze
Replies: 21
Views: 14221

Re: 868 - Numerical Maze

It seems that the judge data is weak, there allways(may be) only one way to arrive last row with completed sequence.

Go to advanced search