Task: | Ruudukko |
Sender: | JuhoS |
Submission time: | 2019-10-02 22:14:03 +0300 |
Language: | C++ (C++17) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.01 s | details |
#2 | ACCEPTED | 0.01 s | details |
#3 | WRONG ANSWER | 0.01 s | details |
#4 | WRONG ANSWER | 0.01 s | details |
#5 | WRONG ANSWER | 0.06 s | details |
#6 | WRONG ANSWER | 0.06 s | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:9:6: warning: unused variable 'cur' [-Wunused-variable] int cur = 1; ^~~ input/code.cpp:7:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &size); ~~~~~^~~~~~~~~~~~~
Code
#include <iostream> #include <stdlib.h> int main(void) { int size; scanf("%d", &size); int list[size][size]; int cur = 1; int i, j; int b = 0; for(i = 0; i < size; i++) { for(j = 0; j < size; j++) { for(int l = 1; l <=size; l++) { b = 1; for(int k = i; k > 0; k--) { if (list[i-k][j] == l) b = 0; } for(int k = j; k > 0; k--) { if (list[i][j-k] == l) b = 0; } if(b==1) { b = 0; list[i][j]=l; break; } } } } for(i = 0; i < size; i++) { for(j = 0; j < size; j++) { printf("%d ", list[i][j]); } printf("\n"); } }
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: WRONG ANSWER
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 5461 3 4 1 2 1426704560 4 3 2 1 5461 5 5461 1426352456 5461 1 |
Test 4
Verdict: WRONG ANSWER
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: WRONG ANSWER
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: WRONG ANSWER
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 |