CSES - Datatähti 2020 alku - Results
Submission details
Task:Ruudukko
Sender:OSLeaf
Submission time:2019-09-30 20:33:25 +0300
Language:C++ (C++17)
Status:READY
Result:100
Feedback
groupverdictscore
#1ACCEPTED100
Test results
testverdicttime
#1ACCEPTED0.00 sdetails
#2ACCEPTED0.01 sdetails
#3ACCEPTED0.01 sdetails
#4ACCEPTED0.01 sdetails
#5ACCEPTED0.18 sdetails
#6ACCEPTED0.19 sdetails

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

user output

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