Task: | Ruudukko |
Sender: | OSLeaf |
Submission time: | 2019-09-30 20:33:25 +0300 |
Language: | C++ (C++17) |
Status: | READY |
Result: | 100 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 100 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.00 s | details |
#2 | ACCEPTED | 0.01 s | details |
#3 | ACCEPTED | 0.01 s | details |
#4 | ACCEPTED | 0.01 s | details |
#5 | ACCEPTED | 0.18 s | details |
#6 | ACCEPTED | 0.19 s | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:24:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int g = 0; g < moi.size(); g++){ ~~^~~~~~~~~~~~ input/code.cpp:25:37: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int f = 0; f < moi.size(); f++){ ~~^~~~~~~~~~~~ input/code.cpp:40:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i = 0; i < taulukko.size(); i++){ ~~^~~~~~~~~~~~~~~~~ input/code.cpp:41:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int j = 0; j < taulukko[i].size(); j++){ ~~^~~~~~~~~~~~~~~~~~~~
Code
#include <iostream> #include <vector> using namespace std; int main() { int n, c = 1; cin >> n; vector<vector<int> > taulukko; for(int i = 0; i < n; i++){ vector<int> temp; for(int j = 0; j < n; j++){ vector<int> moi; for(int f = 0; f < i; f++){ moi.push_back(taulukko[f][j]); } for (int f = 0; f < j; f++){ moi.push_back(temp[f]); } for (int g = 0; g < moi.size(); g++){ for (int f = 0; f < moi.size(); f++){ if(c == moi[f]){ c++; } else {} } } temp.push_back(c); c = 1; } taulukko.push_back(temp); } for(int i = 0; i < taulukko.size(); i++){ for(int j = 0; j < taulukko[i].size(); j++){ cout << taulukko[i][j] << " "; } cout << endl; } return(0); }
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: ACCEPTED
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: ACCEPTED
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: ACCEPTED
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 |