CSES - Leirikisa 3 - Results
Submission details
Task:Sudoku
Sender:siirikuoppala
Submission time:2016-07-29 14:44:33 +0300
Language:C++
Status:READY
Result:100
Feedback
groupverdictscore
#1ACCEPTED100
Test results
testverdicttime
#1ACCEPTED0.06 sdetails
#2ACCEPTED0.06 sdetails
#3ACCEPTED0.06 sdetails
#4ACCEPTED0.05 sdetails
#5ACCEPTED0.05 sdetails

Code

#include <iostream>

using namespace std;

int t[9][9];
int main(){
    string s;
    cin >> s;
    for(int i=0; i<9; ++i){
        t[0][i]=s[i]-'0';
    }
    for(int k=0; k<9; k+=3){
        int a=0, b=0;
        for(int i=1; i<9; ++i){
            a+=3;
            if(i%3==0) ++b;
            for(int o=0; o<3; ++o) t[i][(k+a)%9+(b+o)%3]=t[0][k+o];
        }
    }for(int i=0; i<9; ++i) {
        for(int j=0; j<9; ++j) cout << t[i][j];
        cout << "\n";
    }

}

Test details

Test 1

Verdict: ACCEPTED

input
592836471

correct output
592836471
836471592
471592836
928364715
364715928
...

user output
592836471
471592836
836471592
259683147
147259683
...

Test 2

Verdict: ACCEPTED

input
672935418

correct output
672935418
935418672
418672935
729354186
354186729
...

user output
672935418
418672935
935418672
267593841
841267593
...

Test 3

Verdict: ACCEPTED

input
329174658

correct output
329174658
174658329
658329174
291746583
746583291
...

user output
329174658
658329174
174658329
932417865
865932417
...

Test 4

Verdict: ACCEPTED

input
376958421

correct output
376958421
958421376
421376958
769584213
584213769
...

user output
376958421
421376958
958421376
637895142
142637895
...

Test 5

Verdict: ACCEPTED

input
875694321

correct output
875694321
694321875
321875694
756943218
943218756
...

user output
875694321
321875694
694321875
587469132
132587469
...