# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
490926 |
2021-11-29T21:42:04 Z |
rainboy |
Izlet (COI19_izlet) |
C |
|
666 ms |
53068 KB |
#include <stdio.h>
#define N 3000
int main() {
static int kk[N][N], cc[N], ii[N];
int n, n_, h, i, j, s, c;
scanf("%d%d", &s, &n);
if (s != 1)
return 0;
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
scanf("%d", &kk[i][j]);
n_ = 0;
for (i = 0, c = 1; i < n; i++) {
if (cc[i])
continue;
cc[i] = c, ii[n_++] = i;
for (j = i + 1; j < n; j++)
if (kk[i][j] == 1)
cc[j] = c, ii[n_++] = j;
c ^= 3;
}
for (i = 0; i < n; i++)
printf("%d ", cc[i]);
printf("\n");
for (h = 0; h < n - 1; h++)
printf("%d %d\n", ii[h] + 1, ii[h + 1] + 1);
return 0;
}
Compilation message
izlet.c: In function 'main':
izlet.c:9:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
9 | scanf("%d%d", &s, &n);
| ^~~~~~~~~~~~~~~~~~~~~
izlet.c:14:4: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
14 | scanf("%d", &kk[i][j]);
| ^~~~~~~~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
332 KB |
Output is correct |
2 |
Correct |
659 ms |
53064 KB |
Output is correct |
3 |
Correct |
661 ms |
53068 KB |
Output is correct |
4 |
Correct |
666 ms |
52996 KB |
Output is correct |
5 |
Correct |
648 ms |
52932 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
332 KB |
Output is correct |
2 |
Correct |
659 ms |
53064 KB |
Output is correct |
3 |
Correct |
661 ms |
53068 KB |
Output is correct |
4 |
Correct |
666 ms |
52996 KB |
Output is correct |
5 |
Correct |
648 ms |
52932 KB |
Output is correct |
6 |
Incorrect |
0 ms |
204 KB |
Unexpected end of file - int32 expected |
7 |
Halted |
0 ms |
0 KB |
- |