(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

제출 #1117931

#제출 시각아이디문제언어결과실행 시간메모리
1117931vjudge1Paprike (COI18_paprike)C++17
13 / 100
22 ms3408 KiB
#include<bits/stdc++.h> using namespace std; #define Study ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define ll long long #define ull unsigned long long #define pb push_back #define ff first #define ss second #define ins insert #define all(x) x.begin(),x.end() #define fori(x,y,z) for(ll x=y;x<=z;x++) const ll INF=1e9; const ll sz=1e5+10; const ll mod=1e9+7; void work(){ ll n,k; cin>>n>>k; vector<ll>pref(n+10,0); vector<ll>a(n+10); ll cuts=0,csum=0; fori(i,1,n) cin>>a[i]; vector<pair<ll,ll>>pairs(n+10); fori(i,1,n-1) cin>>pairs[i].ff>>pairs[i].ss; for(ll i=n;i>=1;i--){ csum+=a[i]; if(csum>k){ csum=a[i]; cuts++; } } cout<<cuts; } int main(){ Study; ll t=1; //cin>>t; while(t--){ work(); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...