CSES - Datatähti Open 2017 - Results
Submission details
Task:Grid
Sender:Sanja
Submission time:2017-01-22 12:38:33 +0200
Language:Pascal
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
#30
Test results
testverdicttimegroup
#1ACCEPTED0.04 s1details
#2ACCEPTED0.04 s1details
#30.04 s1details
#4ACCEPTED0.05 s1details
#50.04 s1details
#60.03 s1details
#70.05 s1details
#80.04 s1details
#90.04 s1details
#10ACCEPTED0.04 s2details
#110.04 s2details
#120.04 s2details
#130.05 s2details
#140.03 s2details
#150.05 s2details
#16ACCEPTED0.05 s3details
#170.04 s3details
#180.04 s3details
#190.04 s3details
#200.03 s3details
#210.13 s3details

Compiler report

/usr/bin/ld.bfd: warning: output/link.res contains output sections; did you forget -T?

Code

(*
*
* 1 1 1 2
* 1 2 2 3
* 2 3 4 4
* 3 4 4 3
*
*)

var A : array [ 1 .. 1000 , 1 .. 1000 ] of LongInt;
    N : LongInt;
    
var I , j : LongInt;

begin
  readLn ( N ) ; 
  
  
  if ( N < 4 ) then
    writeLn ( 'QAQ' )
  else
  begin
    
    
    if ( N mod 2 = 0 ) then
      halt(69);
    
    A[1][1] := 1; A[1][2] := 1; A[1][3] := 1; A[1][4] := 2;
    A[2][1] := 1; A[2][2] := 2; A[2][3] := 2; A[2][4] := 3;
    A[3][1] := 2; A[3][2] := 3; A[3][3] := 4; A[3][4] := 4;
    A[4][1] := 3; A[4][2] := 4; A[4][3] := 4; A[4][4] := 3;
    
    for i := 5 to N do
    begin
      if ( i mod 2 = N mod 2 ) then
      begin
        for j := 1 to N do
        begin
          A[i][j] := j;
          A[j][i] := I;
        end;
      end
      else
      begin
        for j := 1 to N do
        begin
          A[i][j] := I;
          A[j][i] := J;
        end;
      end;
      
    end;
    
    for i := 1 to N do
    begin
      for j := 1 to N do
        write ( A[i][j] , ' ' ) ; 
      writeLn();
    end;
    
    
    
    
    
  end;
end.

Test details

Test 1

Group: 1

Verdict: ACCEPTED

input
2

correct output
QAQ

user output
QAQ

Test 2

Group: 1

Verdict: ACCEPTED

input
3

correct output
QAQ

user output
QAQ

Test 3

Group: 1

Verdict:

input
4

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

user output
(empty)

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 1 2 5 
1 2 2 3 5 
2 3 4 4 5 
3 4 4 3 5 
1 2 3 4 5 

Test 5

Group: 1

Verdict:

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
(empty)

Test 6

Group: 1

Verdict:

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
1 1 1 2 5 1 7 
1 2 2 3 5 2 7 
2 3 4 4 5 3 7 
3 4 4 3 5 4 7 
1 2 3 4 5 5 7 
...

Test 7

Group: 1

Verdict:

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
(empty)

Test 8

Group: 1

Verdict:

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 1 1 2 5 1 7 1 9 
1 2 2 3 5 2 7 2 9 
2 3 4 4 5 3 7 3 9 
3 4 4 3 5 4 7 4 9 
1 2 3 4 5 5 7 5 9 
...

Test 9

Group: 1

Verdict:

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
(empty)

Test 10

Group: 2

Verdict: ACCEPTED

input
3

correct output
QAQ

user output
QAQ

Test 11

Group: 2

Verdict:

input
4

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

user output
(empty)

Test 12

Group: 2

Verdict:

input
29

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

user output
1 1 1 2 5 1 7 1 9 1 11 1 13 1 ...

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
1 1 1 2 5 1 7 1 9 1 11 1 13 1 ...

Test 16

Group: 3

Verdict: ACCEPTED

input
3

correct output
QAQ

user output
QAQ

Test 17

Group: 3

Verdict:

input
4

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

user output
(empty)

Test 18

Group: 3

Verdict:

input
111

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

user output
1 1 1 2 5 1 7 1 9 1 11 1 13 1 ...

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
1 1 1 2 5 1 7 1 9 1 11 1 13 1 ...