Submission #1117641

#TimeUsernameProblemLanguageResultExecution timeMemory
1117641vjudge1Paprike (COI18_paprike)C++17
13 / 100
60 ms1268 KiB
#include <bits/stdc++.h> using namespace std; # define int long long void solve() { int n, k, ans = 0, sum = 0; cin >> n >> k; vector < int > a(n); for(int i = 0; i < n; i++) cin >> a[i]; for(int i = 0; i < n; i++) { int x, y; cin >> x >> y; } for(int i = 0; i < n; i++) { if(sum + a[i] > k) { sum = a[i]; ans++; } else sum += a[i]; } cout << ans << endl; } signed main() { int tt = 1; // cin >> tt; while(tt--) solve(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...