# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1046886 | 12345678 | Weighting stones (IZhO11_stones) | C++17 | 1097 ms | 2936 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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... |