Submission #735681

#TimeUsernameProblemLanguageResultExecution timeMemory
735681ismayilFood Court (JOI21_foodcourt)C++17
2 / 100
1074 ms524288 KiB
#include <bits/stdc++.h> #define int long long using namespace std; void solve(){ int N, M, Q; cin >> N >> M >> Q; vector<deque<int>> q(N); for(int i = 0; i < Q; i++){ int type; cin >> type; if(type == 1){ int l, r, c, k; cin >> l >> r >> c >> k; for(int j = l - 1; j <= r - 1; j++) q[j].push_back(c); }else if(type == 2){ int l, r, k; cin >> l >> r >> k; for(int j = l - 1; j <= r - 1; j++) if(!q[j].empty()) q[j].pop_front(); }else{ int a, b; cin >> a >> b; if(q[a - 1].size() >= b) cout << q[a - 1][b - 1] << endl; else cout << 0 << endl; } } } signed main(){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); //freopen("output.txt", "w", stdout); int t = 1; //cin >> t; for(int i = 1; i <= t; i++){ //printf("Case #%d: ", i); solve(); } }

Compilation message (stderr)

foodcourt.cpp: In function 'void solve()':
foodcourt.cpp:23:32: warning: comparison of integer expressions of different signedness: 'std::deque<long long int>::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
   23 |             if(q[a - 1].size() >= b) cout << q[a - 1][b - 1] << endl;
      |                ~~~~~~~~~~~~~~~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...