Submission #536547

#TimeUsernameProblemLanguageResultExecution timeMemory
536547rainboy허수아비 (JOI14_scarecrows)C11
0 / 100
5 ms424 KiB
#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 (stderr)

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