제출 #432703

#제출 시각아이디문제언어결과실행 시간메모리
432703rainboyArchery (IOI09_archery)C11
10 / 100
2096 ms5968 KiB
#include <stdio.h> #include <string.h> #define N 200000 int main() { static int aa[N * 2], bb[N * 2]; int n, r, h, h_, i, i_, j; scanf("%d%d", &n, &r), r = (r - n * 2) % n + n * 2; for (i = 0; i < n * 2; i++) scanf("%d", &aa[i]); i_ = -1, h_ = n * 2; for (i = 0; i < n * 2; i++) { int tmp; if (i > 0) tmp = aa[i], aa[i] = aa[i - 1], aa[i - 1] = tmp; memcpy(bb, aa, n * 2 * sizeof *aa); for (j = 0; j < r; j++) { for (h = 0; h < n * 2; h += 2) if (bb[h] > bb[h + 1]) tmp = bb[h], bb[h] = bb[h + 1], bb[h + 1] = tmp; for (h = 2; h < n * 2; h++) tmp = bb[h], bb[h] = bb[h - 1], bb[h - 1] = tmp; } for (h = 0; h < n * 2; h++) if (bb[h] == aa[i]) break; if (h_ > h) h_ = h, i_ = i / 2; } printf("%d\n", i_ + 1); return 0; }

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

archery.c: In function 'main':
archery.c:10:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |  scanf("%d%d", &n, &r), r = (r - n * 2) % n + n * 2;
      |  ^~~~~~~~~~~~~~~~~~~~~
archery.c:12:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |   scanf("%d", &aa[i]);
      |   ^~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...