# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
156976 | dcj | Preokret (COCI18_preokret) | C++14 | 3 ms | 376 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
using namespace std;
int main()
{
int Ap[2880]={0} , Bp[2880]={0};
int A, B, s, pv=0, P=0, x=0, as, bs;
cin >> A;
cin >> as;
Ap[as-1]=1;
if (as<=1440)
pv++;
for (int i=1;i<A;i++) {
cin >> s;
if (s<=1440)
pv++;
Ap[s-1]=1;
}
cin >> B;
cin >> bs;
Bp[bs-1]=1;
if(bs<=1440)
pv++;
for (int i=1;i<B;i++) {
cin >> s;
if (s<=1440)
pv++;
Bp[s-1]=1;
}
if (as<bs)
x=1;
else
x=2;
cout << pv << "\n";
for (int i=0;i<=2879;i++) {
if (Ap[i]==1)
A--;
if (Bp[i] ==1)
B--;
if (A<B and x==2) {
P++;
x=1;
}
if (B<A and x==1) {
P++;
x=2;
}
}
cout << P;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |