# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
971185 | AIF_is_carving | Food Court (JOI21_foodcourt) | C++17 | 1082 ms | 389672 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>
typedef long long ll;
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, m, q;
cin>>n>>m>>q;
vector<int> court[n+1];
vector<int> start(n+1);
for(int i=0; i<n+1; i++) start[i] = 0;
for(int i=0; i<q; i++){
int t; cin>>t;
if(t == 1){
int l, r, c, k;
cin>>l>>r>>c>>k;
for(int i=l; i<=r; i++){
court[i].push_back(c);
}
}
else if(t == 2){
int l, r, k;
cin>>l>>r>>k;
for(int i=l; i<=r; i++){
if(start[i]+k<=court[i].size()){
start[i]=start[i]+k;
}
else{
start[i]=court[i].size();
}
}
}
else{
int a, b; cin>>a>>b;
if(start[a]+b-1<court[a].size()) cout<<court[a][start[a]+b-1]<<"\n";
else cout<<0<<"\n";
}
//for(int i=1; i<=n; i++) cout<<start[i]<<" ";
// for(int i=1; i<=n; i++){
// cout<<start[i]<<" ";
// for(auto x: court[i]) cout<<x<<" ";
// cout<<"\n";
// }
// cout<<"\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... |