Task: | Sledding |
Sender: | aalto2024f_008 |
Submission time: | 2024-10-02 17:41:21 +0300 |
Language: | C++ (C++11) |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.00 s | details |
#2 | WRONG ANSWER | 0.00 s | details |
#3 | WRONG ANSWER | 0.00 s | details |
#4 | WRONG ANSWER | 0.00 s | details |
#5 | WRONG ANSWER | 0.00 s | details |
#6 | WRONG ANSWER | 0.00 s | details |
#7 | WRONG ANSWER | 0.00 s | details |
#8 | WRONG ANSWER | 0.00 s | details |
#9 | WRONG ANSWER | 0.00 s | details |
#10 | WRONG ANSWER | 0.00 s | details |
#11 | WRONG ANSWER | 0.00 s | details |
#12 | WRONG ANSWER | 0.00 s | details |
#13 | WRONG ANSWER | 0.00 s | details |
#14 | WRONG ANSWER | 0.00 s | details |
#15 | WRONG ANSWER | 0.00 s | details |
#16 | WRONG ANSWER | 0.00 s | details |
#17 | WRONG ANSWER | 0.01 s | details |
#18 | WRONG ANSWER | 0.00 s | details |
#19 | WRONG ANSWER | 0.00 s | details |
#20 | WRONG ANSWER | 0.00 s | details |
#21 | WRONG ANSWER | 0.00 s | details |
#22 | WRONG ANSWER | 0.00 s | details |
#23 | WRONG ANSWER | 0.00 s | details |
#24 | WRONG ANSWER | 0.00 s | details |
#25 | WRONG ANSWER | 0.00 s | details |
#26 | WRONG ANSWER | 0.00 s | details |
#27 | WRONG ANSWER | 0.00 s | details |
#28 | WRONG ANSWER | 0.00 s | details |
#29 | WRONG ANSWER | 0.00 s | details |
#30 | WRONG ANSWER | 0.00 s | details |
#31 | WRONG ANSWER | 0.00 s | details |
#32 | WRONG ANSWER | 0.00 s | details |
#33 | WRONG ANSWER | 0.00 s | details |
#34 | WRONG ANSWER | 0.00 s | details |
#35 | WRONG ANSWER | 0.00 s | details |
#36 | WRONG ANSWER | 0.00 s | details |
#37 | WRONG ANSWER | 0.00 s | details |
#38 | WRONG ANSWER | 0.00 s | details |
#39 | WRONG ANSWER | 0.00 s | details |
#40 | WRONG ANSWER | 0.00 s | details |
#41 | WRONG ANSWER | 0.00 s | details |
#42 | WRONG ANSWER | 0.00 s | details |
#43 | WRONG ANSWER | 0.00 s | details |
#44 | WRONG ANSWER | 0.00 s | details |
#45 | WRONG ANSWER | 0.00 s | details |
#46 | WRONG ANSWER | 0.00 s | details |
#47 | WRONG ANSWER | 0.00 s | details |
#48 | WRONG ANSWER | 0.00 s | details |
#49 | WRONG ANSWER | 0.00 s | details |
#50 | WRONG ANSWER | 0.00 s | details |
#51 | WRONG ANSWER | 0.00 s | details |
#52 | WRONG ANSWER | 0.00 s | details |
#53 | WRONG ANSWER | 0.00 s | details |
#54 | WRONG ANSWER | 0.00 s | details |
#55 | WRONG ANSWER | 0.00 s | details |
#56 | WRONG ANSWER | 0.00 s | details |
#57 | WRONG ANSWER | 0.00 s | details |
#58 | WRONG ANSWER | 0.07 s | details |
#59 | WRONG ANSWER | 0.06 s | details |
#60 | WRONG ANSWER | 0.06 s | details |
#61 | WRONG ANSWER | 0.06 s | details |
#62 | WRONG ANSWER | 0.06 s | details |
#63 | WRONG ANSWER | 0.06 s | details |
#64 | WRONG ANSWER | 0.06 s | details |
#65 | WRONG ANSWER | 0.06 s | details |
#66 | WRONG ANSWER | 0.07 s | details |
#67 | WRONG ANSWER | 0.07 s | details |
Code
#include <bits/stdc++.h> using namespace std; #define int long long #define vout(x) for(int i=0;i<(long long)x.size();i++) printf("%lld ",x[i]); // g++ <filename>.cpp -g -Wall -Wextra -DDEBUG -o <executable> // copied from: https://codeforces.com/blog/entry/79024 // === Debug macro starts here === int recur_depth = 0; #ifdef DEBUG #define dbg(x) {++recur_depth; auto x_=x; --recur_depth; cerr<<string(recur_depth, '\t')<<"\e[91m"<<__func__<<":"<<__LINE__<<"\t"<<#x<<" = "<<x_<<"\e[39m"<<endl;} #else #define dbg(x) #endif template<typename Ostream, typename Cont> typename enable_if<is_same<Ostream,ostream>::value, Ostream&>::type operator<<(Ostream& os, const Cont& v){ os<<"["; for(auto& x:v){os<<x<<", ";} return os<<"]"; } template<typename Ostream, typename ...Ts> Ostream& operator<<(Ostream& os, const pair<Ts...>& p){ return os<<"{"<<p.first<<", "<<p.second<<"}"; } // === Debug macro ends here === signed main() { int n; cin >> n; vector<int> heights(n+1); for (int i = 1; i <= n; i++) { cin >> heights[i]; } int left = 1, right = 2; int best_left = 0, best_right = 0; int best_height = 0; int current_height = 0; int prev_height = 0; while (right <= n) { current_height = heights[left] - heights[right]; dbg(left) dbg(right) dbg(current_height) dbg(prev_height) dbg(best_height) cout << "-----------" << "\n"; if (current_height <= 0) { // going up / same if (current_height <= 0 && prev_height <= 0 && current_height <= prev_height) { // continue prev_height = current_height; if (abs(current_height) > best_height) { best_height = abs(current_height); best_left = left; best_right = right; } right++; } else { prev_height = 0; left = right-1; } } else { // going down if (current_height >= 0 && prev_height >= 0 && current_height >= prev_height) { // continue prev_height = current_height; if (abs(current_height) > best_height) { best_height = abs(current_height); best_left = left; best_right = right; } right++; } else { prev_height = 0; left = right-1; } } // if (abs(current_height) > best_height) { // best_height = abs(current_height); // best_left = left; // best_right = right; // } } cout << best_left << " " << best_right << "\n"; return 0; }
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
2 14 15 |
correct output |
---|
1 2 |
user output |
---|
----------- 1 2 |
Test 2
Verdict: WRONG ANSWER
input |
---|
3 13 7 10 |
correct output |
---|
1 2 |
user output |
---|
----------- ----------- ----------- 1 2 |
Test 3
Verdict: WRONG ANSWER
input |
---|
3 4 1 11 |
correct output |
---|
2 3 |
user output |
---|
----------- ----------- ----------- 2 3 |
Test 4
Verdict: WRONG ANSWER
input |
---|
4 19 16 12 1 |
correct output |
---|
1 4 |
user output |
---|
----------- ----------- ----------- 1 4 |
Test 5
Verdict: WRONG ANSWER
input |
---|
4 16 6 1 14 |
correct output |
---|
1 3 |
user output |
---|
----------- ----------- ----------- ----------- 1 3 |
Test 6
Verdict: WRONG ANSWER
input |
---|
4 17 6 16 3 |
correct output |
---|
3 4 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... |
Test 7
Verdict: WRONG ANSWER
input |
---|
4 15 3 14 4 |
correct output |
---|
1 2 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... |
Test 8
Verdict: WRONG ANSWER
input |
---|
5 12 13 15 17 11 |
correct output |
---|
4 5 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... |
Test 9
Verdict: WRONG ANSWER
input |
---|
5 15 20 9 1 19 |
correct output |
---|
2 4 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... |
Test 10
Verdict: WRONG ANSWER
input |
---|
5 1 11 9 19 4 |
correct output |
---|
4 5 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... |
Test 11
Verdict: WRONG ANSWER
input |
---|
5 17 15 2 6 12 |
correct output |
---|
1 3 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... |
Test 12
Verdict: WRONG ANSWER
input |
---|
5 18 4 20 19 11 |
correct output |
---|
2 3 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... |
Test 13
Verdict: WRONG ANSWER
input |
---|
5 2 5 8 17 18 |
correct output |
---|
1 5 |
user output |
---|
----------- ----------- ----------- ----------- 1 5 |
Test 14
Verdict: WRONG ANSWER
input |
---|
5 5 7 17 18 19 |
correct output |
---|
1 5 |
user output |
---|
----------- ----------- ----------- ----------- 1 5 |
Test 15
Verdict: WRONG ANSWER
input |
---|
5 5 2 7 9 16 |
correct output |
---|
2 5 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... |
Test 16
Verdict: WRONG ANSWER
input |
---|
5 8 20 1 18 5 |
correct output |
---|
2 3 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... |
Test 17
Verdict: WRONG ANSWER
input |
---|
5 10 8 11 3 1 |
correct output |
---|
3 5 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... |
Test 18
Verdict: WRONG ANSWER
input |
---|
10 18 15 13 8 6 9 12 17 2 11 |
correct output |
---|
8 9 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 19
Verdict: WRONG ANSWER
input |
---|
10 20 19 9 8 7 5 3 2 1 15 |
correct output |
---|
1 9 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 20
Verdict: WRONG ANSWER
input |
---|
10 14 11 10 7 5 4 1 9 19 13 |
correct output |
---|
7 9 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 21
Verdict: WRONG ANSWER
input |
---|
10 17 12 2 3 18 15 9 6 11 1 |
correct output |
---|
3 5 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 22
Verdict: WRONG ANSWER
input |
---|
10 18 13 20 12 4 5 19 15 14 11 |
correct output |
---|
3 5 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 23
Verdict: WRONG ANSWER
input |
---|
10 18 8 17 2 10 13 16 5 19 20 |
correct output |
---|
3 4 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 24
Verdict: WRONG ANSWER
input |
---|
10 3 5 17 18 19 20 8 2 1 7 |
correct output |
---|
6 9 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 25
Verdict: WRONG ANSWER
input |
---|
10 9 7 16 5 20 2 10 15 11 6 |
correct output |
---|
5 6 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 26
Verdict: WRONG ANSWER
input |
---|
10 17 8 5 11 16 18 20 13 9 1 |
correct output |
---|
7 10 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 27
Verdict: WRONG ANSWER
input |
---|
10 1 2 3 5 7 8 9 10 11 18 |
correct output |
---|
1 10 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 28
Verdict: WRONG ANSWER
input |
---|
100 567896598 831327091 483130123 ... |
correct output |
---|
69 72 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 29
Verdict: WRONG ANSWER
input |
---|
100 122816 19636892 20795114 29407... |
correct output |
---|
1 89 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 30
Verdict: WRONG ANSWER
input |
---|
100 833824080 874174469 536879893 ... |
correct output |
---|
8 9 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 31
Verdict: WRONG ANSWER
input |
---|
100 55262494 701594610 766185388 6... |
correct output |
---|
8 10 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 32
Verdict: WRONG ANSWER
input |
---|
100 9648746 258813232 385222461 53... |
correct output |
---|
6 55 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 33
Verdict: WRONG ANSWER
input |
---|
100 934941692 892631472 873738594 ... |
correct output |
---|
86 99 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 34
Verdict: WRONG ANSWER
input |
---|
100 845689539 115595477 203519379 ... |
correct output |
---|
85 91 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 35
Verdict: WRONG ANSWER
input |
---|
100 142989603 219955038 288234167 ... |
correct output |
---|
75 91 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 36
Verdict: WRONG ANSWER
input |
---|
100 401801721 431563805 933290530 ... |
correct output |
---|
18 20 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 37
Verdict: WRONG ANSWER
input |
---|
100 941909102 697438766 224913296 ... |
correct output |
---|
56 76 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 38
Verdict: WRONG ANSWER
input |
---|
200 444811497 903431470 720091934 ... |
correct output |
---|
8 10 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 39
Verdict: WRONG ANSWER
input |
---|
200 57297596 89789519 99147813 105... |
correct output |
---|
23 39 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 40
Verdict: WRONG ANSWER
input |
---|
200 395789335 866736363 824087376 ... |
correct output |
---|
52 55 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 41
Verdict: WRONG ANSWER
input |
---|
200 993998009 985727231 981373466 ... |
correct output |
---|
161 188 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 42
Verdict: WRONG ANSWER
input |
---|
200 89318266 194047261 339427206 4... |
correct output |
---|
179 198 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 43
Verdict: WRONG ANSWER
input |
---|
200 97225921 989421484 860498340 2... |
correct output |
---|
77 78 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 44
Verdict: WRONG ANSWER
input |
---|
200 995627460 992989750 981609831 ... |
correct output |
---|
1 187 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 45
Verdict: WRONG ANSWER
input |
---|
200 1532101 17083619 26735342 4256... |
correct output |
---|
1 199 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 46
Verdict: WRONG ANSWER
input |
---|
200 998398659 993619192 979160666 ... |
correct output |
---|
1 112 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 47
Verdict: WRONG ANSWER
input |
---|
200 90258367 143387130 182032973 2... |
correct output |
---|
11 22 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 48
Verdict: WRONG ANSWER
input |
---|
1000 592912152 847045692 284064425 ... |
correct output |
---|
490 491 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 49
Verdict: WRONG ANSWER
input |
---|
1000 407810678 616563051 942898335 ... |
correct output |
---|
725 728 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 50
Verdict: WRONG ANSWER
input |
---|
1000 618641025 671935409 944035992 ... |
correct output |
---|
497 500 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 51
Verdict: WRONG ANSWER
input |
---|
1000 2282304 4581056 6503700 718786... |
correct output |
---|
770 959 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 52
Verdict: WRONG ANSWER
input |
---|
1000 6689688 6790280 12800426 17950... |
correct output |
---|
413 545 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 53
Verdict: WRONG ANSWER
input |
---|
1000 8085171 64232996 146972737 219... |
correct output |
---|
162 172 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 54
Verdict: WRONG ANSWER
input |
---|
1000 41889575 43478262 68992860 290... |
correct output |
---|
153 170 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 55
Verdict: WRONG ANSWER
input |
---|
1000 734196441 465297605 360643915 ... |
correct output |
---|
462 464 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 56
Verdict: WRONG ANSWER
input |
---|
1000 851978986 549468516 638503725 ... |
correct output |
---|
280 282 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 57
Verdict: WRONG ANSWER
input |
---|
1000 310014536 901327171 160589368 ... |
correct output |
---|
529 530 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 58
Verdict: WRONG ANSWER
input |
---|
100000 614666693 269733332 88642683 5... |
correct output |
---|
64140 64143 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 59
Verdict: WRONG ANSWER
input |
---|
100000 963621434 906592383 811925955 ... |
correct output |
---|
30884 30893 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 60
Verdict: WRONG ANSWER
input |
---|
100000 620599476 742651279 318143272 ... |
correct output |
---|
62622 62624 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 61
Verdict: WRONG ANSWER
input |
---|
100000 66346 70279 153396 279116 3958... |
correct output |
---|
10137 99793 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 62
Verdict: WRONG ANSWER
input |
---|
100000 966934856 941643238 875965742 ... |
correct output |
---|
82071 82082 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 63
Verdict: WRONG ANSWER
input |
---|
100000 888068198 739874627 942196434 ... |
correct output |
---|
2829 2831 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 64
Verdict: WRONG ANSWER
input |
---|
100000 169827791 713679537 698075748 ... |
correct output |
---|
10410 10412 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 65
Verdict: WRONG ANSWER
input |
---|
100000 3111323 221231927 255224728 25... |
correct output |
---|
24873 24881 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 66
Verdict: WRONG ANSWER
input |
---|
100000 300349845 13933235 833947124 8... |
correct output |
---|
14329 14331 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |
Test 67
Verdict: WRONG ANSWER
input |
---|
100000 200888519 113945962 138402355 ... |
correct output |
---|
80703 80719 |
user output |
---|
----------- ----------- ----------- ----------- ----------- ... Truncated |