Submission #767400

#TimeUsernameProblemLanguageResultExecution timeMemory
767400sraeliArchery (IOI09_archery)C11
Compilation error
0 ms0 KiB
#include <stdio.h> int encontrar_posicao_inicial(int N, int minhaClassificacao, int* competitorRanks) { int melhorPosicao = 1; for (int i = 0; i < 2 * N - 1; i += 2) { if (competitorRanks[i] < minhaClassificacao) { melhorPosicao++; } } return melhorPosicao; } int main() { int N, R; scanf("%d %d", &N, &R) __attribute__((unused)); int minhaClassificacao; scanf("%d", &minhaClassificacao) __attribute__((unused)); int competitorRanks[2 * N - 1]; for (int i = 0; i < 2 * N - 1; i++) { scanf("%d", &competitorRanks[i]) __attribute__((unused)); } int posicaoInicial = encontrar_posicao_inicial(N, minhaClassificacao, competitorRanks); printf("%d\n", posicaoInicial); return 0; }

Compilation message (stderr)

archery.c: In function 'main':
archery.c:17:27: error: expected ';' before '__attribute__'
   17 |     scanf("%d %d", &N, &R) __attribute__((unused));
      |                           ^~~~~~~~~~~~~~
      |                           ;
archery.c:20:37: error: expected ';' before '__attribute__'
   20 |     scanf("%d", &minhaClassificacao) __attribute__((unused));
      |                                     ^~~~~~~~~~~~~~
      |                                     ;
archery.c:24:41: error: expected ';' before '__attribute__'
   24 |         scanf("%d", &competitorRanks[i]) __attribute__((unused));
      |                                         ^~~~~~~~~~~~~~
      |                                         ;
archery.c:17:5: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   17 |     scanf("%d %d", &N, &R) __attribute__((unused));
      |     ^~~~~~~~~~~~~~~~~~~~~~
archery.c:20:5: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   20 |     scanf("%d", &minhaClassificacao) __attribute__((unused));
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
archery.c:24:9: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   24 |         scanf("%d", &competitorRanks[i]) __attribute__((unused));
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~