Submission #387345

# Submission time Handle Problem Language Result Execution time Memory
387345 2021-04-08T09:39:13 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;
vi 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++){
				vi copy;
				for(int j = 0; j < shop[i].size(); j++){
					if(j < k)
						continue;
					else
						copy.pb(shop[i][j]);
				}
				shop[i] = copy;
				/*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:37:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   37 |     for(int j = 0; j < shop[i].size(); j++){
      |                    ~~^~~~~~~~~~~~~~~~
foodcourt.cpp:56:9: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   56 |    if(b > shop[a].size()) cout<<0<<endl;
      |       ~~^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 43 ms 2156 KB Output is correct
2 Correct 96 ms 2284 KB Output is correct
3 Correct 163 ms 4972 KB Output is correct
4 Correct 379 ms 5868 KB Output is correct
5 Correct 5 ms 2028 KB Output is correct
6 Correct 5 ms 2028 KB Output is correct
7 Correct 878 ms 6764 KB Output is correct
8 Correct 609 ms 5484 KB Output is correct
9 Correct 155 ms 2412 KB Output is correct
10 Correct 549 ms 5100 KB Output is correct
11 Correct 400 ms 3820 KB Output is correct
12 Correct 159 ms 2412 KB Output is correct
13 Correct 200 ms 2284 KB Output is correct
14 Correct 271 ms 3052 KB Output is correct
15 Correct 321 ms 2924 KB Output is correct
16 Correct 233 ms 2540 KB Output is correct
17 Correct 47 ms 2156 KB Output is correct
18 Correct 96 ms 2284 KB Output is correct
19 Correct 6 ms 2028 KB Output is correct
20 Correct 6 ms 2028 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 43 ms 2156 KB Output is correct
2 Correct 96 ms 2284 KB Output is correct
3 Correct 163 ms 4972 KB Output is correct
4 Correct 379 ms 5868 KB Output is correct
5 Correct 5 ms 2028 KB Output is correct
6 Correct 5 ms 2028 KB Output is correct
7 Correct 878 ms 6764 KB Output is correct
8 Correct 609 ms 5484 KB Output is correct
9 Correct 155 ms 2412 KB Output is correct
10 Correct 549 ms 5100 KB Output is correct
11 Correct 400 ms 3820 KB Output is correct
12 Correct 159 ms 2412 KB Output is correct
13 Correct 200 ms 2284 KB Output is correct
14 Correct 271 ms 3052 KB Output is correct
15 Correct 321 ms 2924 KB Output is correct
16 Correct 233 ms 2540 KB Output is correct
17 Correct 47 ms 2156 KB Output is correct
18 Correct 96 ms 2284 KB Output is correct
19 Correct 6 ms 2028 KB Output is correct
20 Correct 6 ms 2028 KB Output is correct
21 Runtime error 660 ms 524292 KB Execution killed with signal 9
22 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1091 ms 3692 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 5 ms 3820 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 43 ms 2156 KB Output is correct
2 Correct 96 ms 2284 KB Output is correct
3 Correct 163 ms 4972 KB Output is correct
4 Correct 379 ms 5868 KB Output is correct
5 Correct 5 ms 2028 KB Output is correct
6 Correct 5 ms 2028 KB Output is correct
7 Correct 878 ms 6764 KB Output is correct
8 Correct 609 ms 5484 KB Output is correct
9 Correct 155 ms 2412 KB Output is correct
10 Correct 549 ms 5100 KB Output is correct
11 Correct 400 ms 3820 KB Output is correct
12 Correct 159 ms 2412 KB Output is correct
13 Correct 200 ms 2284 KB Output is correct
14 Correct 271 ms 3052 KB Output is correct
15 Correct 321 ms 2924 KB Output is correct
16 Correct 233 ms 2540 KB Output is correct
17 Correct 47 ms 2156 KB Output is correct
18 Correct 96 ms 2284 KB Output is correct
19 Correct 6 ms 2028 KB Output is correct
20 Correct 6 ms 2028 KB Output is correct
21 Execution timed out 1091 ms 3692 KB Time limit exceeded
22 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 661 ms 524292 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 43 ms 2156 KB Output is correct
2 Correct 96 ms 2284 KB Output is correct
3 Correct 163 ms 4972 KB Output is correct
4 Correct 379 ms 5868 KB Output is correct
5 Correct 5 ms 2028 KB Output is correct
6 Correct 5 ms 2028 KB Output is correct
7 Correct 878 ms 6764 KB Output is correct
8 Correct 609 ms 5484 KB Output is correct
9 Correct 155 ms 2412 KB Output is correct
10 Correct 549 ms 5100 KB Output is correct
11 Correct 400 ms 3820 KB Output is correct
12 Correct 159 ms 2412 KB Output is correct
13 Correct 200 ms 2284 KB Output is correct
14 Correct 271 ms 3052 KB Output is correct
15 Correct 321 ms 2924 KB Output is correct
16 Correct 233 ms 2540 KB Output is correct
17 Correct 47 ms 2156 KB Output is correct
18 Correct 96 ms 2284 KB Output is correct
19 Correct 6 ms 2028 KB Output is correct
20 Correct 6 ms 2028 KB Output is correct
21 Runtime error 660 ms 524292 KB Execution killed with signal 9
22 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 43 ms 2156 KB Output is correct
2 Correct 96 ms 2284 KB Output is correct
3 Correct 163 ms 4972 KB Output is correct
4 Correct 379 ms 5868 KB Output is correct
5 Correct 5 ms 2028 KB Output is correct
6 Correct 5 ms 2028 KB Output is correct
7 Correct 878 ms 6764 KB Output is correct
8 Correct 609 ms 5484 KB Output is correct
9 Correct 155 ms 2412 KB Output is correct
10 Correct 549 ms 5100 KB Output is correct
11 Correct 400 ms 3820 KB Output is correct
12 Correct 159 ms 2412 KB Output is correct
13 Correct 200 ms 2284 KB Output is correct
14 Correct 271 ms 3052 KB Output is correct
15 Correct 321 ms 2924 KB Output is correct
16 Correct 233 ms 2540 KB Output is correct
17 Correct 47 ms 2156 KB Output is correct
18 Correct 96 ms 2284 KB Output is correct
19 Correct 6 ms 2028 KB Output is correct
20 Correct 6 ms 2028 KB Output is correct
21 Runtime error 660 ms 524292 KB Execution killed with signal 9
22 Halted 0 ms 0 KB -