# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
166210 | Dovran | 돌 무게 재기 (IZhO11_stones) | C++11 | 1074 ms | 1608 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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, v[N], c[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), v[x]--;
else
b.pb(x), r=max(r, x), v[x]++;
int asd=0;
for(int j=n; j>=1; j--){
c[j]=c[j+1]+v[j];
if((c[j]>0 and l>r) or (c[j]<0 and l<r)){
cout<<"?\n", asd=1;
break;
}
}
if(asd==0){
if(l>r)
cout<<">\n";
else
cout<<"<\n";
}
for(int j=1; j<=n; j++)
c[j]=0;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |