Submission #973665

#TimeUsernameProblemLanguageResultExecution timeMemory
973665RaresFelixFood Court (JOI21_foodcourt)C++17
2 / 100
1058 ms524288 KiB
#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 (stderr)

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];
      |                ~~~~~~~~~~~~^~~
#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...