# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
958275 | Vladth11 | Sweeping (JOI20_sweeping) | C++14 | 18076 ms | 18792 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define debug(x) cerr << #x << " " << x << "\n"
#define debugs(x) cerr << #x << " " << x << " "
#pragma GCC optimize ("Ofast")
#pragma GCC target ("avx2")
#define int ll
using namespace std;
typedef long long ll;
typedef pair <ll, ll> pii;
const ll NMAX = 500001;
const ll INF = 1e9;
const ll nrbits = 20;
const ll MOD = 998244353;
signed main() {
#ifdef HOME
ifstream cin(".in");
ofstream cout(".out");
#endif // HOME
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
vector <pii> v;
int n, m, q, i, oke = 1;
cin >> n >> m >> q;
for(i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
if(v.size() && (a < v.back().first || b > v.back().second)){
oke = 0;
}
v.push_back({a, b});
}
while(q--) {
int t;
cin >> t;
if(t == 4) {
int a, b;
cin >> a >> b;
v.push_back({a, b});
} else if(t == 1) {
int x;
cin >> x;
cout << v[x - 1].first << " " << v[x - 1].second << "\n";
} else if(t == 2) {
int l;
cin >> l;
for(auto &x : v) {
if(x.second <= l)
x.first = max(x.first, n - l);
}
} else {
int l;
cin >> l;
for(auto &x : v) {
if(x.first <= l)
x.second = max(x.second, n - l);
}
}
}
return 0;
}
Compilation message (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... |