Submission #536547

# Submission time Handle Problem Language Result Execution time Memory
536547 2022-03-13T13:51:25 Z rainboy 허수아비 (JOI14_scarecrows) C
0 / 100
5 ms 424 KB
#include <stdio.h>

#define N	200

int main() {
	static int xx[N], yy[N];
	int n, i, j, k, cnt;

	scanf("%d", &n);
	for (i = 0; i < n; i++)
		scanf("%d%d", &xx[i], &yy[i]);
	cnt = 0;
	for (i = 0; i < n; i++)
		for (j = i + 1; j < n; j++) {
			if ((xx[i] < xx[j]) != (yy[i] < yy[j]))
				continue;
			cnt++;
			for (k = 0; k < n; k++)
				if (k != i && k != j && (xx[i] < xx[k]) != (xx[j] < xx[k]) && (yy[i] < yy[k]) != (yy[j] < yy[k])) {
					cnt--;
					break;
				}
		}
	printf("%d\n", cnt);
	return 0;
}

Compilation message

scarecrows.c: In function 'main':
scarecrows.c:9:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |  scanf("%d", &n);
      |  ^~~~~~~~~~~~~~~
scarecrows.c:11:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |   scanf("%d%d", &xx[i], &yy[i]);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 288 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 328 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 424 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -