제출 #490926

#제출 시각아이디문제언어결과실행 시간메모리
490926rainboyIzlet (COI19_izlet)C11
18 / 100
666 ms53068 KiB
#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;
}

컴파일 시 표준 에러 (stderr) 메시지

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...