# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
17684 | Adilkhan | 돌 무게 재기 (IZhO11_stones) | C++98 | 1000 ms | 9532 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define pb push_back
#define endl "\n"
#define mp make_pair
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define fname ""
#define sz(x) (int)(x.size())
typedef long long ll;
using namespace std;
const ll N = (ll)(5e5) + 322;
const ll INF = (ll)(1e9);
const ll mod = (ll)(1e9) + 7;
const double eps = 1e-9;
ll n, x[N], y[N], q, s, sum, mn, mx;
int main () {
ios_base :: sync_with_stdio (false); cin.tie(0);
//freopen(fname".in", "r", stdin);
//freopen(fname".out", "w", stdout);
cin >> n;
for (int i = 1; i <= n; ++i) {
cin >> q >> s;
if (s == 1) {
x[q]++;
}else {
x[q]--;
}
sum = 0;
set <int> S;
for (int j = n; j >= 1; --j) {
sum += x[j];
S.insert(sum);
}
mx = *(--S.end());
mn = *(S.begin());
if (mn < 0 && mx > 0) {
cout << '?' << endl;
}
if (mn >= 0 && mx >= 0) {
cout << '>' << endl;
}
if (mn <= 0 && mx <= 0) {
cout << '<' << endl;
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |