#include <bits/stdc++.h>
#define N 100009
#define pii pair <int, int>
#define ff first
#define ss second
#define pb push_back
#define ll long long
using namespace std;
int n;
vector<int>a, b;
int r, l;
int main(){
cin>>n;
for(int i=1; i<=n; i++){
int x, y;
cin>>x>>y;
if(y==1)
a.pb(x), l=max(l, x);
else
b.pb(x), r=max(r, x);
if(l > r and a.size()>b.size()){
cout<<">\n";
continue;
}
else if(l < r and a.size()<b.size()){
cout<<"<\n";
continue;
}
if((l < r and a.size()>b.size()) or (l > r and a.size()<b.size())){
cout<<"?\n";
continue;
}
sort(a.begin(), a.end());
sort(b.begin(), b.end());
if(l>r){
int in=0, asd=0;
for(auto i:a){
if(i < b[in]){
asd=1;
break;
}
in++;
}
if(asd==1)
cout<<"?\n";
else
cout<<">\n";
}
else{
int in=0, asd=0;
for(auto i:a){
if(i > b[in]){
asd=1;
break;
}
in++;
}
if(asd==1)
cout<<"?\n";
else
cout<<"<\n";
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |