#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
ll n,m,q;
cin>>n>>m>>q;
vector <ll> A[n];
for(ll w=0; w<q; w++){
int t;
cin>>t;
if(t==1){
ll l,r,c,k;
cin>>l>>r>>c>>k;
for(ll i=l-1; i<=r-1; i++){
for(ll j=0; j<k; j++){
A[i].push_back(c);
}
}
}
else if(t==2){
ll l,r,k;
cin>>l>>r>>k;
for(ll i=l-1; i<=r-1; i++){
if(A[i].size()<=k){
A[i].clear();
}
else{
A[i].erase(A[i].begin(), A[i].begin()+k);
}
}
}
else{
ll a,b;
cin>>a>>b;
if(A[a-1].size()>=b){
cout<<A[a-1][b-1]<<endl;
}
else{
cout<<0<<endl;
}
}
}
}
Compilation message
foodcourt.cpp: In function 'int main()':
foodcourt.cpp:24:19: warning: comparison of integer expressions of different signedness: 'std::vector<long long int>::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
24 | if(A[i].size()<=k){
| ~~~~~~~~~~~^~~
foodcourt.cpp:35:20: warning: comparison of integer expressions of different signedness: 'std::vector<long long int>::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
35 | if(A[a-1].size()>=b){
| ~~~~~~~~~~~~~^~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
596 KB |
Output is correct |
2 |
Correct |
9 ms |
880 KB |
Output is correct |
3 |
Correct |
19 ms |
6084 KB |
Output is correct |
4 |
Correct |
40 ms |
7952 KB |
Output is correct |
5 |
Correct |
3 ms |
212 KB |
Output is correct |
6 |
Correct |
2 ms |
212 KB |
Output is correct |
7 |
Correct |
106 ms |
9532 KB |
Output is correct |
8 |
Correct |
67 ms |
6672 KB |
Output is correct |
9 |
Correct |
13 ms |
1108 KB |
Output is correct |
10 |
Correct |
60 ms |
6360 KB |
Output is correct |
11 |
Correct |
32 ms |
3892 KB |
Output is correct |
12 |
Correct |
14 ms |
1108 KB |
Output is correct |
13 |
Correct |
20 ms |
852 KB |
Output is correct |
14 |
Correct |
26 ms |
2352 KB |
Output is correct |
15 |
Correct |
34 ms |
2272 KB |
Output is correct |
16 |
Correct |
17 ms |
1332 KB |
Output is correct |
17 |
Correct |
6 ms |
596 KB |
Output is correct |
18 |
Correct |
9 ms |
724 KB |
Output is correct |
19 |
Correct |
3 ms |
424 KB |
Output is correct |
20 |
Correct |
3 ms |
468 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
596 KB |
Output is correct |
2 |
Correct |
9 ms |
880 KB |
Output is correct |
3 |
Correct |
19 ms |
6084 KB |
Output is correct |
4 |
Correct |
40 ms |
7952 KB |
Output is correct |
5 |
Correct |
3 ms |
212 KB |
Output is correct |
6 |
Correct |
2 ms |
212 KB |
Output is correct |
7 |
Correct |
106 ms |
9532 KB |
Output is correct |
8 |
Correct |
67 ms |
6672 KB |
Output is correct |
9 |
Correct |
13 ms |
1108 KB |
Output is correct |
10 |
Correct |
60 ms |
6360 KB |
Output is correct |
11 |
Correct |
32 ms |
3892 KB |
Output is correct |
12 |
Correct |
14 ms |
1108 KB |
Output is correct |
13 |
Correct |
20 ms |
852 KB |
Output is correct |
14 |
Correct |
26 ms |
2352 KB |
Output is correct |
15 |
Correct |
34 ms |
2272 KB |
Output is correct |
16 |
Correct |
17 ms |
1332 KB |
Output is correct |
17 |
Correct |
6 ms |
596 KB |
Output is correct |
18 |
Correct |
9 ms |
724 KB |
Output is correct |
19 |
Correct |
3 ms |
424 KB |
Output is correct |
20 |
Correct |
3 ms |
468 KB |
Output is correct |
21 |
Runtime error |
412 ms |
524288 KB |
Execution killed with signal 9 |
22 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
616 ms |
4900 KB |
Output is correct |
2 |
Correct |
470 ms |
4920 KB |
Output is correct |
3 |
Correct |
579 ms |
5072 KB |
Output is correct |
4 |
Correct |
570 ms |
5088 KB |
Output is correct |
5 |
Correct |
465 ms |
4976 KB |
Output is correct |
6 |
Correct |
444 ms |
5092 KB |
Output is correct |
7 |
Correct |
71 ms |
1044 KB |
Output is correct |
8 |
Correct |
74 ms |
1048 KB |
Output is correct |
9 |
Correct |
899 ms |
4932 KB |
Output is correct |
10 |
Correct |
941 ms |
5036 KB |
Output is correct |
11 |
Correct |
914 ms |
5056 KB |
Output is correct |
12 |
Correct |
902 ms |
4924 KB |
Output is correct |
13 |
Correct |
219 ms |
3784 KB |
Output is correct |
14 |
Correct |
291 ms |
5012 KB |
Output is correct |
15 |
Correct |
120 ms |
3932 KB |
Output is correct |
16 |
Correct |
111 ms |
5072 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
409 ms |
524288 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
596 KB |
Output is correct |
2 |
Correct |
9 ms |
880 KB |
Output is correct |
3 |
Correct |
19 ms |
6084 KB |
Output is correct |
4 |
Correct |
40 ms |
7952 KB |
Output is correct |
5 |
Correct |
3 ms |
212 KB |
Output is correct |
6 |
Correct |
2 ms |
212 KB |
Output is correct |
7 |
Correct |
106 ms |
9532 KB |
Output is correct |
8 |
Correct |
67 ms |
6672 KB |
Output is correct |
9 |
Correct |
13 ms |
1108 KB |
Output is correct |
10 |
Correct |
60 ms |
6360 KB |
Output is correct |
11 |
Correct |
32 ms |
3892 KB |
Output is correct |
12 |
Correct |
14 ms |
1108 KB |
Output is correct |
13 |
Correct |
20 ms |
852 KB |
Output is correct |
14 |
Correct |
26 ms |
2352 KB |
Output is correct |
15 |
Correct |
34 ms |
2272 KB |
Output is correct |
16 |
Correct |
17 ms |
1332 KB |
Output is correct |
17 |
Correct |
6 ms |
596 KB |
Output is correct |
18 |
Correct |
9 ms |
724 KB |
Output is correct |
19 |
Correct |
3 ms |
424 KB |
Output is correct |
20 |
Correct |
3 ms |
468 KB |
Output is correct |
21 |
Correct |
616 ms |
4900 KB |
Output is correct |
22 |
Correct |
470 ms |
4920 KB |
Output is correct |
23 |
Correct |
579 ms |
5072 KB |
Output is correct |
24 |
Correct |
570 ms |
5088 KB |
Output is correct |
25 |
Correct |
465 ms |
4976 KB |
Output is correct |
26 |
Correct |
444 ms |
5092 KB |
Output is correct |
27 |
Correct |
71 ms |
1044 KB |
Output is correct |
28 |
Correct |
74 ms |
1048 KB |
Output is correct |
29 |
Correct |
899 ms |
4932 KB |
Output is correct |
30 |
Correct |
941 ms |
5036 KB |
Output is correct |
31 |
Correct |
914 ms |
5056 KB |
Output is correct |
32 |
Correct |
902 ms |
4924 KB |
Output is correct |
33 |
Correct |
219 ms |
3784 KB |
Output is correct |
34 |
Correct |
291 ms |
5012 KB |
Output is correct |
35 |
Correct |
120 ms |
3932 KB |
Output is correct |
36 |
Correct |
111 ms |
5072 KB |
Output is correct |
37 |
Execution timed out |
1061 ms |
17660 KB |
Time limit exceeded |
38 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
423 ms |
524288 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
596 KB |
Output is correct |
2 |
Correct |
9 ms |
880 KB |
Output is correct |
3 |
Correct |
19 ms |
6084 KB |
Output is correct |
4 |
Correct |
40 ms |
7952 KB |
Output is correct |
5 |
Correct |
3 ms |
212 KB |
Output is correct |
6 |
Correct |
2 ms |
212 KB |
Output is correct |
7 |
Correct |
106 ms |
9532 KB |
Output is correct |
8 |
Correct |
67 ms |
6672 KB |
Output is correct |
9 |
Correct |
13 ms |
1108 KB |
Output is correct |
10 |
Correct |
60 ms |
6360 KB |
Output is correct |
11 |
Correct |
32 ms |
3892 KB |
Output is correct |
12 |
Correct |
14 ms |
1108 KB |
Output is correct |
13 |
Correct |
20 ms |
852 KB |
Output is correct |
14 |
Correct |
26 ms |
2352 KB |
Output is correct |
15 |
Correct |
34 ms |
2272 KB |
Output is correct |
16 |
Correct |
17 ms |
1332 KB |
Output is correct |
17 |
Correct |
6 ms |
596 KB |
Output is correct |
18 |
Correct |
9 ms |
724 KB |
Output is correct |
19 |
Correct |
3 ms |
424 KB |
Output is correct |
20 |
Correct |
3 ms |
468 KB |
Output is correct |
21 |
Runtime error |
412 ms |
524288 KB |
Execution killed with signal 9 |
22 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
596 KB |
Output is correct |
2 |
Correct |
9 ms |
880 KB |
Output is correct |
3 |
Correct |
19 ms |
6084 KB |
Output is correct |
4 |
Correct |
40 ms |
7952 KB |
Output is correct |
5 |
Correct |
3 ms |
212 KB |
Output is correct |
6 |
Correct |
2 ms |
212 KB |
Output is correct |
7 |
Correct |
106 ms |
9532 KB |
Output is correct |
8 |
Correct |
67 ms |
6672 KB |
Output is correct |
9 |
Correct |
13 ms |
1108 KB |
Output is correct |
10 |
Correct |
60 ms |
6360 KB |
Output is correct |
11 |
Correct |
32 ms |
3892 KB |
Output is correct |
12 |
Correct |
14 ms |
1108 KB |
Output is correct |
13 |
Correct |
20 ms |
852 KB |
Output is correct |
14 |
Correct |
26 ms |
2352 KB |
Output is correct |
15 |
Correct |
34 ms |
2272 KB |
Output is correct |
16 |
Correct |
17 ms |
1332 KB |
Output is correct |
17 |
Correct |
6 ms |
596 KB |
Output is correct |
18 |
Correct |
9 ms |
724 KB |
Output is correct |
19 |
Correct |
3 ms |
424 KB |
Output is correct |
20 |
Correct |
3 ms |
468 KB |
Output is correct |
21 |
Runtime error |
412 ms |
524288 KB |
Execution killed with signal 9 |
22 |
Halted |
0 ms |
0 KB |
- |