Submission #1063199

#TimeUsernameProblemLanguageResultExecution timeMemory
1063199vjudge1Fortune Telling 2 (JOI14_fortune_telling2)C++17
4 / 100
3062 ms3024 KiB
#include <bits/stdc++.h> #define ll long long #define pb push_back using namespace std; ll N, K; vector<pair<ll, ll>> a; vector<ll> b; int main() { cin >> N >> K; for (int i = 0; i < N; i++) { ll x, y; cin >> x >> y; a.pb({x, y}); } for (int i = 0; i < K; i++) { ll temp; cin >> temp; b.pb(temp); } for (int i = 0; i < N; i++) { for (int j = 0; j < K; j++) { if (a[i].first <= b[j]) { swap(a[i].first, a[i].second); } } } ll sum = 0; for (int i = 0; i < N; i++) { sum += a[i].first; } cout << sum; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...