Search found 139 matches

by metaphysis
Sat Aug 18, 2018 5:15 pm
Forum: Volume 105 (10500-10599)
Topic: 10501 - Simplified Shisen-Sho
Replies: 12
Views: 8541

Re: 10501 - Simplified Shisen-Sho

The judge data may be a little weak, so using simple DFS can get AC.
by metaphysis
Wed Jul 04, 2018 5:34 am
Forum: Volume 10 (1000-1099)
Topic: 1052 - Bit Compressor
Replies: 7
Views: 5304

Re: 1052 - Bit Compressor

Before trying to solve it, please make sure you have comprehended the constraint in description completely:
"Replace any maximal sequence of n 1’s with the binary version of n whenever it shortens the length of the message."
by metaphysis
Wed Jul 04, 2018 5:24 am
Forum: Volume 10 (1000-1099)
Topic: 1052 - Bit Compressor
Replies: 7
Views: 5304

Re: 1052 - Bit Compressor

Test data generator. #include <bits/stdc++.h> using namespace std; int main(int argc, char *argv[]) { srand(time(NULL)); for (int cs = 1; cs <= 1000; cs++) { int L = rand() % 200 + 1, N = rand() % L + 1; cout << L << ' ' << N << '\n'; int T = rand() % 40 + 1; for (int i = 1; i <= T; i++) cout << (ra...
by metaphysis
Fri Jun 29, 2018 10:57 am
Forum: Volume 2 (200-299)
Topic: 292 - Presentation Error
Replies: 8
Views: 6151

Re: 292 - Presentation Error

Anyone who solved UVa 292 can have a look at my code? After several submits, I have no clue why my solution get Wrong Answer. #include <bits/stdc++.h> using namespace std; vector<string> En; string jury, submit; void removeTrailingEmptyLines(string &s) { while (s.length() >= 2 && s[s.length() - 1] =...
by metaphysis
Thu Jun 21, 2018 5:09 am
Forum: Volume 15 (1500-1599)
Topic: 1559 - Nim
Replies: 1
Views: 1827

Re: 1559 - Nim

Test data generator. #include <bits/stdc++.h> using namespace std; int main(int argc, char *argv[]) { srand(time(NULL)); for (int cs = 1; cs <= 100; cs++) { int N = rand() % 10 + 1; int S = rand() % ((1 << 13) - 1) + 1; cout << N << ' ' << S; for (int i = 0; i < 2 * N; i++) cout << ' ' << (rand() % ...
by metaphysis
Fri Apr 20, 2018 9:57 am
Forum: Volume 123 (12300-12399)
Topic: 12348 - Fun Coloring
Replies: 5
Views: 4208

Re: 12348 - Fun Coloring

It is most likely there are some bugs in judge program. I sent an email to administrator two weeks ago but no reply.
by metaphysis
Wed Apr 04, 2018 4:16 am
Forum: Volume 102 (10200-10299)
Topic: 10296 - Jogging Trails
Replies: 7
Views: 5531

Re: 10296 - Jogging Trails

Test data generator. #include <bits/stdc++.h> using namespace std; int main(int argc, char *argv[]) { srand(time(NULL)); for (int cases = 1; cases <= 25; cases++) { int n = rand() % 15 + 2, m = rand() % 500 + n; m = min(n * 20, m); cout << n << ' ' << m << '\n'; for (int i = 1; i < n; i++) cout << i...
by metaphysis
Fri Mar 16, 2018 3:49 pm
Forum: Volume 102 (10200-10299)
Topic: 10219 - Find the ways !
Replies: 33
Views: 10324

Re: 10219 - Find the ways !

It seems that you must use long double to get AC.
by metaphysis
Tue Mar 13, 2018 3:28 pm
Forum: Volume 102 (10200-10299)
Topic: 10257 - Dick and Jane
Replies: 14
Views: 7545

Re: 10257 - Dick and Jane

For test data:

Code: Select all

1 2 5 3
uDebug gives the answer:

Code: Select all

8 5 2
How it can be? If age difference of Spot and Puff is 1 or 2, I can understand easily, but the difference is 3, anyone can explain me? Thanks!
by metaphysis
Fri Mar 02, 2018 1:24 pm
Forum: Volume 100 (10000-10099)
Topic: 10023 - Square root
Replies: 121
Views: 27588

Re: 10023 - Square root

Confirmed. I got AC by using method as Bryton said.
by metaphysis
Sat Feb 24, 2018 5:52 am
Forum: Volume 104 (10400-10499)
Topic: 10401 - Injured Queen Problem
Replies: 19
Views: 9823

Re: 10401 - Injured Queen Problem

Confirmed, the judge input contains line(s) which is blank. You can get AC by ignoring it.
by metaphysis
Sun Feb 11, 2018 4:12 am
Forum: Volume 5 (500-599)
Topic: 517 - Word
Replies: 13
Views: 5399

Re: 517 - Word

Test data generator. #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main(int argc, char *argv[]) { srand(time(NULL)); string rule[8] = {"aaa", "aab", "aba", "abb", "baa", "bab", "bba", "bbb"}; for (int c = 1; c <= 100; c++) { int n = rand() % 16; if (n <= 3) n = 3; ...
by metaphysis
Sun Feb 11, 2018 4:11 am
Forum: Volume 5 (500-599)
Topic: 549 - Evaluating an Equations Board
Replies: 13
Views: 4926

Re: 549 - Evaluating an Equations Board

Test data generator. #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main(int argc, char *argv[]) { srand(time(NULL)); char symbols[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '-', 'x'}; for (int i = 1; i <= 1000; i++) { int goal = rand() % 100; int n...
by metaphysis
Sun Feb 11, 2018 4:09 am
Forum: Volume 1 (100-199)
Topic: 150 - Double Time
Replies: 18
Views: 3668

Re: 150 - Double Time

Test data generator. #include <iostream> using namespace std; const string months[12] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; const string weekdays[7] = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "...
by metaphysis
Sun Feb 11, 2018 4:07 am
Forum: Volume 102 (10200-10299)
Topic: 10206 - Stars
Replies: 11
Views: 3657

Re: 10206 - Stars

Test data generator. #include <iostream> #include <ctime> #include <cstdlib> #include <set> #include <string> using namespace std; int main(int argc, char *argv[]) { srand(time(NULL)); int cases = 5; set<long long int> produced; for (int c = 1; c <= cases; c++) { int n = rand() % 100 + 1; cout << n ...

Go to advanced search