제출 #1051370

#제출 시각아이디문제언어결과실행 시간메모리
1051370deeraTrains (BOI24_trains)C++14
21 / 100
2094 ms2652 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll MOD = 1e9+7; int main() { ll n; cin >> n; ll m = n + 100; vector<ll> dp(m); vector<ll> d(m), x(m); for (ll i = 1; i <= n; i++) cin >> d[i] >> x[i]; for (ll i = 0; i < dp.size(); i++) dp[i] = 1; for (ll i = n; i >= 1; i--) { if (d[i] == 0) continue; ll step = d[i]; for (ll j = i+step; j <= n && j <= i+step*x[i]; j+=step) { dp[i] = (dp[j] + dp[i]) % MOD; } } cout << dp[1] % MOD << endl; return 0; }

컴파일 시 표준 에러 (stderr) 메시지

Main.cpp: In function 'int main()':
Main.cpp:18:22: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |     for (ll i = 0; i < dp.size(); i++) dp[i] = 1;
      |                    ~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...