제출 #767385

#제출 시각아이디문제언어결과실행 시간메모리
767385sraeliArchery (IOI09_archery)C11
0 / 100
378 ms1848 KiB
#include <stdio.h> int main() { int N, R; scanf("%d %d", &N, &R); int myRank, competitorRanks[400000]; scanf("%d", &myRank); for (int i = 0; i < 2 * N - 1; i++) { scanf("%d", &competitorRanks[i]); } int target = 1; // Alvo inicial (alvo 1) int round = 1; while (round < R) { if (target == 1) { if (myRank < competitorRanks[0]) { target = N; // O perdedor do alvo 1 se move para o alvo N } } else { if (myRank < competitorRanks[(target - 2) * 2]) { target--; // Os vencedores se movem para a esquerda } } round++; } printf("%d\n", target); return 0; }

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

archery.c: In function 'main':
archery.c:5:5: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    5 |     scanf("%d %d", &N, &R);
      |     ^~~~~~~~~~~~~~~~~~~~~~
archery.c:8:5: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |     scanf("%d", &myRank);
      |     ^~~~~~~~~~~~~~~~~~~~
archery.c:11:9: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |         scanf("%d", &competitorRanks[i]);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...