CSES - Datatähti 2017 loppu - Results
Submission details
Task:Ruudukko
Sender:siirikuoppala
Submission time:2017-01-19 15:14:42 +0200
Language:C++
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
#30
Test results
testverdicttimegroup
#1--1details
#2--1details
#3ACCEPTED0.03 s1details
#4ACCEPTED0.04 s1details
#5ACCEPTED0.07 s1details
#6ACCEPTED0.03 s1details
#7ACCEPTED0.07 s1details
#8ACCEPTED0.07 s1details
#9ACCEPTED0.05 s1details
#10--2details
#11ACCEPTED0.04 s2details
#12--2details
#13--2details
#14--2details
#15--2details
#16--3details
#17ACCEPTED0.05 s3details
#18--3details
#190.15 s3details
#200.21 s3details
#210.20 s3details

Code

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
typedef long long ll;
#define N (1<<15)

vector<int> v;
ll t[N], S[N], hyhh[N];

int  main(){
	int n; cin >> n;
	for(int i=1; i<=n; ++i){
		for(int j=0; j<n; ++j){
			v.push_back(i);
		}
	}
	while(true){
		random_shuffle(v.begin(), v.end());
		for(int i=0; i<n; ++i){
			int s=0;
			for(int j=0; j<n; ++j) s+=v[i*n+j];
			++S[s];
			s=0;
			for(int j=0; j<n; ++j) s+=v[j*n+i];
			++S[s];
		}
		int c=0;
		for(int i=0; i<N; ++i){
			if(S[i]>1) c=S[i];
			S[i]=0;
		}
		if(c>1) continue;
		for(int i=0; i<n; ++i){
			for(int j=0; j<n; ++j) cout << v[i*n+j] << " ";
			cout << "\n";
		}
		return 0;
	}
}

Test details

Test 1

Group: 1

Verdict:

input
2

correct output
QAQ

user output
(empty)

Test 2

Group: 1

Verdict:

input
3

correct output
QAQ

user output
(empty)

Test 3

Group: 1

Verdict: ACCEPTED

input
4

correct output
3 4 3 4
3 1 1 2
4 4 3 2
2 2 1 1

user output
1 1 3 2 
2 1 2 4 
3 3 3 4 
2 1 4 4 

Test 4

Group: 1

Verdict: ACCEPTED

input
5

correct output
2 3 4 1 1 
3 4 2 1 2 
4 2 3 1 3 
4 3 2 1 4 
5 5 5 5 5 

user output
1 1 5 3 1 
5 4 4 2 3 
1 2 3 1 2 
5 5 2 2 3 
4 3 5 4 4 

Test 5

Group: 1

Verdict: ACCEPTED

input
6

correct output
2 3 4 5 1 1 
3 4 5 2 1 2 
4 5 2 3 1 3 
5 2 3 4 1 4 
5 4 3 2 1 5 
...

user output
5 4 4 4 6 5 
3 5 2 6 6 1 
1 3 1 6 4 1 
4 2 3 3 2 1 
5 6 2 5 4 2 
...

Test 6

Group: 1

Verdict: ACCEPTED

input
7

correct output
2 3 4 5 6 1 1 
3 4 5 6 2 1 2 
4 5 6 2 3 1 3 
5 6 2 3 4 1 4 
6 2 3 4 5 1 5 
...

user output
5 5 6 5 7 4 3 
6 2 1 1 4 3 1 
4 7 1 4 5 7 1 
2 7 5 1 7 2 3 
2 4 2 6 3 4 5 
...

Test 7

Group: 1

Verdict: ACCEPTED

input
8

correct output
2 3 4 5 6 7 1 1 
3 4 5 6 7 2 1 2 
4 5 6 7 2 3 1 3 
5 6 7 2 3 4 1 4 
6 7 2 3 4 5 1 5 
...

user output
6 4 2 3 8 4 4 6 
3 6 7 5 6 1 4 2 
5 8 8 3 7 5 1 6 
7 2 7 8 4 3 6 8 
3 2 5 8 1 1 4 3 
...

Test 8

Group: 1

Verdict: ACCEPTED

input
9

correct output
2 3 4 5 6 7 8 1 1 
3 4 5 6 7 8 2 1 2 
4 5 6 7 8 2 3 1 3 
5 6 7 8 2 3 4 1 4 
6 7 8 2 3 4 5 1 5 
...

user output
1 8 1 9 4 2 4 3 1 
3 7 7 2 7 8 4 7 2 
9 8 3 9 6 8 7 4 1 
3 4 1 5 5 5 5 7 5 
2 2 5 6 6 4 1 9 6 
...

Test 9

Group: 1

Verdict: ACCEPTED

input
10

correct output
2 3 4 5 6 7 8 9 1 1 
3 4 5 6 7 8 9 2 1 2 
4 5 6 7 8 9 2 3 1 3 
5 6 7 8 9 2 3 4 1 4 
6 7 8 9 2 3 4 5 1 5 
...

user output
10 1 2 3 4 5 6 6 8 9 
8 10 9 9 8 7 10 4 7 3 
7 4 9 8 1 8 1 3 1 7 
5 3 6 9 10 3 5 2 9 1 
4 5 1 6 4 4 5 2 9 6 
...

Test 10

Group: 2

Verdict:

input
3

correct output
QAQ

user output
(empty)

Test 11

Group: 2

Verdict: ACCEPTED

input
4

correct output
3 4 3 4
3 1 1 2
4 4 3 2
2 2 1 1

user output
1 1 3 2 
2 1 2 4 
3 3 3 4 
2 1 4 4 

Test 12

Group: 2

Verdict:

input
29

correct output
2 3 4 5 6 7 8 9 10 11 12 13 14...

user output
(empty)

Test 13

Group: 2

Verdict:

input
48

correct output
2 3 4 5 6 7 8 9 10 11 12 13 14...

user output
(empty)

Test 14

Group: 2

Verdict:

input
80

correct output
2 3 4 5 6 7 8 9 10 11 12 13 14...

user output
(empty)

Test 15

Group: 2

Verdict:

input
97

correct output
2 3 4 5 6 7 8 9 10 11 12 13 14...

user output
(empty)

Test 16

Group: 3

Verdict:

input
3

correct output
QAQ

user output
(empty)

Test 17

Group: 3

Verdict: ACCEPTED

input
4

correct output
3 4 3 4
3 1 1 2
4 4 3 2
2 2 1 1

user output
1 1 3 2 
2 1 2 4 
3 3 3 4 
2 1 4 4 

Test 18

Group: 3

Verdict:

input
111

correct output
2 3 4 5 6 7 8 9 10 11 12 13 14...

user output
(empty)

Test 19

Group: 3

Verdict:

input
506

correct output
2 3 4 5 6 7 8 9 10 11 12 13 14...

user output
(empty)

Test 20

Group: 3

Verdict:

input
844

correct output
2 3 4 5 6 7 8 9 10 11 12 13 14...

user output
(empty)

Test 21

Group: 3

Verdict:

input
991

correct output
2 3 4 5 6 7 8 9 10 11 12 13 14...

user output
(empty)