| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1305071 | lsjo | 운세 보기 2 (JOI14_fortune_telling2) | C++20 | 3094 ms | 832 KiB |
#include <bits/stdc++.h>
using namespace std;
#pragma gcc optimise("ofast,unroll-loops")
#pragma gcc target("avx")
#define int long long
int a[40005], b[40005];
bool nums[40005];
signed main() {
cin.tie(0);
cin.sync_with_stdio(0);
int n, k; cin >> n >> k;
int total=0;
for (int i = 0; i < n; i++) {
cin >> a[i] >> b[i];
total+=a[i];
}
for (int i = 0; i < k; i++) {
int t; cin >> t;
for (int j = 0; j < n; j++) {
if (nums[j]) {
if (b[j] <= t) {
nums[j]=false;
total=total-b[j]+a[j];
}
}
else {
if (a[j] <= t) {
nums[j]=true;
total=total-a[j]+b[j];
}
}
}
}
cout << total << "\n";
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
