Search found 139 matches

Mon Apr 01, 2019 3:40 pm
Forum: Volume 2 (200-299)
Topic: 292 - Presentation Error
Replies: 8
Views: 5972

Re: 292 - Presentation Error

A stupid error. Try input: 15 0 1 1 2 Just one line? Just one line? 1 2 Just one []line? Just one line? 2 2 The first characters of the alphabet are: [abcde] Here they come: a b c d e 1 1 That's it: [ abcde] That's it: AbCdE 1 1 [2] and [3] make [5] I guess 2 and 3 are less than 50. 1 1 The first ch...
Tue Mar 05, 2019 7:20 am
Forum: Volume 8 (800-899)
Topic: 888 - Donkey
Replies: 5
Views: 4951

Re: 888 - Donkey

This problem should employ special judge.
Thu Jan 24, 2019 4:06 pm
Forum: Volume 8 (800-899)
Topic: 844 - Pousse
Replies: 3
Views: 2127

Re: 844 - Pousse

Test data generator. #include <bits/stdc++.h> using namespace std; int main(int argc, char *argv[]) { srand(time(NULL)); int cases = 100; cout << cases << "\n\n"; for (int cs = 1; cs <= cases; cs++) { if (cs > 1) cout << '\n'; int N = rand() % 101; cout << N << '\n'; string push = "LRTB"; for (int i...
Thu Jan 24, 2019 5:19 am
Forum: Volume 6 (600-699)
Topic: 609 - Metal Cutting
Replies: 4
Views: 3875

Re: 609 - Metal Cutting

Test data generator. #include <bits/stdc++.h> using namespace std; const double EPSILON = 1e-7; struct point { double x, y; point(double x = 0, double y = 0): x(x), y(y) {} bool operator<(const point & p) const { if (fabs(y - p.y) > EPSILON) return y < p.y; return x < p.x; } bool operator==(const po...
Sun Jan 13, 2019 4:59 pm
Forum: Volume 14 (1400-1499)
Topic: 1400 - Ray, Pass me the dishes!
Replies: 1
Views: 794

Re: 1400 - Ray, Pass me the dishes!

Test data generator. #include <bits/stdc++.h> using namespace std; int main(int argc, char *argv[]) { srand(time(NULL)); int n = rand() % 490000 + 10000, m = 10000; cout << n << ' ' << m << '\n'; for (int i = 0, sign = 1; i < n; i++) { if (i) cout << ' '; if (rand() % 100 > 80) sign *= -1; cout << s...
Fri Jan 11, 2019 11:38 am
Forum: Volume 112 (11200-11299)
Topic: 11297 - Census
Replies: 24
Views: 14525

Re: 11297 - Census

After using assert, the test data may contains some bug. In query, there may be some coordinate value which is bigger than given N, for example:

Code: Select all

2
1 2
1 3
1
q 1 1 20 20
In my AC code, I output 0 in this situation.
Sat Dec 29, 2018 5:51 pm
Forum: Volume 6 (600-699)
Topic: 648 - Stamps (II)
Replies: 13
Views: 4717

Re: 648 - Stamps (II)

Test data generator. #include <bits/stdc++.h> using namespace std; int main(int argc, char *argv[]) { cin.tie(0), cout.tie(0), ios::sync_with_stdio(false); srand(time(NULL)); for (int cs = 1; cs <= 100; cs++) { int n = rand() % 25 + 1; for (int i = 0; i < n; i++) cout << rand() % 100 + 1 << ' '; cou...
Thu Dec 27, 2018 4:17 pm
Forum: Volume 116 (11600-11699)
Topic: 11601 - Avoiding Overlaps
Replies: 11
Views: 4761

Re: 11601 - Avoiding Overlaps

Test data generator. #include <bits/stdc++.h> using namespace std; int main(int argc, char *argv[]) { srand(time(NULL)); int T = 100; cout << T << '\n'; for (int cs = 1; cs <= T; cs++) { int N = 1000; cout << N << '\n'; for (int i = 0; i < N; i++) { int x1 = rand() % 198 - 99, x2 = rand() % 198 - 99...
Mon Dec 24, 2018 2:02 pm
Forum: Volume 100 (10000-10099)
Topic: 10072 - Bob Laptop Woolmer and Eddie Desktop Barlow
Replies: 10
Views: 3400

Re: 10072 - Bob Laptop Woolmer and Eddie Desktop Barlow

If you use (8*bt(i)+2*fl(i)+5)/10 to calculate the score, you may get WA, but if you use round(0.8*bt(i)+0.2*fl(i)), you may get AC.
Tue Dec 18, 2018 2:12 pm
Forum: Volume 122 (12200-12299)
Topic: 12255 - Underwater Snipers
Replies: 1
Views: 1196

Re: 12255 - Underwater Snipers

Test data generator. #include <bits/stdc++.h> using namespace std; int main(int argc, char *argv[]) { srand(time(NULL)); int T = 100; cout << T << "\n\n"; for (int cs = 1; cs <= T; cs++) { long long k, N, S, D, x, y; k = rand() % 100000000; if (rand() % 100 > 70) k *= -1; N = rand() % 1000 + 1; S = ...
Fri Dec 07, 2018 5:10 am
Forum: Volume 12 (1200-1299)
Topic: 1221 - Against Mammoths
Replies: 1
Views: 754

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.
Thu Sep 20, 2018 4:31 pm
Forum: Volume 4 (400-499)
Topic: 431 - Trial of the Millennium
Replies: 13
Views: 6371

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...
Wed Sep 19, 2018 11:02 am
Forum: Volume 3 (300-399)
Topic: 323 - Jury Compromise
Replies: 10
Views: 3090

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(...
Sun Sep 16, 2018 4:32 pm
Forum: Volume 101 (10100-10199)
Topic: 10164 - Number Game
Replies: 32
Views: 10481

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+...
Mon Sep 10, 2018 4:00 pm
Forum: Volume 11 (1100-1199)
Topic: 1172 - The Bridges of Kolsberg
Replies: 5
Views: 2972

Re: 1172 - The Bridges of Kolsberg

Be careful of the boundary condition.