| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 200845 | quocnguyen1012 | 운세 보기 2 (JOI14_fortune_telling2) | C++14 | 3049 ms | 1528 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>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
using namespace std;
typedef long long ll;
const int maxn = 2005;
signed main(void)
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
if (fopen("A.INP", "r")){
freopen("A.INP", "r", stdin);
freopen("A.OUT", "w", stdout);
}
int n, m; cin >> n >> m;
vector<int> a(n), b(n);
for (int i = 0; i < n; ++i){
cin >> a[i] >> b[i];
}
while (m--){
int val; cin >> val;
for (int i = 0; i < n; ++i){
if (a[i] <= val){
swap(a[i], b[i]);
}
}
}
ll sum = 0;
for (int i = 0; i < n; ++i){
sum += a[i];
}
cout << sum;
}
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... | ||||
