Submission #797035

# Submission time Handle Problem Language Result Execution time Memory
797035 2023-07-29T05:05:58 Z vjudge1 Food Court (JOI21_foodcourt) C++17
0 / 100
3 ms 3284 KB
#include<bits/stdc++.h>

using namespace std;
using ll = long long;

const int N = 2010;
int n, m, q;

deque<pair<int, int>> g[N]; 



int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    cin >> n >> m >> q;
    if(n <= 2000 && q <= 2000) {
        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++) {
                    g[i].push_back({c, k});
                }
            }
            if(t == 2) {
                int l, r, k;
                cin >> l >> r >> k;
                for(int i = l; i <= r; i++) {
                    while(!g[i].empty() && g[i].front().second <= k) {
                        k -= g[i].front().second;
                        g[i].pop_front();
                    }
                    if(!g[i].empty()) 
                        g[i].front().second -= k;
                }
            }
            if(t == 3) {
                int a, b;
                cin >> a >> b;
                int ans = 0;
                for(auto [c, k] : g[a]) {
                    if(b > k) b -= k;
                    else {ans = c; break;}
                }
                cout << ans << '\n';    
            }
        }
        return 0;
    }
    if(m == 1) {

    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 3284 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 3284 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1688 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1620 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 3284 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1620 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 3284 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 3284 KB Output isn't correct
2 Halted 0 ms 0 KB -