Task: | Shallow waters |
Sender: | aalto2024h_006 |
Submission time: | 2024-10-23 16:33:22 +0300 |
Language: | C++ (C++17) |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.00 s | details |
#2 | ACCEPTED | 0.00 s | details |
#3 | ACCEPTED | 0.00 s | details |
#4 | ACCEPTED | 0.00 s | details |
#5 | ACCEPTED | 0.00 s | details |
#6 | ACCEPTED | 0.00 s | details |
#7 | ACCEPTED | 0.00 s | details |
#8 | ACCEPTED | 0.00 s | details |
#9 | ACCEPTED | 0.00 s | details |
#10 | ACCEPTED | 0.00 s | details |
#11 | ACCEPTED | 0.00 s | details |
#12 | ACCEPTED | 0.00 s | details |
#13 | ACCEPTED | 0.00 s | details |
#14 | WRONG ANSWER | 0.00 s | details |
#15 | WRONG ANSWER | 0.00 s | details |
#16 | ACCEPTED | 0.00 s | details |
#17 | ACCEPTED | 0.00 s | details |
#18 | ACCEPTED | 0.00 s | details |
#19 | ACCEPTED | 0.00 s | details |
#20 | WRONG ANSWER | 0.00 s | details |
#21 | ACCEPTED | 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.02 s | details |
#33 | WRONG ANSWER | 0.01 s | details |
#34 | WRONG ANSWER | 0.01 s | details |
#35 | WRONG ANSWER | 0.02 s | details |
#36 | WRONG ANSWER | 0.02 s | details |
#37 | WRONG ANSWER | 0.02 s | details |
#38 | WRONG ANSWER | 0.02 s | details |
#39 | WRONG ANSWER | 0.02 s | details |
#40 | WRONG ANSWER | 0.02 s | details |
#41 | WRONG ANSWER | 0.02 s | details |
#42 | WRONG ANSWER | 0.07 s | details |
#43 | WRONG ANSWER | 0.10 s | details |
#44 | WRONG ANSWER | 0.09 s | details |
#45 | WRONG ANSWER | 0.07 s | details |
#46 | WRONG ANSWER | 0.07 s | details |
#47 | WRONG ANSWER | 0.09 s | details |
#48 | WRONG ANSWER | 0.10 s | details |
#49 | WRONG ANSWER | 0.10 s | details |
#50 | WRONG ANSWER | 0.07 s | details |
#51 | WRONG ANSWER | 0.09 s | details |
#52 | WRONG ANSWER | 0.93 s | details |
#53 | TIME LIMIT EXCEEDED | -- | details |
#54 | WRONG ANSWER | 0.92 s | details |
#55 | TIME LIMIT EXCEEDED | -- | details |
#56 | WRONG ANSWER | 0.97 s | details |
#57 | WRONG ANSWER | 0.91 s | details |
#58 | WRONG ANSWER | 0.86 s | details |
#59 | TIME LIMIT EXCEEDED | -- | details |
#60 | WRONG ANSWER | 0.86 s | details |
#61 | WRONG ANSWER | 0.89 s | details |
Compiler report
input/code.cpp: In function 'void Test()': input/code.cpp:10:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result] 10 | freopen("temp\\in.txt", "r", stdin); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Code
#include<bits/stdc++.h> using namespace std; typedef long long LL; const int N=505; int f[N][N]; void Test() { freopen("temp\\in.txt", "r", stdin); } int main() { // Test(); int n, q; cin >> n >> q; for(int i=1; i<=n; i++) for(int j=1; j<=n; j++) cin >> f[i][j]; // Calc for(int i=1; i<=n; i++) for(int j=1; j<=n; j++) for(int k=1; k<=n; k++) { f[i][j] = max(f[i][j], min(f[i][k], f[k][j])); } while(q--) { int a, b; cin >> a >> b; cout << f[a][b] << endl; } return 0; }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
2 1 0 39 39 0 1 2 |
correct output |
---|
39 |
user output |
---|
39 |
Test 2
Verdict: ACCEPTED
input |
---|
2 1 0 48 48 0 2 1 |
correct output |
---|
48 |
user output |
---|
48 |
Test 3
Verdict: ACCEPTED
input |
---|
3 2 0 69 81 69 0 60 81 60 0 1 3 ... |
correct output |
---|
81 69 |
user output |
---|
81 69 |
Test 4
Verdict: ACCEPTED
input |
---|
3 1 0 41 45 41 0 64 45 64 0 1 2 |
correct output |
---|
45 |
user output |
---|
45 |
Test 5
Verdict: ACCEPTED
input |
---|
3 1 0 87 49 87 0 77 49 77 0 3 1 |
correct output |
---|
77 |
user output |
---|
77 |
Test 6
Verdict: ACCEPTED
input |
---|
3 3 0 56 38 56 0 7 38 7 0 1 2 ... |
correct output |
---|
56 38 38 |
user output |
---|
56 38 38 |
Test 7
Verdict: ACCEPTED
input |
---|
4 2 0 88 79 73 88 0 56 85 79 56 0 30 73 85 30 0 ... |
correct output |
---|
85 79 |
user output |
---|
85 79 |
Test 8
Verdict: ACCEPTED
input |
---|
4 1 0 54 20 63 54 0 100 37 20 100 0 33 63 37 33 0 ... |
correct output |
---|
54 |
user output |
---|
54 |
Test 9
Verdict: ACCEPTED
input |
---|
4 6 0 77 96 6 77 0 92 52 96 92 0 37 6 52 37 0 ... |
correct output |
---|
92 52 52 52 52 ... |
user output |
---|
92 52 52 52 52 ... |
Test 10
Verdict: ACCEPTED
input |
---|
4 2 0 41 12 88 41 0 57 61 12 57 0 77 88 61 77 0 ... |
correct output |
---|
61 88 |
user output |
---|
61 88 |
Test 11
Verdict: ACCEPTED
input |
---|
4 5 0 58 68 17 58 0 11 87 68 11 0 57 17 87 57 0 ... |
correct output |
---|
58 58 58 58 58 |
user output |
---|
58 58 58 58 58 |
Test 12
Verdict: ACCEPTED
input |
---|
5 4 0 86 65 6 80 86 0 39 97 82 65 39 0 28 53 6 97 28 0 48 ... |
correct output |
---|
86 86 86 65 |
user output |
---|
86 86 86 65 |
Test 13
Verdict: ACCEPTED
input |
---|
5 5 0 13 10 67 42 13 0 40 40 32 10 40 0 94 69 67 40 94 0 53 ... |
correct output |
---|
67 67 67 69 40 |
user output |
---|
67 67 67 69 40 |
Test 14
Verdict: WRONG ANSWER
input |
---|
5 5 0 95 34 12 63 95 0 16 30 82 34 16 0 49 53 12 30 49 0 69 ... |
correct output |
---|
69 82 69 82 53 |
user output |
---|
63 82 69 82 53 |
Test 15
Verdict: WRONG ANSWER
input |
---|
5 3 0 13 90 25 3 13 0 2 6 15 90 2 0 10 46 25 6 10 0 46 ... |
correct output |
---|
46 46 46 |
user output |
---|
25 46 46 |
Test 16
Verdict: ACCEPTED
input |
---|
5 4 0 86 22 70 78 86 0 15 26 1 22 15 0 91 20 70 26 91 0 58 ... |
correct output |
---|
86 70 70 70 |
user output |
---|
86 70 70 70 |
Test 17
Verdict: ACCEPTED
input |
---|
5 3 0 37 62 49 9 37 0 40 30 65 62 40 0 100 74 49 30 100 0 82 ... |
correct output |
---|
62 62 62 |
user output |
---|
62 62 62 |
Test 18
Verdict: ACCEPTED
input |
---|
5 3 0 7 60 54 44 7 0 10 34 76 60 10 0 49 74 54 34 49 0 39 ... |
correct output |
---|
60 54 74 |
user output |
---|
60 54 74 |
Test 19
Verdict: ACCEPTED
input |
---|
5 4 0 98 54 42 68 98 0 27 27 87 54 27 0 2 81 42 27 2 0 34 ... |
correct output |
---|
42 42 81 42 |
user output |
---|
42 42 81 42 |
Test 20
Verdict: WRONG ANSWER
input |
---|
5 5 0 38 2 41 56 38 0 62 53 15 2 62 0 88 55 41 53 88 0 71 ... |
correct output |
---|
56 62 62 56 71 |
user output |
---|
41 62 62 56 71 |
Test 21
Verdict: ACCEPTED
input |
---|
5 8 0 1 22 14 17 1 0 88 9 32 22 88 0 40 88 14 9 40 0 38 ... |
correct output |
---|
22 40 22 40 40 ... |
user output |
---|
22 40 22 40 40 ... |
Test 22
Verdict: WRONG ANSWER
input |
---|
10 26 0 65 80 9 98 64 27 62 36 68 65 0 82 65 48 59 19 15 62 18 80 82 0 3 80 15 78 62 44 22 9 65 3 0 81 54 74 23 91 36 ... |
correct output |
---|
98 81 76 80 80 ... |
user output |
---|
98 78 76 80 78 ... |
Test 23
Verdict: WRONG ANSWER
input |
---|
10 1 0 10 42 68 81 90 10 32 99 45 10 0 32 92 72 83 60 15 67 47 42 32 0 42 97 9 43 69 75 91 68 92 42 0 81 83 68 79 30 10 ... |
correct output |
---|
90 |
user output |
---|
81 |
Test 24
Verdict: WRONG ANSWER
input |
---|
10 25 0 34 63 79 51 60 47 39 97 43 34 0 82 26 30 57 37 62 51 81 63 82 0 86 7 23 21 80 51 44 79 26 86 0 29 23 47 100 22 36 ... |
correct output |
---|
81 81 81 66 100 ... |
user output |
---|
79 79 79 66 100 ... |
Test 25
Verdict: WRONG ANSWER
input |
---|
10 10 0 90 3 60 29 79 98 10 41 87 90 0 15 92 31 82 15 42 57 67 3 15 0 3 70 31 68 66 47 59 60 92 3 0 59 26 33 79 75 88 ... |
correct output |
---|
82 79 90 91 79 ... |
user output |
---|
82 79 90 91 79 ... |
Test 26
Verdict: WRONG ANSWER
input |
---|
10 41 0 22 78 60 44 8 53 55 40 51 22 0 1 82 2 7 88 22 64 47 78 1 0 1 95 61 94 53 63 69 60 82 1 0 4 18 84 19 23 36 ... |
correct output |
---|
78 78 61 78 64 ... |
user output |
---|
60 78 61 78 64 ... Truncated |
Test 27
Verdict: WRONG ANSWER
input |
---|
10 35 0 62 9 28 60 15 3 58 26 47 62 0 65 21 74 90 48 37 73 58 9 65 0 42 27 17 21 1 81 99 28 21 42 0 2 96 69 70 67 7 ... |
correct output |
---|
62 62 62 62 90 ... |
user output |
---|
62 58 62 62 90 ... Truncated |
Test 28
Verdict: WRONG ANSWER
input |
---|
10 35 0 60 44 100 6 55 72 72 75 38 60 0 76 92 68 58 47 80 39 74 44 76 0 82 72 13 100 94 73 71 100 92 82 0 15 9 55 89 47 25 ... |
correct output |
---|
89 83 89 89 92 ... |
user output |
---|
82 72 82 82 92 ... Truncated |
Test 29
Verdict: WRONG ANSWER
input |
---|
10 20 0 54 68 91 61 14 21 84 46 72 54 0 87 70 26 45 49 45 55 42 68 87 0 22 96 53 50 77 36 42 91 70 22 0 86 39 62 96 32 99 ... |
correct output |
---|
91 87 87 96 91 ... |
user output |
---|
86 70 87 96 86 ... |
Test 30
Verdict: WRONG ANSWER
input |
---|
10 9 0 2 56 43 7 23 3 32 7 80 2 0 15 36 30 54 34 15 65 23 56 15 0 29 99 40 36 44 61 99 43 36 29 0 68 95 28 12 14 57 ... |
correct output |
---|
90 67 67 90 67 ... |
user output |
---|
90 58 67 90 67 ... |
Test 31
Verdict: WRONG ANSWER
input |
---|
10 30 0 22 17 58 39 81 65 88 62 19 22 0 32 14 63 84 21 80 44 93 17 32 0 90 70 99 87 91 50 69 58 14 90 0 57 11 93 5 60 40 ... |
correct output |
---|
88 88 88 88 93 ... |
user output |
---|
88 88 76 88 84 ... |
Test 32
Verdict: WRONG ANSWER
input |
---|
100 4060 0 224279712 686036287 45105249... |
correct output |
---|
984509996 986462105 982248996 984656610 985935261 ... |
user output |
---|
904487182 896222394 971118925 962889961 971118925 ... Truncated |
Test 33
Verdict: WRONG ANSWER
input |
---|
100 676 0 527822662 997975632 53018119... |
correct output |
---|
993798769 991489320 988392606 975549477 986420088 ... |
user output |
---|
947130409 989936433 953478969 953478969 968192837 ... Truncated |
Test 34
Verdict: WRONG ANSWER
input |
---|
100 333 0 436234512 371770128 46427426... |
correct output |
---|
973778856 973778856 975526572 973096824 972749112 ... |
user output |
---|
876151369 973778856 964815863 965110751 972749112 ... Truncated |
Test 35
Verdict: WRONG ANSWER
input |
---|
100 3357 0 68472304 913723608 220052402... |
correct output |
---|
987176834 981901632 989344571 983084587 989344571 ... |
user output |
---|
943470954 942892464 863180681 949299151 885889078 ... Truncated |
Test 36
Verdict: WRONG ANSWER
input |
---|
100 3628 0 534502368 539714259 28374756... |
correct output |
---|
986332762 993409969 993409969 984535136 986332762 ... |
user output |
---|
946784894 993409969 993409969 927866309 922144376 ... Truncated |
Test 37
Verdict: WRONG ANSWER
input |
---|
100 4615 0 509293538 258847661 53332274... |
correct output |
---|
986084005 993410015 993410015 965516330 986242161 ... |
user output |
---|
950514759 908194683 960659019 947716733 934716235 ... Truncated |
Test 38
Verdict: WRONG ANSWER
input |
---|
100 2345 0 863913461 192636102 88476477... |
correct output |
---|
985034014 984712168 970064352 985034014 983716327 ... |
user output |
---|
971820394 917943539 963028160 954462093 973636179 ... Truncated |
Test 39
Verdict: WRONG ANSWER
input |
---|
100 4167 0 278244915 816596895 99494306... |
correct output |
---|
994650753 988169835 988586303 974999473 988169835 ... |
user output |
---|
994650753 954827576 949214931 874113284 951482941 ... Truncated |
Test 40
Verdict: WRONG ANSWER
input |
---|
100 2952 0 908068381 834928493 76958654... |
correct output |
---|
971019561 990687292 981311675 986274515 994580228 ... |
user output |
---|
908068381 935241037 891883099 966527859 925539733 ... Truncated |
Test 41
Verdict: WRONG ANSWER
input |
---|
100 1620 0 257277309 280264417 59391568... |
correct output |
---|
977276808 986699027 973703850 984814274 986229209 ... |
user output |
---|
872598205 984054212 880578674 916917307 951293938 ... Truncated |
Test 42
Verdict: WRONG ANSWER
input |
---|
200 455 0 686036287 971118925 48977720... |
correct output |
---|
991763634 993383365 989047420 993694416 992916290 ... |
user output |
---|
971118925 979592123 975080855 979134973 955772515 ... Truncated |
Test 43
Verdict: WRONG ANSWER
input |
---|
200 12733 0 997975632 145040139 59548994... |
correct output |
---|
992841688 994103522 994103522 993324323 993413618 ... |
user output |
---|
898044684 955817416 922936687 985972651 953142501 ... Truncated |
Test 44
Verdict: WRONG ANSWER
input |
---|
200 10671 0 371770128 104741444 35097588... |
correct output |
---|
994112705 992684847 991175588 992684847 991850584 ... |
user output |
---|
938891597 962983731 979278754 912985221 972463338 ... Truncated |
Test 45
Verdict: WRONG ANSWER
input |
---|
200 785 0 913723608 846741138 23261249... |
correct output |
---|
991015102 991393613 991393613 991393613 991393613 ... |
user output |
---|
949299151 914605562 904471985 982626279 981648283 ... Truncated |
Test 46
Verdict: WRONG ANSWER
input |
---|
200 4341 0 539714259 993409969 52728320... |
correct output |
---|
995748996 992259426 995648041 995748996 995748996 ... |
user output |
---|
960063705 955147064 985091165 973121385 975753902 ... Truncated |
Test 47
Verdict: WRONG ANSWER
input |
---|
200 10033 0 258847661 29756805 772449744... |
correct output |
---|
994518775 994534294 994518775 974715985 990234431 ... |
user output |
---|
915390541 920030019 974360837 970367772 939551749 ... Truncated |
Test 48
Verdict: WRONG ANSWER
input |
---|
200 19576 0 192636102 43478262 277317100... |
correct output |
---|
990666123 991249036 990616659 991249036 991249036 ... |
user output |
---|
932187063 989926085 990616659 978761267 979811509 ... Truncated |
Test 49
Verdict: WRONG ANSWER
input |
---|
200 17516 0 816596895 223011120 40179408... |
correct output |
---|
989788855 989788855 989788855 989788855 989788855 ... |
user output |
---|
891235065 917827066 986348033 952796485 927675701 ... Truncated |
Test 50
Verdict: WRONG ANSWER
input |
---|
200 2236 0 834928493 789779330 75492200... |
correct output |
---|
990202245 990881031 993287512 993287512 996688854 ... |
user output |
---|
940746258 880698436 984392856 973702725 996688854 ... Truncated |
Test 51
Verdict: WRONG ANSWER
input |
---|
200 13669 0 280264417 35137122 58869367 ... |
correct output |
---|
985495492 987275634 987275634 987275634 987275634 ... |
user output |
---|
928742354 967819356 967819356 953209723 937708715 ... Truncated |
Test 52
Verdict: WRONG ANSWER
input |
---|
500 44127 0 623250361 488402074 93887976... |
correct output |
---|
997518315 997518315 997518315 997518315 997247172 ... |
user output |
---|
938879765 939267509 997518315 989027210 975010004 ... Truncated |
Test 53
Verdict: TIME LIMIT EXCEEDED
input |
---|
500 89310 0 410279705 670881494 19798128... |
correct output |
---|
994290020 994290020 994290020 994290020 994290020 ... |
user output |
---|
(empty) |
Test 54
Verdict: WRONG ANSWER
input |
---|
500 32068 0 556762013 260875339 89984504... |
correct output |
---|
996936245 996567301 996936245 996936245 996393864 ... |
user output |
---|
962004833 979897169 969521211 984874520 969958577 ... Truncated |
Test 55
Verdict: TIME LIMIT EXCEEDED
input |
---|
500 81911 0 365429213 243439455 38401914... |
correct output |
---|
996657976 995517614 996657976 996419449 996657976 ... |
user output |
---|
(empty) |
Test 56
Verdict: WRONG ANSWER
input |
---|
500 66557 0 736625865 907021066 67376384... |
correct output |
---|
996250418 996250418 996250418 996250418 996250418 ... |
user output |
---|
927578729 956595607 971968073 974139277 972218241 ... Truncated |
Test 57
Verdict: WRONG ANSWER
input |
---|
500 28215 0 507642456 772882187 23298617... |
correct output |
---|
996927836 995199945 988550843 996861124 996927836 ... |
user output |
---|
955725718 937694148 968226386 942501233 974979270 ... Truncated |
Test 58
Verdict: WRONG ANSWER
input |
---|
500 4722 0 681246594 433718444 81827072... |
correct output |
---|
996596738 995772851 996596738 995904634 994249067 ... |
user output |
---|
973657214 977484579 973172832 993460825 989829385 ... Truncated |
Test 59
Verdict: TIME LIMIT EXCEEDED
input |
---|
500 66897 0 670154826 911171975 19319438... |
correct output |
---|
997410816 997103192 997322209 997322209 997410816 ... |
user output |
---|
(empty) |
Test 60
Verdict: WRONG ANSWER
input |
---|
500 4171 0 998224343 144467837 75333130... |
correct output |
---|
997492638 996317859 993722528 996341116 997492638 ... |
user output |
---|
993728873 975921158 992287640 989833030 965913004 ... Truncated |
Test 61
Verdict: WRONG ANSWER
input |
---|
500 18979 0 722938317 668705452 11233444... |
correct output |
---|
997573682 994464545 996219897 997093906 997573682 ... |
user output |
---|
982477790 955791388 985418424 971992317 975380276 ... Truncated |