| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1033670 | vjudge1 | Trains (BOI24_trains) | C++17 | 2075 ms | 1372 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
const int M = 1e9 + 7;
int n, d[100100], x[100100], v[100100];
int main() {
scanf("%d", &n);
int all1 = 1, res = 0;
for (int i = 1; i <= n; ++i) {
scanf("%d%d", &d[i], &x[i]);
// if (d[i] != 1) all1 = 0;
}
// if (all1) {
// return 0;
// }
v[1] = 1;
for (int i = 1; i <= n; ++i) {
if (d[i] && x[i]) {
for (int t = 1; t <= x[i]; ++t) {
int c = i + t * d[i];
if (c > n) break;
v[c] = (v[c] + v[i]) % M;
}
}
}
for (int i = 1; i <= n; ++i) res = (res + v[i]) % M;
printf("%d", res);
}
컴파일 시 표준 에러 (stderr) 메시지
| # | 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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
