이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
int main() {
int N, R;
if (scanf("%d %d", &N, &R) != 2) {
return 1;
}
int myRank;
if (scanf("%d", &myRank) != 1) {
return 1;
}
int competitorRanks[400000];
for (int i = 0; i < 2 * N - 1; i++) {
if (scanf("%d", &competitorRanks[i]) != 1) {
return 1;
}
}
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;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |