# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
17845 | Erzhann | Weighting stones (IZhO11_stones) | C++14 | 1000 ms | 4640 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/*
/\ /\
| ).|.( |
| >-< |
=========
It's Adilkhan99 miaaaaaau
*/
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define endl "\n"
#define foreach(it, S) for(__typeof (S.begin()) it = S.begin(); it != S.end(); it++)
#define mp make_pair
#define f first
#define s second
#define name ""
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
const int MaxN = int (2e5) + 256;
const int INF = int(1e9);
const int mod = (int)(1e9) + 7;
int n, a[MaxN], m, t;
set<int> s, S;
bool u[MaxN], U[MaxN];
vector<char> v;
int main () { _
cin >> n;
for(int i = 1; i <= n; ++i){
int x, y; cin >> x >> y;
if(y == 2){
if(!u[x]){
S.insert(-x);
U[x] = 1;
}else{
s.erase(-x);
u[x] = 0;
}
}
else{
if(!U[x]){
s.insert(-x);
u[x] = 1;
}else{
S.erase(-x);
U[x] = 0;
}
}
auto I = s.begin();
auto J = S.begin();
bool ok = 0, ok1 = 0;
if(s.size() > S.size())
ok = 1;
if(S.size() > s.size())
ok1 = 1;
while(I != s.end() && J != S.end()){
if(ok && ok1){
break;
}
if(-(*I) > -(*J))
ok = 1;
if(-(*I) < -(*J))
ok1 = 1;
I++;
J++;
}
if(ok && ok1)
v.pb('?');
else if(ok)
v.pb('>');
else v.pb('<');
}
for(int i = 0; i < v.size(); i++)
cout << v[i] << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |