# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
321277 | larissa_verde | 운세 보기 2 (JOI14_fortune_telling2) | C++17 | 3039 ms | 2148 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 MAXN 200000
using namespace std;
struct carta{
unsigned long long frente=0,verso=0;
};
carta sequencia[MAXN];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int n=0,k=0;
unsigned long long soma=0;
cin >> n >> k;
for (int i = 0; i < n; i++) {
cin >> sequencia[i].frente >> sequencia[i].verso;
}
while (k--) {
int t=0;
cin >> t;
for (int i = 0; i < n; i++) {
if (sequencia[i].frente <= t) swap(sequencia[i].frente, sequencia[i].verso);
}
}
for (int i = 0; i < n; i++) {
soma += sequencia[i].frente;
}
cout << soma;
return 0;
}
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... |