# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1046886 | 12345678 | 돌 무게 재기 (IZhO11_stones) | C++17 | 1097 ms | 2936 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int nx=1e5+5;
int n, x, t;
set<int> a, b;
bool check(set<int> &x, set<int> &y)
{
if (y.empty()) return 1;
auto itrx=prev(x.end()), itry=prev(y.end());
while (itry!=y.begin())
{
if (*itrx<*itry) return 0;
itrx--, itry--;
}
if (*itrx<*itry) return 0;
return 1;
}
int main()
{
cin.tie(NULL)->sync_with_stdio(false);
cin>>n;
for (int i=1; i<=n; i++)
{
cin>>x>>t;
if (t==1) a.insert(x);
else b.insert(x);
if (a.size()>=b.size()&&check(a, b)) cout<<">\n";
else if (b.size()>=a.size()&&check(b, a)) cout<<"<\n";
else cout<<"?\n";
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |