# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
637115 | Ahmed57 | Preokret (COCI18_preokret) | C++14 | 1 ms | 340 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin>>a;
vector<pair<int,int>> v;
int col = 0;
for(int i = 0;i<a;i++){
int x;cin>>x;
v.push_back({x,0});
if(x<=1440)col++;
}
cin>>b;
for(int i = 0;i<b;i++){
int x;cin>>x;
v.push_back({x,1});
if(x<=1440)col++;
}
sort(v.begin(),v.end());
cout<<col<<"\n";
vector<pair<int,int>>z;
int x = 0,y = 0 , ans = 0;
for(int i = 0;i<a+b;i++){
if(v[i].second==0)x++;
else y++;
if(x!=y)z.push_back({x,y});
}
for(int i = 1;i<z.size();i++){
if((z[i-1].first<z[i-1].second)!=(z[i].first<z[i].second))ans++;
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |