#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
foodcourt.cpp: In function 'int main()':
foodcourt.cpp:38:28: warning: comparison of integer expressions of different signedness: 'std::deque<long long int>::size_type' {aka 'long unsigned int'} and 'll' {aka 'long long int'} [-Wsign-compare]
38 | if(V[a].size() > b) re = V[a][b];
| ~~~~~~~~~~~~^~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
1628 KB |
Output is correct |
2 |
Correct |
6 ms |
2136 KB |
Output is correct |
3 |
Correct |
7 ms |
5208 KB |
Output is correct |
4 |
Correct |
10 ms |
7268 KB |
Output is correct |
5 |
Correct |
3 ms |
348 KB |
Output is correct |
6 |
Correct |
2 ms |
348 KB |
Output is correct |
7 |
Correct |
9 ms |
7772 KB |
Output is correct |
8 |
Correct |
9 ms |
5612 KB |
Output is correct |
9 |
Correct |
7 ms |
2140 KB |
Output is correct |
10 |
Correct |
9 ms |
5540 KB |
Output is correct |
11 |
Correct |
9 ms |
4188 KB |
Output is correct |
12 |
Correct |
7 ms |
2240 KB |
Output is correct |
13 |
Correct |
9 ms |
2620 KB |
Output is correct |
14 |
Correct |
12 ms |
2772 KB |
Output is correct |
15 |
Correct |
9 ms |
3676 KB |
Output is correct |
16 |
Correct |
10 ms |
2652 KB |
Output is correct |
17 |
Correct |
5 ms |
1372 KB |
Output is correct |
18 |
Correct |
8 ms |
2140 KB |
Output is correct |
19 |
Correct |
3 ms |
1372 KB |
Output is correct |
20 |
Correct |
3 ms |
1628 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
1628 KB |
Output is correct |
2 |
Correct |
6 ms |
2136 KB |
Output is correct |
3 |
Correct |
7 ms |
5208 KB |
Output is correct |
4 |
Correct |
10 ms |
7268 KB |
Output is correct |
5 |
Correct |
3 ms |
348 KB |
Output is correct |
6 |
Correct |
2 ms |
348 KB |
Output is correct |
7 |
Correct |
9 ms |
7772 KB |
Output is correct |
8 |
Correct |
9 ms |
5612 KB |
Output is correct |
9 |
Correct |
7 ms |
2140 KB |
Output is correct |
10 |
Correct |
9 ms |
5540 KB |
Output is correct |
11 |
Correct |
9 ms |
4188 KB |
Output is correct |
12 |
Correct |
7 ms |
2240 KB |
Output is correct |
13 |
Correct |
9 ms |
2620 KB |
Output is correct |
14 |
Correct |
12 ms |
2772 KB |
Output is correct |
15 |
Correct |
9 ms |
3676 KB |
Output is correct |
16 |
Correct |
10 ms |
2652 KB |
Output is correct |
17 |
Correct |
5 ms |
1372 KB |
Output is correct |
18 |
Correct |
8 ms |
2140 KB |
Output is correct |
19 |
Correct |
3 ms |
1372 KB |
Output is correct |
20 |
Correct |
3 ms |
1628 KB |
Output is correct |
21 |
Runtime error |
409 ms |
524288 KB |
Execution killed with signal 9 |
22 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1049 ms |
44120 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1058 ms |
151356 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
1628 KB |
Output is correct |
2 |
Correct |
6 ms |
2136 KB |
Output is correct |
3 |
Correct |
7 ms |
5208 KB |
Output is correct |
4 |
Correct |
10 ms |
7268 KB |
Output is correct |
5 |
Correct |
3 ms |
348 KB |
Output is correct |
6 |
Correct |
2 ms |
348 KB |
Output is correct |
7 |
Correct |
9 ms |
7772 KB |
Output is correct |
8 |
Correct |
9 ms |
5612 KB |
Output is correct |
9 |
Correct |
7 ms |
2140 KB |
Output is correct |
10 |
Correct |
9 ms |
5540 KB |
Output is correct |
11 |
Correct |
9 ms |
4188 KB |
Output is correct |
12 |
Correct |
7 ms |
2240 KB |
Output is correct |
13 |
Correct |
9 ms |
2620 KB |
Output is correct |
14 |
Correct |
12 ms |
2772 KB |
Output is correct |
15 |
Correct |
9 ms |
3676 KB |
Output is correct |
16 |
Correct |
10 ms |
2652 KB |
Output is correct |
17 |
Correct |
5 ms |
1372 KB |
Output is correct |
18 |
Correct |
8 ms |
2140 KB |
Output is correct |
19 |
Correct |
3 ms |
1372 KB |
Output is correct |
20 |
Correct |
3 ms |
1628 KB |
Output is correct |
21 |
Execution timed out |
1049 ms |
44120 KB |
Time limit exceeded |
22 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
352 ms |
524288 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
1628 KB |
Output is correct |
2 |
Correct |
6 ms |
2136 KB |
Output is correct |
3 |
Correct |
7 ms |
5208 KB |
Output is correct |
4 |
Correct |
10 ms |
7268 KB |
Output is correct |
5 |
Correct |
3 ms |
348 KB |
Output is correct |
6 |
Correct |
2 ms |
348 KB |
Output is correct |
7 |
Correct |
9 ms |
7772 KB |
Output is correct |
8 |
Correct |
9 ms |
5612 KB |
Output is correct |
9 |
Correct |
7 ms |
2140 KB |
Output is correct |
10 |
Correct |
9 ms |
5540 KB |
Output is correct |
11 |
Correct |
9 ms |
4188 KB |
Output is correct |
12 |
Correct |
7 ms |
2240 KB |
Output is correct |
13 |
Correct |
9 ms |
2620 KB |
Output is correct |
14 |
Correct |
12 ms |
2772 KB |
Output is correct |
15 |
Correct |
9 ms |
3676 KB |
Output is correct |
16 |
Correct |
10 ms |
2652 KB |
Output is correct |
17 |
Correct |
5 ms |
1372 KB |
Output is correct |
18 |
Correct |
8 ms |
2140 KB |
Output is correct |
19 |
Correct |
3 ms |
1372 KB |
Output is correct |
20 |
Correct |
3 ms |
1628 KB |
Output is correct |
21 |
Runtime error |
409 ms |
524288 KB |
Execution killed with signal 9 |
22 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
1628 KB |
Output is correct |
2 |
Correct |
6 ms |
2136 KB |
Output is correct |
3 |
Correct |
7 ms |
5208 KB |
Output is correct |
4 |
Correct |
10 ms |
7268 KB |
Output is correct |
5 |
Correct |
3 ms |
348 KB |
Output is correct |
6 |
Correct |
2 ms |
348 KB |
Output is correct |
7 |
Correct |
9 ms |
7772 KB |
Output is correct |
8 |
Correct |
9 ms |
5612 KB |
Output is correct |
9 |
Correct |
7 ms |
2140 KB |
Output is correct |
10 |
Correct |
9 ms |
5540 KB |
Output is correct |
11 |
Correct |
9 ms |
4188 KB |
Output is correct |
12 |
Correct |
7 ms |
2240 KB |
Output is correct |
13 |
Correct |
9 ms |
2620 KB |
Output is correct |
14 |
Correct |
12 ms |
2772 KB |
Output is correct |
15 |
Correct |
9 ms |
3676 KB |
Output is correct |
16 |
Correct |
10 ms |
2652 KB |
Output is correct |
17 |
Correct |
5 ms |
1372 KB |
Output is correct |
18 |
Correct |
8 ms |
2140 KB |
Output is correct |
19 |
Correct |
3 ms |
1372 KB |
Output is correct |
20 |
Correct |
3 ms |
1628 KB |
Output is correct |
21 |
Runtime error |
409 ms |
524288 KB |
Execution killed with signal 9 |
22 |
Halted |
0 ms |
0 KB |
- |