# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
735681 | ismayil | Food Court (JOI21_foodcourt) | C++17 | 1074 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>
#define int long long
using namespace std;
void solve(){
int N, M, Q;
cin >> N >> M >> Q;
vector<deque<int>> q(N);
for(int i = 0; i < Q; i++){
int type;
cin >> type;
if(type == 1){
int l, r, c, k;
cin >> l >> r >> c >> k;
for(int j = l - 1; j <= r - 1; j++) q[j].push_back(c);
}else if(type == 2){
int l, r, k;
cin >> l >> r >> k;
for(int j = l - 1; j <= r - 1; j++) if(!q[j].empty()) q[j].pop_front();
}else{
int a, b;
cin >> a >> b;
if(q[a - 1].size() >= b) cout << q[a - 1][b - 1] << endl;
else cout << 0 << endl;
}
}
}
signed main(){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
//freopen("output.txt", "w", stdout);
int t = 1;
//cin >> t;
for(int i = 1; i <= t; i++){
//printf("Case #%d: ", i);
solve();
}
}
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... |