# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
17774 | Elibay | Weighting stones (IZhO11_stones) | C++14 | 1000 ms | 11092 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>
#define Fname ""
using namespace std;
const int MaxN = 3e5 + 17, INF = 1e9 + 17, Mod = 1e9 + 7;
multiset < int > S, s;
int n, x, y;
int main ()
{
#ifdef Elibay
freopen (".in", "r", stdin);
#endif
cin >> n;
for (int i = 1; i <= n; ++ i)
S.insert (0), s.insert (0);
for (int z = 1; z <= n; ++ z)
{
cin >> x >> y;
if (y == 2)
{
auto w = S.begin ();
S.erase (w);
S.insert (x);
}
else if (y == 1)
{
auto w = s.begin ();
s.erase (s.begin ());
s.insert (x);
}
int k1 = 0, k2 = 0;
auto i = s.begin ();
auto j = S.begin ();
for (int q = 1; q <= n; ++ q)
{
int X = *i;
int Y = *j;
if (Y > X)
k1++;
if (X > Y)
k2++;
++ i;
++ j;
}
if (k2 == 0)
puts ("<");
else if (k1 == 0)
puts (">");
else
puts ("?");
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |