Submission #171874


Source Code Expand

Copy
#include <stdio.h>
#include <stdlib.h>

typedef struct cell {
	int r;
	int c;
	int val;
} CELL;

int main(void) {
	int r, c, d;
	int i, j, k, len;
	CELL **line, *tmp;

	scanf("%d%d%d", &r, &c, &d);
	line = (CELL **)malloc(sizeof(CELL *) * r * c);
	len = 0;
	for (i = 0; i < r; i++) {
		for (j = 0; j < c; j++) {
			tmp = (CELL *)malloc(sizeof(CELL));
			scanf("%d", &tmp->val);
			for (k = len; k > 0 && tmp->val > line[k-1]->val; k--) {
				line[k] = line[k-1];
			}
			tmp->r = i, tmp->c = j;
			line[k] = tmp;
			len++;
		}
	}
	for (i = 0; i < len; i++) {
		j = line[i]->r + line[i]->c;
		if (d < j || d % 2 != j % 2) {
			continue;
		}
		break;
	}
	printf("%d\n\n", line[i]->val);
	return 0;
}

Submission Info

Submission Time
Task B - 謎の人物X
User holyakolonu
Language C (GCC 4.6.4)
Score 0
Code Size 735 Byte
Status WA
Exec Time 2031 ms
Memory 39720 KB

Compile Error

./Main.c: In function ‘main’:
./Main.c:15:7: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
./Main.c:21:9: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]

Judge Result

Set Name Sample Subtask1 Subtask2
Score / Max Score 0 / 0 0 / 60 0 / 40
Status
WA × 3
WA × 18
WA × 20
TLE × 10
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
Subtask1 sample_01.txt, sample_02.txt, sample_03.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt
Subtask2 subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask2_01.txt, subtask2_02.txt, subtask2_03.txt, subtask2_04.txt, subtask2_05.txt, subtask2_06.txt, subtask2_07.txt, subtask2_08.txt, subtask2_09.txt, subtask2_10.txt, subtask2_11.txt, subtask2_12.txt, subtask2_13.txt, subtask2_14.txt, subtask2_15.txt
Case Name Status Exec Time Memory
sample_01.txt WA 20 ms 700 KB
sample_02.txt WA 20 ms 788 KB
sample_03.txt WA 19 ms 704 KB
subtask1_01.txt WA 20 ms 796 KB
subtask1_02.txt WA 20 ms 788 KB
subtask1_03.txt WA 19 ms 800 KB
subtask1_04.txt WA 76 ms 1060 KB
subtask1_05.txt WA 19 ms 800 KB
subtask1_06.txt WA 23 ms 800 KB
subtask1_07.txt WA 59 ms 924 KB
subtask1_08.txt WA 21 ms 1056 KB
subtask1_09.txt WA 109 ms 1000 KB
subtask1_10.txt WA 78 ms 1060 KB
subtask1_11.txt WA 95 ms 1072 KB
subtask1_12.txt WA 46 ms 1012 KB
subtask1_13.txt WA 87 ms 1012 KB
subtask1_14.txt WA 90 ms 1008 KB
subtask1_15.txt WA 88 ms 1072 KB
subtask2_01.txt WA 23 ms 800 KB
subtask2_02.txt WA 22 ms 796 KB
subtask2_03.txt TLE 2030 ms 2600 KB
subtask2_04.txt WA 37 ms 928 KB
subtask2_05.txt WA 1388 ms 2216 KB
subtask2_06.txt TLE 2029 ms 2656 KB
subtask2_07.txt WA 236 ms 39720 KB
subtask2_08.txt TLE 2030 ms 2844 KB
subtask2_09.txt TLE 2029 ms 2856 KB
subtask2_10.txt TLE 2031 ms 2852 KB
subtask2_11.txt TLE 2029 ms 2976 KB
subtask2_12.txt TLE 2029 ms 2592 KB
subtask2_13.txt TLE 2030 ms 2596 KB
subtask2_14.txt TLE 2030 ms 2588 KB
subtask2_15.txt TLE 2028 ms 2596 KB