Submission #767397

# Submission time Handle Problem Language Result Execution time Memory
767397 2023-06-26T17:48:37 Z sraeli Archery (IOI09_archery) C
0 / 100
32 ms 1748 KB
#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);

    int minhaClassificacao;
    scanf("%d", &minhaClassificacao);

    int competitorRanks[2 * N - 1];
    for (int i = 0; i < 2 * N - 1; i++) {
        scanf("%d", &competitorRanks[i]);
    }

    int posicaoInicial = encontrar_posicao_inicial(N, minhaClassificacao, competitorRanks);
    printf("%d\n", posicaoInicial);

    return 0;
}

Compilation message

archery.c: In function 'main':
archery.c:17:5: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   17 |     scanf("%d %d", &N, &R);
      |     ^~~~~~~~~~~~~~~~~~~~~~
archery.c:20:5: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   20 |     scanf("%d", &minhaClassificacao);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
archery.c:24:9: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   24 |         scanf("%d", &competitorRanks[i]);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Incorrect 0 ms 212 KB Output isn't correct
4 Incorrect 1 ms 212 KB Output isn't correct
5 Incorrect 0 ms 212 KB Output isn't correct
6 Incorrect 0 ms 212 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Incorrect 1 ms 212 KB Output isn't correct
4 Incorrect 3 ms 340 KB Output isn't correct
5 Incorrect 26 ms 1492 KB Output isn't correct
6 Incorrect 0 ms 212 KB Output isn't correct
7 Incorrect 0 ms 212 KB Output isn't correct
8 Incorrect 3 ms 340 KB Output isn't correct
9 Incorrect 3 ms 340 KB Output isn't correct
10 Incorrect 0 ms 212 KB Output isn't correct
11 Incorrect 4 ms 340 KB Output isn't correct
12 Incorrect 1 ms 212 KB Output isn't correct
13 Incorrect 23 ms 1228 KB Output isn't correct
14 Incorrect 1 ms 212 KB Output isn't correct
15 Incorrect 5 ms 468 KB Output isn't correct
16 Incorrect 0 ms 212 KB Output isn't correct
17 Incorrect 1 ms 212 KB Output isn't correct
18 Incorrect 1 ms 212 KB Output isn't correct
19 Incorrect 1 ms 212 KB Output isn't correct
20 Incorrect 1 ms 212 KB Output isn't correct
21 Incorrect 3 ms 340 KB Output isn't correct
22 Incorrect 5 ms 468 KB Output isn't correct
23 Incorrect 30 ms 1672 KB Output isn't correct
24 Incorrect 0 ms 212 KB Output isn't correct
25 Incorrect 0 ms 212 KB Output isn't correct
26 Incorrect 1 ms 212 KB Output isn't correct
27 Incorrect 4 ms 340 KB Output isn't correct
28 Incorrect 20 ms 1236 KB Output isn't correct
29 Incorrect 1 ms 212 KB Output isn't correct
30 Incorrect 1 ms 212 KB Output isn't correct
31 Incorrect 3 ms 340 KB Output isn't correct
32 Incorrect 28 ms 1620 KB Output isn't correct
33 Incorrect 0 ms 212 KB Output isn't correct
34 Incorrect 0 ms 212 KB Output isn't correct
35 Incorrect 1 ms 212 KB Output isn't correct
36 Incorrect 1 ms 212 KB Output isn't correct
37 Incorrect 3 ms 340 KB Output isn't correct
38 Incorrect 4 ms 468 KB Output isn't correct
39 Incorrect 0 ms 212 KB Output isn't correct
40 Incorrect 0 ms 212 KB Output isn't correct
41 Incorrect 1 ms 212 KB Output isn't correct
42 Incorrect 1 ms 212 KB Output isn't correct
43 Incorrect 1 ms 212 KB Output isn't correct
44 Incorrect 2 ms 356 KB Output isn't correct
45 Incorrect 3 ms 340 KB Output isn't correct
46 Incorrect 4 ms 340 KB Output isn't correct
47 Incorrect 32 ms 1748 KB Output isn't correct