Submission #797172

# Submission time Handle Problem Language Result Execution time Memory
797172 2023-07-29T07:39:30 Z vjudge1 Food Court (JOI21_foodcourt) C++17
0 / 100
3 ms 3156 KB
#include<bits/stdc++.h>

using namespace std;
using ll = long long;

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

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

Compilation message

foodcourt.cpp: In function 'int main()':
foodcourt.cpp:49:32: warning: comparison of integer expressions of different signedness: 'std::deque<int>::size_type' {aka 'long unsigned int'} and 'll' {aka 'long long int'} [-Wsign-compare]
   49 |                 if(g[a].size() >= b) ans = g[a][b - 1];
      |                    ~~~~~~~~~~~~^~~~
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 3156 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 3156 KB Execution killed with signal 11
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 1 ms 1620 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 3156 KB Execution killed with signal 11
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 Runtime error 3 ms 3156 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 3156 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -