| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1213754 | 12baater | 경주 (Race) (IOI11_race) | C++20 | 1 ms | 328 KiB |
#include "race.h"
#include <iostream>
using namespace std;
int best_path(int N, int K, int H[][2], int L[]) {
int current = 0;
int currentPaths = 0;
int best = 2000000000;
for(int i = 0; i < N; i++) {
while (current > K) {
current -= L[i-currentPaths];
currentPaths--;
}
if(current == K) {
best = min(best,currentPaths);
current -= L[i-currentPaths];
currentPaths--;
}
current += L[i];
currentPaths++;
if (current == K) {
best = min(best, currentPaths);
}
}
return (best==2000000000) ? -1 : best;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
