Submission #1058270

#TimeUsernameProblemLanguageResultExecution timeMemory
1058270kachim2Bikeparking (EGOI24_bikeparking)C++17
16 / 100
1095 ms4956 KiB
#include<bits/stdc++.h> using namespace std; typedef int64_t ll; int main(){ ll n; cin >> n; vector<ll> slots(n); vector<ll> users(n); for(ll i = 0; i < n; i++){ cin >> slots[i]; } for(ll i = 0; i < n; i++){ cin >> users[i]; } ll happy = 0; for(ll i = 0; i < n; i++){ for(int j = 0; j < i; j++){ ll x= min(slots[j], users[i]); slots[j]-=x; users[i]-=x; happy+=x; } } for(int i = 0; i < n; i++){ ll x= min(slots[i], users[i]); slots[i]-=x; users[i]-=x; } happy -= accumulate(users.begin(), users.end(), ll(0)); cout << happy; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...