| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 890540 | Alfraganus | Segments (IZhO18_segments) | C++17 | 5058 ms | 7924 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#pragma GCC optimize("unroll-loops")
#pragma gcc optimize("Ofast")
#pragma GCC optimization("Ofast")
#pragma optimize(Ofast)
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define str string
#define fastio ios::sync_with_stdio(0), cin.tie(0);
#define fs first
#define ss second
#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define len(x) x.size()
#define print(a) \
for (auto &x : a) \
cout << x << " "; \
cout << endl;
#define printmp(a) \
for (auto &x : a) \
cout << x.fs << " " << x.ss.fs << ' ' << x.ss.ss << endl;
const int mod = 998244353;
void solve(){
int n, t;
cin >> n >> t;
map<int, pair<int, int>> mp;
set<int> free;
for(int i = 0; i < n; i ++)
free.insert(i + 1);
int lastans = 0;
for(int i = 0; i < n; i ++){
int type;
cin >> type;
if(type == 1){
int l, r;
cin >> l >> r;
l = l ^ (t * lastans);
r = r ^ (t * lastans);
if(l > r)
swap(l, r);
mp[*free.begin()] = {l, r};
free.erase(free.begin());
}
else if(type == 2){
int x;
cin >> x;
mp.erase(x);
free.insert(x);
}
else{
int l, r, k;
cin >> l >> r >> k;
l = l ^ (t * lastans);
r = r ^ (t * lastans);
if(l > r)
swap(l, r);
int ans = 0;
for(auto x : mp){
pair<int, int> y = x.ss;
int pl = max(l, y.fs), pr = min(r, y.ss);
if(pr - pl > k)
ans ++;
}
cout << ans << endl;
lastans = ans;
}
}
}
signed main()
{
fastio int t = 1;
// cin >> t;
while (t--)
{
solve();
cout << endl;
}
}컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
