Task: | Ruudukko |
Sender: | Uolevi |
Submission time: | 2019-09-30 00:28:01 +0300 |
Language: | C++ (C++11) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.01 s | details |
#2 | ACCEPTED | 0.01 s | details |
#3 | ACCEPTED | 0.01 s | details |
#4 | WRONG ANSWER | 0.01 s | details |
#5 | WRONG ANSWER | 0.01 s | details |
#6 | WRONG ANSWER | 0.01 s | details |
Code
#include<bits/stdc++.h> using namespace std; // EIku oho int n; vector<vector<int>> ve; int main(){ cin >> n; if(n == 1){ cout << 1 << "\n"; }else if(n == 2){ cout << 1 << " " << 2 << "\n"; cout << 2 << " " << 1 << "\n"; }else if(n == 3){ cout << 1 << " " << 2 << " " << 3 << "\n"; cout << 2 << " " << 1 << " " << 4 << "\n"; cout << 3 << " " << 4 << " " << 1 << "\n"; } if(n >= 4){ ve.push_back({1,2,3,4}); ve.push_back({2,1,4,3}); ve.push_back({3,4,1,2}); ve.push_back({4,3,2,1}); int a = 4; while(a < n){ for(int i = 0; i < a; i++){ ve[i].push_back(a+i+1); } ve.push_back({}); for(int j = 0; j <= a; j++){ if(j != a){ ve[ve.size()-1].push_back(a+j+1); }else{ ve[ve.size()-1].push_back(1); } } a++; } } for(auto u : ve){ for(auto x : u){ cout << x << " "; } cout << "\n"; } }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
1 |
correct output |
---|
1 |
user output |
---|
1 |
Test 2
Verdict: ACCEPTED
input |
---|
2 |
correct output |
---|
1 2 2 1 |
user output |
---|
1 2 2 1 |
Test 3
Verdict: ACCEPTED
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 |
---|
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 |
Test 4
Verdict: WRONG ANSWER
input |
---|
42 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... 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 |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... 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 |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... Truncated |