# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
87066 | rakuten | Weighting stones (IZhO11_stones) | C++14 | 2 ms | 376 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
set < int > v1 ;
set < int > :: iterator it1 ;
set < int > v2 ;
set < int > :: iterator it2 ;
int x1 , x2 ;
main()
{
int a , b;
int n;
cin >> n;
cin >> a >> b ;
if(b == 2)
{
cout << '<' << endl;
v1.insert (a) ;
}
else
{
cout << '>' << endl;
v2.insert (a) ;
}
for(int i = 2; i <= n; i++)
{
x1 = 0 ;
x2 = 0 ;
cin >> a >> b;
if (b == 1)
v1.insert (a) ;
else
v2.insert (a) ;
if (v1.size() == 0)
{
cout << '<' << endl ;
}
else
if (v2.size() == 0)
{
cout << '>' << endl ;
}
else
{
it1 = -- v1.end() ;
it2 = -- v2.end() ;
for ( ; ; )
{
if ( (*it1) > (*it2) )
x1 ++ ;
else
x2 ++ ;
if (it1 == v1.begin () || it2 == v2 .begin ())
break ;
it1 -- ;
it2 -- ;
}
if ( x1 == 0 && x2 == v1.size() && x2)
cout << '<' << endl ;
else
if ( x2 == 0 && x1 == v2.size() && x1)
cout << '>' << endl ;
else
cout << '?' << endl ;
}
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |