Submission #387336

# Submission time Handle Problem Language Result Execution time Memory
387336 2021-04-08T09:25:27 Z MODDI Food Court (JOI21_foodcourt) C++14
0 / 100
2 ms 640 KB
#include <bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mp make_pair
#define pb push_back
#define vi vector<int>
#define vl vector<ll>
using namespace std;
int n, m, q;
vi shop[2020];
int main(){
	cin>>n>>m>>q;
	while(q--){
		int tip;
		cin>>tip;
		if(tip == 1){
			int l, r, k, c;
			cin>>l>>r>>k>>c;
			l--; r--;
			for(int i = l; i <= r; i++)
			{
				for(int j = 0; j < c; j++)
					shop[i].pb(k);
			}
		}
		else if(tip == 2){
			int l, r, k;
			cin>>l>>r>>k;
			l--; r--;
			for(int i = l; i <= r; i++){
				for(int j = 0; j <= k; j++){
					if(shop[i].size() == 0)
						break;
					shop[i].pop_back() ;
				}
			}
		}
		else{
			ll b, a;
			cin>>a>>b;
			a--; b--;
			/*for(auto x : shop[a])
				cout<<x<<" ";
			cout<<endl;*/
			if(b > shop[a].size())	cout<<0<<endl;
			else
				cout<<shop[a][b]<<endl;
		}
	}
	return 0;
}

Compilation message

foodcourt.cpp: In function 'int main()':
foodcourt.cpp:46:9: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   46 |    if(b > shop[a].size()) cout<<0<<endl;
      |       ~~^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 620 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 620 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 492 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 492 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 620 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 640 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 620 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 620 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -