Submission #387349

# Submission time Handle Problem Language Result Execution time Memory
387349 2021-04-08T09:42:19 Z MODDI Food Court (JOI21_foodcourt) C++14
2 / 100
1000 ms 524292 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;
deque<int> shop[70000];
int main(){
	cin>>n>>m>>q;
	while(q--){
		int tip;
		cin>>tip;
		if(tip == 1){
			int l, r, k, c;
			cin>>l>>r>>c>>k;
			l--; r--;
			for(int i = l; i <= r; i++)
			{
				for(int j = 0; j < k; j++)
					shop[i].pb(c);
					
			/*	for(auto x : shop[i])
					cout<<x<<" ";
				cout<<endl;*/
			}
		}
		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_front();
				}
				/*for(auto x : shop[i])
					cout<<x<<" ";
				cout<<endl;*/
			}
		}
		else{
			ll b, a;
			cin>>a>>b;
			a--;
			/*for(auto x : shop[a])
				cout<<x<<" ";
			cout<<endl;*/
			if(b > shop[a].size())	cout<<0<<endl;
			else
				cout<<shop[a][b-1]<<endl;
		}
	}
	return 0;
}

Compilation message

foodcourt.cpp: In function 'int main()':
foodcourt.cpp:52:9: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::deque<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   52 |    if(b > shop[a].size()) cout<<0<<endl;
      |       ~~^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 45 ms 47596 KB Output is correct
2 Correct 50 ms 47852 KB Output is correct
3 Correct 49 ms 49132 KB Output is correct
4 Correct 57 ms 50200 KB Output is correct
5 Correct 41 ms 47468 KB Output is correct
6 Correct 42 ms 47468 KB Output is correct
7 Correct 53 ms 50028 KB Output is correct
8 Correct 51 ms 49644 KB Output is correct
9 Correct 51 ms 47852 KB Output is correct
10 Correct 54 ms 49388 KB Output is correct
11 Correct 53 ms 48800 KB Output is correct
12 Correct 53 ms 47852 KB Output is correct
13 Correct 56 ms 48440 KB Output is correct
14 Correct 72 ms 48532 KB Output is correct
15 Correct 59 ms 48492 KB Output is correct
16 Correct 57 ms 48492 KB Output is correct
17 Correct 47 ms 47596 KB Output is correct
18 Correct 50 ms 47596 KB Output is correct
19 Correct 40 ms 47468 KB Output is correct
20 Correct 43 ms 47468 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 45 ms 47596 KB Output is correct
2 Correct 50 ms 47852 KB Output is correct
3 Correct 49 ms 49132 KB Output is correct
4 Correct 57 ms 50200 KB Output is correct
5 Correct 41 ms 47468 KB Output is correct
6 Correct 42 ms 47468 KB Output is correct
7 Correct 53 ms 50028 KB Output is correct
8 Correct 51 ms 49644 KB Output is correct
9 Correct 51 ms 47852 KB Output is correct
10 Correct 54 ms 49388 KB Output is correct
11 Correct 53 ms 48800 KB Output is correct
12 Correct 53 ms 47852 KB Output is correct
13 Correct 56 ms 48440 KB Output is correct
14 Correct 72 ms 48532 KB Output is correct
15 Correct 59 ms 48492 KB Output is correct
16 Correct 57 ms 48492 KB Output is correct
17 Correct 47 ms 47596 KB Output is correct
18 Correct 50 ms 47596 KB Output is correct
19 Correct 40 ms 47468 KB Output is correct
20 Correct 43 ms 47468 KB Output is correct
21 Runtime error 685 ms 524292 KB Execution killed with signal 9
22 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1094 ms 47764 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 91 ms 95852 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 45 ms 47596 KB Output is correct
2 Correct 50 ms 47852 KB Output is correct
3 Correct 49 ms 49132 KB Output is correct
4 Correct 57 ms 50200 KB Output is correct
5 Correct 41 ms 47468 KB Output is correct
6 Correct 42 ms 47468 KB Output is correct
7 Correct 53 ms 50028 KB Output is correct
8 Correct 51 ms 49644 KB Output is correct
9 Correct 51 ms 47852 KB Output is correct
10 Correct 54 ms 49388 KB Output is correct
11 Correct 53 ms 48800 KB Output is correct
12 Correct 53 ms 47852 KB Output is correct
13 Correct 56 ms 48440 KB Output is correct
14 Correct 72 ms 48532 KB Output is correct
15 Correct 59 ms 48492 KB Output is correct
16 Correct 57 ms 48492 KB Output is correct
17 Correct 47 ms 47596 KB Output is correct
18 Correct 50 ms 47596 KB Output is correct
19 Correct 40 ms 47468 KB Output is correct
20 Correct 43 ms 47468 KB Output is correct
21 Execution timed out 1094 ms 47764 KB Time limit exceeded
22 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 686 ms 524288 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 45 ms 47596 KB Output is correct
2 Correct 50 ms 47852 KB Output is correct
3 Correct 49 ms 49132 KB Output is correct
4 Correct 57 ms 50200 KB Output is correct
5 Correct 41 ms 47468 KB Output is correct
6 Correct 42 ms 47468 KB Output is correct
7 Correct 53 ms 50028 KB Output is correct
8 Correct 51 ms 49644 KB Output is correct
9 Correct 51 ms 47852 KB Output is correct
10 Correct 54 ms 49388 KB Output is correct
11 Correct 53 ms 48800 KB Output is correct
12 Correct 53 ms 47852 KB Output is correct
13 Correct 56 ms 48440 KB Output is correct
14 Correct 72 ms 48532 KB Output is correct
15 Correct 59 ms 48492 KB Output is correct
16 Correct 57 ms 48492 KB Output is correct
17 Correct 47 ms 47596 KB Output is correct
18 Correct 50 ms 47596 KB Output is correct
19 Correct 40 ms 47468 KB Output is correct
20 Correct 43 ms 47468 KB Output is correct
21 Runtime error 685 ms 524292 KB Execution killed with signal 9
22 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 45 ms 47596 KB Output is correct
2 Correct 50 ms 47852 KB Output is correct
3 Correct 49 ms 49132 KB Output is correct
4 Correct 57 ms 50200 KB Output is correct
5 Correct 41 ms 47468 KB Output is correct
6 Correct 42 ms 47468 KB Output is correct
7 Correct 53 ms 50028 KB Output is correct
8 Correct 51 ms 49644 KB Output is correct
9 Correct 51 ms 47852 KB Output is correct
10 Correct 54 ms 49388 KB Output is correct
11 Correct 53 ms 48800 KB Output is correct
12 Correct 53 ms 47852 KB Output is correct
13 Correct 56 ms 48440 KB Output is correct
14 Correct 72 ms 48532 KB Output is correct
15 Correct 59 ms 48492 KB Output is correct
16 Correct 57 ms 48492 KB Output is correct
17 Correct 47 ms 47596 KB Output is correct
18 Correct 50 ms 47596 KB Output is correct
19 Correct 40 ms 47468 KB Output is correct
20 Correct 43 ms 47468 KB Output is correct
21 Runtime error 685 ms 524292 KB Execution killed with signal 9
22 Halted 0 ms 0 KB -