Task: | Karuselli |
Sender: | ollpu |
Submission time: | 2017-03-06 19:27:07 +0200 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | RUNTIME ERROR | 0 |
#2 | WRONG ANSWER | 0 |
#3 | RUNTIME ERROR | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | RUNTIME ERROR | 0.23 s | 1 | details |
#2 | ACCEPTED | 0.15 s | 1 | details |
#3 | ACCEPTED | 0.16 s | 1 | details |
#4 | ACCEPTED | 0.15 s | 1 | details |
#5 | ACCEPTED | 0.14 s | 1 | details |
#6 | WRONG ANSWER | 0.04 s | 2 | details |
#7 | WRONG ANSWER | 0.04 s | 2 | details |
#8 | WRONG ANSWER | 0.04 s | 2 | details |
#9 | WRONG ANSWER | 0.04 s | 2 | details |
#10 | WRONG ANSWER | 0.05 s | 2 | details |
#11 | RUNTIME ERROR | 0.26 s | 3 | details |
#12 | WRONG ANSWER | 0.70 s | 3 | details |
#13 | WRONG ANSWER | 0.68 s | 3 | details |
#14 | WRONG ANSWER | 0.67 s | 3 | details |
#15 | WRONG ANSWER | 0.70 s | 3 | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:28:36: warning: 't2m' may be used uninitialized in this function [-Wmaybe-uninitialized] } else cout << t[0][t1m]+t[1][t2m] << endl; ^ input/code.cpp:28:26: warning: 't1m' may be used uninitialized in this function [-Wmaybe-uninitialized] } else cout << t[0][t1m]+t[1][t2m] << endl; ^ input/code.cpp:27:36: warning: 't2m_' may be used uninitialized in this function [-Wmaybe-uninitialized] cout << max(t[0][t1m]+t[1][t2m_], t[0][t1m_]+t[1][t2m]) << endl; ^ input/code.cpp:27:48: warning: 't1m_' may be used uninitialized in this function [-Wmaybe-uninitialized] cout << max(t[0][t1m]+t[1][t2m_], t[0][t1m_]+t[1][t2m]) << endl; ^
Code
#include <iostream> using namespace std; int main() { ios_base::sync_with_stdio(); cin.tie(0); int n, k; cin >> n >> k; int t[n][k]; for (int i = 0; i < n; ++i) { for (int j = 0; j < k; ++j) { cin >> t[i][j]; } } int t1m, t1v = 0; int t2m, t2v = 0; int t1m_, t2m_; for (int i = 0; i < k; ++i) { if (t[0][i] > t1v) t1v = t[0][i], t1m = i; if (t[1][i] > t2v) t2v = t[1][i], t2m = i; } t1v = 0; t2v = 0; for (int i = 0; i < k; ++i) { if (t[0][i] > t1v && i != t1m) t1v = t[0][i], t1m_ = i; if (t[1][i] > t2v && i != t2m) t2v = t[1][i], t2m_ = i; } if (t1m == t2m) { cout << max(t[0][t1m]+t[1][t2m_], t[0][t1m_]+t[1][t2m]) << endl; } else cout << t[0][t1m]+t[1][t2m] << endl; }
Test details
Test 1
Group: 1
Verdict: RUNTIME ERROR
input |
---|
1 100000 557222713 738086719 759310230 ... |
correct output |
---|
999997412 |
user output |
---|
(empty) |
Test 2
Group: 1
Verdict: ACCEPTED
input |
---|
2 100000 173028329 323213810 439376948 ... |
correct output |
---|
1999979389 |
user output |
---|
1999979389 |
Test 3
Group: 1
Verdict: ACCEPTED
input |
---|
2 100000 499570894 150469086 335977485 ... |
correct output |
---|
1999973920 |
user output |
---|
1999973920 |
Test 4
Group: 1
Verdict: ACCEPTED
input |
---|
2 100000 863032160 931625464 885185608 ... |
correct output |
---|
1999939689 |
user output |
---|
1999939689 |
Test 5
Group: 1
Verdict: ACCEPTED
input |
---|
2 100000 831463088 525853809 390350738 ... |
correct output |
---|
1999969705 |
user output |
---|
1999969705 |
Test 6
Group: 2
Verdict: WRONG ANSWER
input |
---|
1 200 344318490 251860941 939326382 ... |
correct output |
---|
998010019 |
user output |
---|
1995781539 |
Test 7
Group: 2
Verdict: WRONG ANSWER
input |
---|
14 200 43513423 154416018 137660602 1... |
correct output |
---|
13918226615 |
user output |
---|
1980904979 |
Test 8
Group: 2
Verdict: WRONG ANSWER
input |
---|
14 200 881307544 967733810 371467276 ... |
correct output |
---|
13961979091 |
user output |
---|
1995295321 |
Test 9
Group: 2
Verdict: WRONG ANSWER
input |
---|
14 200 522563563 350867137 498280483 ... |
correct output |
---|
13912986556 |
user output |
---|
1973735879 |
Test 10
Group: 2
Verdict: WRONG ANSWER
input |
---|
14 200 852825364 914968833 967854069 ... |
correct output |
---|
13929235436 |
user output |
---|
1990439361 |
Test 11
Group: 3
Verdict: RUNTIME ERROR
input |
---|
1 100000 157285470 474162109 440472842 ... |
correct output |
---|
999998218 |
user output |
---|
(empty) |
Test 12
Group: 3
Verdict: WRONG ANSWER
input |
---|
14 100000 971542960 589024445 443526352 ... |
correct output |
---|
13999781843 |
user output |
---|
1999978121 |
Test 13
Group: 3
Verdict: WRONG ANSWER
input |
---|
14 100000 255470528 36303969 757946964 7... |
correct output |
---|
13999894454 |
user output |
---|
1999967710 |
Test 14
Group: 3
Verdict: WRONG ANSWER
input |
---|
14 100000 18178744 935999032 93142616 43... |
correct output |
---|
13999804193 |
user output |
---|
1999994677 |
Test 15
Group: 3
Verdict: WRONG ANSWER
input |
---|
14 100000 316827351 638928258 809826490 ... |
correct output |
---|
13999909014 |
user output |
---|
1999978478 |