| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1367394 | lucasdmy | Trains (BOI24_trains) | C++20 | 215 ms | 980 KiB |
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
vector<pair<int, int>>v(n+10);
vector<int>dp(n+10, 1);
for(int k=1;k<=n;k++){
cin>>v[k].first>>v[k].second;
}
for(int k=n;k>0;k--){
if(v[k].first==0){
continue;
}
int at=k+v[k].first, tot=1;
while(tot<=v[k].second and at<=n){
dp[k]+=dp[at];
at+=v[k].first;
tot++;
}
}
cout<<dp[1];
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
