Submission #997777

#TimeUsernameProblemLanguageResultExecution timeMemory
997777SuPythonyFortune Telling 2 (JOI14_fortune_telling2)C++17
4 / 100
3049 ms2192 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n,k; cin>>n>>k; vector<pair<ll,ll>> c(n,pair<ll,ll>()); for (int i=0; i<n; i++) cin>>c[i].first>>c[i].second; while (k--) { ll t; cin>>t; for (int i=0; i<n; i++) { if (c[i].first<=t) { swap(c[i].first,c[i].second); } } } ll ans=0; for (auto i: c) ans+=i.first; cout<<ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...