# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1117654 | vjudge1 | Paprike (COI18_paprike) | C++17 | 22 ms | 824 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
//Desinged by AzeTurk810 Open source
#include <bits/stdc++.h>
using namespace std;
# define ull unsigned long long
# define hurryup ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
# define endl '\n'
# define pb push_back
# define INF 1e10
# define vbol vector<bool>
# define vint vector<int>
# define ll long long
# define mod 10000007
__int128_t powr(__int128_t n,__int128_t k)
{
if(k == 0 )return 1;
if(k&1){n*=n;n=n%mod;}
k>>=1;
n = powr(n % mod,k)%mod;
}
int main()
{
int n,k,ans= 0,sum =0;
cin>>n>>k;
vector<int>v(n);
for(int i=0;i<n;i++)
{
cin>>v[i];
sum+=v[i];
if(sum >k)
{
ans++;
sum = v[i];
}
}
cout<<ans<<endl;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |