Submission #1117680

#TimeUsernameProblemLanguageResultExecution timeMemory
1117680vjudge1Paprike (COI18_paprike)C++17
13 / 100
9 ms1320 KiB
#include <bits/stdc++.h> #define GOOD_LUCK ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); #define ll long long #define itn int #define INF 100000000 #define MOD 998244353 #define MAX 100003 #define endl "\n" #define ff first #define ss second using namespace std; int temp; vector <int> v(MAX + 2), p(MAX + 2); signed main() { GOOD_LUCK int t; t = 1; // cin >> t; while (t--) { int n, k; cin >> n >> k; for (int i=0; i < n; i++) { cin >> v[i]; if (i == 0) p[i] = v[i]; else p[i] = p[i-1] + v[i]; } int cnt=0, j=0; for (int i=0; i < n-1; i++) { if (p[i+1] - j > k) { j = p[i]; cnt++; } } cout << cnt; } return 0; } // Problem A // by Ekber_Ekber
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...