#include <stdio.h>
int encontrar_posicao_inicial(int N, int* arqueiros) {
int minha_classificacao = arqueiros[0];
// Verificar se você é o melhor ou o pior arqueiro
if (minha_classificacao == 1 || minha_classificacao == 2 * N) {
return 1;
}
for (int i = 1; i < 2 * N; i++) {
if (arqueiros[i] < minha_classificacao) {
return (i + 1) / 2 + 1;
}
}
return 2;
}
int main() {
int alvos, rodadas;
if (scanf("%d %d", &alvos, &rodadas) != 2) {
printf("Erro na leitura dos alvos e das rodadas.\n");
return 1;
}
int arqueiros[2 * alvos];
for (int i = 0; i < 2 * alvos; i++) {
if (scanf("%d", &arqueiros[i]) != 1) {
printf("Erro na leitura da classificação dos arqueiros.\n");
return 1;
}
}
int posicao_inicial = encontrar_posicao_inicial(alvos, arqueiros);
printf("%d\n", posicao_inicial);
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
284 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 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
280 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
4 |
Incorrect |
3 ms |
468 KB |
Output isn't correct |
5 |
Incorrect |
27 ms |
3788 KB |
Output isn't correct |
6 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
7 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
8 |
Incorrect |
3 ms |
468 KB |
Output isn't correct |
9 |
Incorrect |
4 ms |
596 KB |
Output isn't correct |
10 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
11 |
Incorrect |
4 ms |
596 KB |
Output isn't correct |
12 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
13 |
Incorrect |
19 ms |
2752 KB |
Output isn't correct |
14 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
15 |
Incorrect |
5 ms |
896 KB |
Output isn't correct |
16 |
Incorrect |
0 ms |
284 KB |
Output isn't correct |
17 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
18 |
Incorrect |
1 ms |
296 KB |
Output isn't correct |
19 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
20 |
Incorrect |
1 ms |
368 KB |
Output isn't correct |
21 |
Incorrect |
3 ms |
684 KB |
Output isn't correct |
22 |
Incorrect |
5 ms |
852 KB |
Output isn't correct |
23 |
Incorrect |
28 ms |
3972 KB |
Output isn't correct |
24 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
25 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
26 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
27 |
Incorrect |
3 ms |
596 KB |
Output isn't correct |
28 |
Incorrect |
20 ms |
2900 KB |
Output isn't correct |
29 |
Correct |
1 ms |
300 KB |
Output is correct |
30 |
Correct |
1 ms |
340 KB |
Output is correct |
31 |
Incorrect |
3 ms |
596 KB |
Output isn't correct |
32 |
Incorrect |
27 ms |
3912 KB |
Output isn't correct |
33 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
34 |
Correct |
0 ms |
212 KB |
Output is correct |
35 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
36 |
Incorrect |
1 ms |
300 KB |
Output isn't correct |
37 |
Incorrect |
3 ms |
556 KB |
Output isn't correct |
38 |
Incorrect |
4 ms |
676 KB |
Output isn't correct |
39 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
40 |
Incorrect |
1 ms |
292 KB |
Output isn't correct |
41 |
Incorrect |
1 ms |
288 KB |
Output isn't correct |
42 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
43 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
44 |
Incorrect |
2 ms |
468 KB |
Output isn't correct |
45 |
Incorrect |
3 ms |
596 KB |
Output isn't correct |
46 |
Incorrect |
4 ms |
688 KB |
Output isn't correct |
47 |
Incorrect |
31 ms |
4380 KB |
Output isn't correct |