제출 #1046886

#제출 시각아이디문제언어결과실행 시간메모리
104688612345678Weighting stones (IZhO11_stones)C++17
0 / 100
1097 ms2936 KiB
#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 timeMemoryGrader output
Fetching results...