# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
431253 | faresbasbs | 운세 보기 2 (JOI14_fortune_telling2) | C++14 | 3058 ms | 452 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#pragma GCC optimization ("Ofast")
#pragma GCC target ("avx2")
using namespace std;
int n,k,a[40001],b[40001];
int main(){
cin >> n >> k;
for(int i = 1 ; i <= n ; i += 1){
cin >> a[i] >> b[i];
}
for(int i = 1 ; i <= k ; i += 1){
int f;
cin >> f;
for(int j = 1 ; j <= n ; j += 1){
if(a[j] <= f){
swap(a[j],b[j]);
}
}
}
long long ans = 0;
for(int i = 1 ; i <= n ; i += 1){
ans += a[i];
}
cout << ans << endl;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |