Task: | Ruudukko |
Sender: | jusola |
Submission time: | 2019-10-01 20:13:16 +0300 |
Language: | C++ (C++11) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.01 s | details |
#2 | WRONG ANSWER | 0.01 s | details |
#3 | WRONG ANSWER | 0.01 s | details |
#4 | WRONG ANSWER | 0.02 s | details |
#5 | WRONG ANSWER | 0.22 s | details |
#6 | WRONG ANSWER | 0.22 s | details |
Code
#include <iostream> #include <fstream> #include <stdlib.h> #include <string> #include <algorithm> #include <iterator> using namespace std; int main(){ int num; cin >> num; int arr[200][200]; for (int r = 0; r < num; r++){ for (int c = 0; c < num; c++){ int smallest = 0; bool found = false; int arrR[200]; int arrC[200]; cout << r << "," << c << ": " << "rArr: "; for(int i = 0; i < num; i++){ arrR[i] = arr[r][i]; cout<<arrR[i]<<" "; } cout << "\n"; cout << r << "," << c << ": " << "cArr: "; for(int i = 0; i < num; i++){ arrC[i] = arr[i][c]; cout<<arrC[i]<<" "; } while(!found){ smallest++; int *rPointer = std::find(std::begin(arrR), std::end(arrR), smallest); int *cPointer = std::find(std::begin(arrC), std::end(arrC), smallest); if(rPointer == std::end(arrR) && cPointer == std::end(arrC)){ found = true; } } cout << "\n" << r << "," << c << ": " << "smallest: " << smallest << "\n"; arr[r][c] = smallest; cout << "END\n"; } } for(int r2 = 0; r2 < num; r2++) { if(r2 != 0){ cout << "\n"; } for(int c2 = 0; c2 < num; c2++) { if(c2 != 0){ cout<<" " << arr[r2][c2]; }else{ cout<<arr[r2][c2]; } } } return 0; }
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
1 |
correct output |
---|
1 |
user output |
---|
0,0: rArr: 0 0,0: cArr: 0 0,0: smallest: 1 END 1 |
Test 2
Verdict: WRONG ANSWER
input |
---|
2 |
correct output |
---|
1 2 2 1 |
user output |
---|
0,0: rArr: 0 0 0,0: cArr: 0 0 0,0: smallest: 1 END 0,1: rArr: 1 0 ... Truncated |
Test 3
Verdict: WRONG ANSWER
input |
---|
5 |
correct output |
---|
1 2 3 4 5 2 1 4 3 6 3 4 1 2 7 4 3 2 1 8 5 6 7 8 1 |
user output |
---|
0,0: rArr: 0 0 0 0 0 0,0: cArr: 0 0 0 0 0 0,0: smallest: 1 END 0,1: rArr: 1 0 0 0 0 ... Truncated |
Test 4
Verdict: WRONG ANSWER
input |
---|
42 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
0,0: rArr: 0 0 0 0 0 0 0 0 0 0... Truncated |
Test 5
Verdict: WRONG ANSWER
input |
---|
99 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
0,0: rArr: 0 0 0 0 0 0 0 0 0 0... Truncated |
Test 6
Verdict: WRONG ANSWER
input |
---|
100 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
0,0: rArr: 0 0 0 0 0 0 0 0 0 0... Truncated |