제출 #1117594

#제출 시각아이디문제언어결과실행 시간메모리
1117594vjudge1Paprike (COI18_paprike)C++17
0 / 100
2 ms592 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define ld double const int INF = 1e18; const int mod = 12345; const int sz = 20; int n , k , dp[sz]; vector < vector < int > > adj; signed main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >> n >> k; for(int i = 1;i <= n;i++) cin >> dp[i]; int u[n] , v[n]; for(int i = 0;i < n - 1;i++){ cin >> u[i] >> v[i]; } int ans = 1 ,cur = 0; for(int i = 1;i <= n;i++){ if(cur + dp[i] < k){ ans++; cur = 0; } cur += dp[i]; } cout << ans << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...