Submission #930926

#TimeUsernameProblemLanguageResultExecution timeMemory
930926rainboy카드 역배치 (KOI15_reversal)C11
25 / 25
0 ms420 KiB
#include <stdio.h> #define N 20 #define Q 10 int main() { static int aa[N]; int h, i, l, r, tmp; for (i = 0; i < N; i++) aa[i] = i + 1; for (h = 0; h < Q; h++) { scanf("%d%d", &l, &r), l--, r--; while (l < r) { tmp = aa[l], aa[l] = aa[r], aa[r] = tmp; l++, r--; } } for (i = 0; i < N; i++) printf("%d ", aa[i]); printf("\n"); return 0; }

Compilation message (stderr)

reversal.c: In function 'main':
reversal.c:13:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |   scanf("%d%d", &l, &r), l--, r--;
      |   ^~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...