Submission #971185

#TimeUsernameProblemLanguageResultExecution timeMemory
971185AIF_is_carvingFood Court (JOI21_foodcourt)C++17
9 / 100
1082 ms389672 KiB
#include <bits/stdc++.h> typedef long long ll; using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); int n, m, q; cin>>n>>m>>q; vector<int> court[n+1]; vector<int> start(n+1); for(int i=0; i<n+1; i++) start[i] = 0; 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++){ court[i].push_back(c); } } else if(t == 2){ int l, r, k; cin>>l>>r>>k; for(int i=l; i<=r; i++){ if(start[i]+k<=court[i].size()){ start[i]=start[i]+k; } else{ start[i]=court[i].size(); } } } else{ int a, b; cin>>a>>b; if(start[a]+b-1<court[a].size()) cout<<court[a][start[a]+b-1]<<"\n"; else cout<<0<<"\n"; } //for(int i=1; i<=n; i++) cout<<start[i]<<" "; // for(int i=1; i<=n; i++){ // cout<<start[i]<<" "; // for(auto x: court[i]) cout<<x<<" "; // cout<<"\n"; // } // cout<<"\n"; } return 0; }

Compilation message (stderr)

foodcourt.cpp: In function 'int main()':
foodcourt.cpp:35:30: warning: comparison of integer expressions of different signedness: '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   35 |                 if(start[i]+k<=court[i].size()){
foodcourt.cpp:45:28: warning: comparison of integer expressions of different signedness: '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   45 |             if(start[a]+b-1<court[a].size()) cout<<court[a][start[a]+b-1]<<"\n";
#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...