Search found 129 matches

by metaphysis
Fri Dec 07, 2018 5:10 am
Forum: Volume 12 (1200-1299)
Topic: 1221 - Against Mammoths
Replies: 1
Views: 105

Re: 1221 - Against Mammoths

Human planets are NOT needed to leave for allien planets at the same time.
Max Cardinality Bipartite Matching + Binary Search. Similar: 10804 Gopher Strategy, 11262 Weird Fence.
by metaphysis
Thu Sep 20, 2018 4:31 pm
Forum: Volume 4 (400-499)
Topic: 431 - Trial of the Millennium
Replies: 13
Views: 5727

Re: 431 - Trial of the Millennium

After tons of submit, I always got WA, so I turn to UVa BBS for help. It is a classical 0-1 knapsack problem. I have considered various boundary test cases: (1)the total allowed time equal to 0; (2)evidences with time 0; (3)evidences with same score and time, I choose the item which description asci...
by metaphysis
Wed Sep 19, 2018 11:02 am
Forum: Volume 3 (300-399)
Topic: 323 - Jury Compromise
Replies: 10
Views: 1872

Re: 323 - Jury Compromise

Test data generator. #include <bits/stdc++.h> using namespace std; int main(int argc, char *argv[]) { srand(time(NULL)); for (int cases = 1; cases <= 100; cases++) { int n = rand() % 100 + 1; int m = min(rand() % n + 1, 20); cout << n << ' ' << m << '\n'; for (int i = 1; i <= n; i++) { cout << rand(...
by metaphysis
Sun Sep 16, 2018 4:32 pm
Forum: Volume 101 (10100-10199)
Topic: 10164 - Number Game
Replies: 32
Views: 9438

Re: 10164 - Number Game

Test data generator. #include <bits/stdc++.h> using namespace std; int main(int argc, char *argv[]) { srand(time(NULL)); int N[10] = {2, 4, 8, 16, 32, 64, 128, 256, 512, 1024}; for (int cases = 1; cases <= 100; cases++) { int n = N[rand() % 10]; cout << n << '\n'; for (int i = 0; i < (2 * n - 1); i+...
by metaphysis
Mon Sep 10, 2018 4:00 pm
Forum: Volume 11 (1100-1199)
Topic: 1172 - The Bridges of Kolsberg
Replies: 5
Views: 2085

Re: 1172 - The Bridges of Kolsberg

Be careful of the boundary condition.
by metaphysis
Sat Aug 18, 2018 5:15 pm
Forum: Volume 105 (10500-10599)
Topic: 10501 - Simplified Shisen-Sho
Replies: 12
Views: 7464

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: 4040

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: 4040

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: 7
Views: 5112

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: 1662

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: 3172

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: 4534

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: 9591

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: 7095

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: 25166

Re: 10023 - Square root

Confirmed. I got AC by using method as Bryton said.

Go to advanced search