제출 #1117683

#제출 시각아이디문제언어결과실행 시간메모리
1117683vjudge1Paprike (COI18_paprike)C++17
13 / 100
17 ms1272 KiB
#include <bits/stdc++.h> #define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define ll long long using namespace std; int main(){ fast; ll n,m,s=0,cem=0; cin>>n>>m; ll a[n]; for(ll i=0;i<n;i++){ cin>>a[i]; } for(ll j=0;j<n-1;j++){ ll u,v; cin>>u>>v; } for(ll i=0;i<n;i++){ if(cem+a[i]>m){ s++; cem=a[i]; } else{ cem+=a[i]; } } cout<<s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...