# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
973665 | RaresFelix | Food Court (JOI21_foodcourt) | C++17 | 1058 ms | 524288 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>
using namespace std;
#define int ll
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using ii = pair<ll, ll>;
signed main() {
int n, m, q;
cin >> n >> m >> q;
vector<deque<int> > V(n);
for (int i = 0; i < q; ++i) {
int tip;
cin >> tip;
if (tip == 1) {
int l, r, c, k;
cin >> l >> r >> c >> k;
--l; --r;
for(int j = l; j <= r; ++j) {
for(int w = 0; w < k; ++w) V[j].push_back(c);
}
} else if (tip == 2) {
int l, r, k;
cin >> l >> r >> k;
--l; --r;
for(int j = l; j <= r; ++j) {
for(int w = 0; w < k; ++w)
if(!V[j].empty()) V[j].pop_front();
}
} else {
int a, b;
cin >> a >> b;
--a; --b;
int re = 0;
if(V[a].size() > b) re = V[a][b];
cout << re << "\n";
}
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |