# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
944397 | dilanyan | Segments (IZhO18_segments) | C++17 | 3412 ms | 3936 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.
//-------------dilanyan------------\\
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
//------------------KarginDefines--------------------\\
#define ll long long
#define pb push_back
#define all(u) (u).begin(), (u).end()
#define pqueue priority_queue
#define upper upper_bound
#define lower lower_bound
#define umap unordered_map
#define uset unordered_set
#define Kargin ios_base::sync_with_stdio(false);cin.tie(NULL);
#define Usaco freopen(".in", "r", stdin); freopen(".out", "w", stdout);
//-------------------KarginConstants------------------\\
const ll mod = 1000000007;
const ll inf = 2e9;
//-------------------KarginCode------------------------\\
const int N = 200005;
void KarginSolve() {
int n, t;
cin >> n >> t;
vector<pair<int, int>> v;
while (n--) {
int tp; cin >> tp;
if (tp == 3) break;
int a, b;
cin >> a >> b;
v.pb({ a,b });
}
int a, b, k;
int lastans = 0;
for (auto it : v) {
if (min(it.second, b) - max(it.first, a) + 1 >= k) lastans++;
}
cout << lastans << '\n';
while (n--) {
int tp, a, b, k;
cin >> t >> a >> b >> k;
a ^= (tp * lastans), b ^= (tp * lastans);
int ans = 0;
for (auto it : v) {
if (min(it.second, b) - max(it.first, a) + 1 >= k) ans++;
}
lastans = ans;
cout << lastans << '\n';
}
}
int main() {
//Usaco
Kargin;
int test = 1;
//cin >> test;
while (test--) {
KarginSolve();
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |