# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
923837 | Pring | Preokret (COCI18_preokret) | C++17 | 1 ms | 348 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#ifdef MIKU
#define debug(x...) cout << '[' << #x << "] : ", dout(x)
void dout() { cout << endl; }
template <typename T, typename ...U>
void dout(T t, U ...u) { cout << t << (sizeof...(u) ? ", " : ""); dout(u...); }
#else
#define debug(...) 39
#endif
#define int long long
#define fs first
#define sc second
#define mp make_pair
#define FOR(i, j, k) for (int i = j, Z = k; i < Z; i++)
typedef pair<int, int> pii;
int n, m, br;
vector<pii> v;
int s1, s2;
int a1, a2;
void miku() {
cin >> n;
while (n--) {
cin >> br;
v.push_back(mp(br, 1LL));
}
cin >> m;
while (m--) {
cin >> br;
v.push_back(mp(br, 2LL));
}
sort(v.begin(), v.end());
n = v.size();
for (int i = 0, j = 0; i < n; i = j) {
while (j < n && v[i].sc == v[j].sc) j++;
bool f = (v[i].sc == 1 ? (s1 < s2) : (s1 > s2));
FOR(k, i, j) {
if (v[k].fs <= 1440) a1++;
(v[k].sc == 1 ? s1 : s2)++;
}
f &= (v[i].sc == 1 ? (s1 > s2) : (s1 < s2));
if (f) a2++;
}
cout << a1 << '\n' << a2 << '\n';
}
int32_t main() {
cin.tie(0) -> sync_with_stdio(false);
cin.exceptions(iostream::failbit);
miku();
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |