# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
372907 | BartolM | 운세 보기 2 (JOI14_fortune_telling2) | C++17 | 3064 ms | 872 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
#define mp make_pair
#define pb push_back
typedef long long ll;
typedef pair <int, int> pii;
typedef pair <int, pii> pip;
typedef pair <pii, int> ppi;
typedef pair <ll, ll> pll;
const int INF=0x3f3f3f3f;
const int N=2e5+5;
const int OFF=(1<<19);
int n, q;
vector <pii> v;
vector <int> que;
void solve() {
ll sol=0;
for (int i=0; i<n; ++i) {
for (int j=0; j<q; ++j) {
if (que[j]>=v[i].X) swap(v[i].X, v[i].Y);
}
sol+=v[i].X;
}
printf("%lld\n", sol);
}
void load() {
scanf("%d %d", &n, &q);
for (int i=0; i<n; ++i) {
int a, b;
scanf("%d %d", &a, &b);
v.pb(mp(a, b));
}
for (int i=0; i<q; ++i) {
int x;
scanf("%d", &x);
que.pb(x);
}
}
int main() {
load();
solve();
return 0;
}
컴파일 시 표준 에러 (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... |