| Task: | Ruudukko |
| Sender: | toveri_heino |
| Submission time: | 2019-10-04 20:17:07 +0300 |
| Language: | C++ (C++17) |
| Status: | READY |
| Result: | 0 |
| group | verdict | score |
|---|---|---|
| #1 | WRONG ANSWER | 0 |
| test | verdict | time | |
|---|---|---|---|
| #1 | WRONG ANSWER | 0.01 s | details |
| #2 | WRONG ANSWER | 0.00 s | details |
| #3 | WRONG ANSWER | 0.01 s | details |
| #4 | WRONG ANSWER | 0.01 s | details |
| #5 | WRONG ANSWER | 0.04 s | details |
| #6 | WRONG ANSWER | 0.04 s | details |
Compiler report
input/code.cpp: In function 'int main()':
input/code.cpp:30:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n);
~~~~~^~~~~~~~~~Code
#include <stdio.h>
int is_int(int a, int b[], int n) {
int res = 0;
int i=1;
while (i<=n) {
if (b[i] == a) {
// printf("_%d_",b[i]);
res = 1;
break;
}
++i;
}
return res;
}
int pick_one(int a[], int b[], int n) {
int res = 1;
for (int i_a = 1; i_a<=n;i_a++) {
if((is_int(i_a,a,n) == 0) && (!is_int(i_a,b,n))) {
res = i_a;
break;
};
}
return res;
}
int main() {
int n;
printf("Syota n: ");
scanf("%d", &n);
int his_row[n+1][n+1], his_col[n+1][n+1];
for(int row = 1; row <= n; row++) {
for(int col = 1; col <= n; col++) {
int m = pick_one(his_row[row], his_col[col], n);
printf("%d ", m);
his_row[row][col] = m;
his_col[col][row] = m;
}
printf("\n");
}
// int g[10] = {0,2,3,4,5,6,7};
// printf("%d\n", pick_one(g,g,n));
}
Test details
Test 1
Verdict: WRONG ANSWER
| input |
|---|
| 1 |
| correct output |
|---|
| 1 |
| user output |
|---|
| Syota n: 1 |
Test 2
Verdict: WRONG ANSWER
| input |
|---|
| 2 |
| correct output |
|---|
| 1 2 2 1 |
| user output |
|---|
| Syota n: 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 |
|---|
| Syota n: 2 1 3 4 5 3 2 1 5 4 1 3 2 1 1 4 5 1 2 3 5 4 1 3 2 |
Test 4
Verdict: WRONG ANSWER
| input |
|---|
| 42 |
| correct output |
|---|
| 1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
| user output |
|---|
| Syota n: 1 2 3 4 5 6 7 8 9 10 ... 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 |
|---|
| Syota n: 1 2 3 4 5 6 7 8 9 10 ... 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 |
|---|
| Syota n: 1 2 3 4 5 6 7 8 9 10 ... Truncated |
