# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
115983 | Vlatko | Preokret (COCI18_preokret) | C++14 | 3 ms | 384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
int main() {
ios::sync_with_stdio(false); cin.tie(0);
int A, B;
bool As[3000] = {}, Bs[3000] = {};
cin >> A;
for (int i = 0; i < A; ++i) {
int s;
cin >> s;
As[s] = true;
}
cin >> B;
for (int i = 0; i < B; ++i) {
int s;
cin >> s;
Bs[s] = true;
}
int ans1 = 0, ans2 = 0;
int Ascore = 0, Bscore = 0;
bool af = false, bf = false;
for (int s = 1; s <= 4*12*60; ++s) {
if (As[s]) {
++Ascore;
if (s <= 2*12*60) {
++ans1;
}
}
if (Bs[s]) {
++Bscore;
if (s <= 2*12*60) {
++ans1;
}
}
if (!af && !bf) {
if (Ascore > Bscore) {
bf = true;
} else {
af = true;
}
}
if (af && Ascore > Bscore) {
++ans2;
af = false;
bf = true;
}
if (bf && Ascore < Bscore) {
++ans2;
af = true;
bf = false;
}
}
cout << ans1 << '\n' << ans2;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |