Submission #824681

#TimeUsernameProblemLanguageResultExecution timeMemory
824681KoyoteFortune Telling 2 (JOI14_fortune_telling2)C++14
4 / 100
3076 ms1900 KiB
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(nullptr)->sync_with_stdio(false); int n, k; cin >> n >> k; int a[n], b[n]; for (int i = 0; i < n; i++) cin >> a[i] >> b[i]; int t[k]; for (int i = 0; i < k; i++) cin >> t[i]; for (int i = 0; i < n; i++) for (int j = 0; j < k; j++) if (a[i] <= t[j]) swap(a[i], b[i]); cout << accumulate(a, a + n, 0LL) << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...