Submission #1110270

# Submission time Handle Problem Language Result Execution time Memory
1110270 2024-11-09T04:05:49 Z vjudge1 Card Collection (JOI24_collection) C++17
11 / 100
4000 ms 793176 KB
#include<bits/stdc++.h>
#define fi first
#define se second
#define ll long long
#define pb push_back
using namespace std;
int n,m,a[2005],b[2005];
vector<pair<int,int>> vv,truyvan;
vector<pair<int,int>> val[2005][2005];
map<pair<int,int>,bool> mp;
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
//	freopen(".INP","r",stdin);
//	freopen(".OUT","w",stdout);
	cin>>n>>m;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i]>>b[i];
		vv.pb({a[i],b[i]});
	}
	for(int i=1;i<=n;i++)
	{
		val[i][i].pb({a[i],b[i]});
	}
	
	for(int le=2;le<=n;le++)
	{
		for(int l=1;l<=n-le+1;l++)
		{
			int r=l+le-1;
			for(int i=l;i<=r-1;i++)
			{
				for(auto x:val[l][i])
				{
					for(auto y:val[i+1][r])
					{
						pair<int,int> gtri1={min(x.fi,y.fi),min(x.se,y.se)};
						pair<int,int> gtri2={max(x.fi,y.fi),max(x.se,y.se)};
						val[l][r].pb(gtri1);
						val[l][r].pb(gtri2);
					}
				}
			}
			sort(val[l][r].begin(),val[l][r].end());
			val[l][r].erase(unique(val[l][r].begin(),val[l][r].end()),val[l][r].end()); 
		}
	}
	
	for(auto x:val[1][n]) mp[x]=true;
	for(int i=1;i<=m;i++)
	{
		int u,v;
		cin>>u>>v;
		if(mp[{u,v}]) cout<<i<<' ';
	}
	
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 18 ms 94800 KB Output is correct
2 Correct 18 ms 94612 KB Output is correct
3 Correct 18 ms 94800 KB Output is correct
4 Correct 17 ms 94800 KB Output is correct
5 Correct 20 ms 94800 KB Output is correct
6 Correct 19 ms 94680 KB Output is correct
7 Correct 19 ms 94696 KB Output is correct
8 Correct 24 ms 94800 KB Output is correct
9 Correct 17 ms 94800 KB Output is correct
10 Correct 18 ms 94856 KB Output is correct
11 Correct 19 ms 94800 KB Output is correct
12 Correct 23 ms 95056 KB Output is correct
13 Correct 24 ms 95568 KB Output is correct
14 Correct 22 ms 95740 KB Output is correct
15 Correct 25 ms 96336 KB Output is correct
16 Correct 26 ms 96432 KB Output is correct
17 Correct 37 ms 97988 KB Output is correct
18 Correct 37 ms 98508 KB Output is correct
19 Correct 50 ms 101056 KB Output is correct
20 Correct 17 ms 94876 KB Output is correct
21 Correct 18 ms 94872 KB Output is correct
22 Correct 18 ms 94800 KB Output is correct
23 Correct 18 ms 94800 KB Output is correct
24 Correct 17 ms 94800 KB Output is correct
25 Correct 21 ms 94864 KB Output is correct
26 Correct 19 ms 94800 KB Output is correct
27 Correct 25 ms 96080 KB Output is correct
28 Correct 37 ms 97176 KB Output is correct
29 Correct 35 ms 97424 KB Output is correct
30 Correct 58 ms 101084 KB Output is correct
31 Correct 55 ms 101056 KB Output is correct
32 Correct 54 ms 100288 KB Output is correct
33 Correct 81 ms 105148 KB Output is correct
34 Correct 22 ms 95568 KB Output is correct
35 Correct 122 ms 111796 KB Output is correct
36 Correct 29 ms 97104 KB Output is correct
37 Correct 28 ms 95560 KB Output is correct
38 Correct 25 ms 95472 KB Output is correct
39 Correct 27 ms 95312 KB Output is correct
40 Correct 29 ms 95616 KB Output is correct
41 Correct 30 ms 95568 KB Output is correct
42 Correct 26 ms 95568 KB Output is correct
43 Correct 31 ms 95560 KB Output is correct
44 Correct 25 ms 95568 KB Output is correct
45 Correct 25 ms 96080 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 18 ms 94800 KB Output is correct
2 Correct 18 ms 94612 KB Output is correct
3 Correct 18 ms 94800 KB Output is correct
4 Correct 17 ms 94800 KB Output is correct
5 Correct 20 ms 94800 KB Output is correct
6 Correct 19 ms 94680 KB Output is correct
7 Correct 19 ms 94696 KB Output is correct
8 Correct 24 ms 94800 KB Output is correct
9 Correct 17 ms 94800 KB Output is correct
10 Correct 18 ms 94856 KB Output is correct
11 Correct 19 ms 94800 KB Output is correct
12 Correct 23 ms 95056 KB Output is correct
13 Correct 24 ms 95568 KB Output is correct
14 Correct 22 ms 95740 KB Output is correct
15 Correct 25 ms 96336 KB Output is correct
16 Correct 26 ms 96432 KB Output is correct
17 Correct 37 ms 97988 KB Output is correct
18 Correct 37 ms 98508 KB Output is correct
19 Correct 50 ms 101056 KB Output is correct
20 Correct 17 ms 94876 KB Output is correct
21 Correct 18 ms 94872 KB Output is correct
22 Correct 18 ms 94800 KB Output is correct
23 Correct 18 ms 94800 KB Output is correct
24 Correct 17 ms 94800 KB Output is correct
25 Correct 21 ms 94864 KB Output is correct
26 Correct 19 ms 94800 KB Output is correct
27 Correct 25 ms 96080 KB Output is correct
28 Correct 37 ms 97176 KB Output is correct
29 Correct 35 ms 97424 KB Output is correct
30 Correct 58 ms 101084 KB Output is correct
31 Correct 55 ms 101056 KB Output is correct
32 Correct 54 ms 100288 KB Output is correct
33 Correct 81 ms 105148 KB Output is correct
34 Correct 22 ms 95568 KB Output is correct
35 Correct 122 ms 111796 KB Output is correct
36 Correct 29 ms 97104 KB Output is correct
37 Correct 28 ms 95560 KB Output is correct
38 Correct 25 ms 95472 KB Output is correct
39 Correct 27 ms 95312 KB Output is correct
40 Correct 29 ms 95616 KB Output is correct
41 Correct 30 ms 95568 KB Output is correct
42 Correct 26 ms 95568 KB Output is correct
43 Correct 31 ms 95560 KB Output is correct
44 Correct 25 ms 95568 KB Output is correct
45 Correct 25 ms 96080 KB Output is correct
46 Execution timed out 4116 ms 793176 KB Time limit exceeded
47 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 18 ms 94800 KB Output is correct
2 Correct 18 ms 94612 KB Output is correct
3 Correct 18 ms 94800 KB Output is correct
4 Correct 17 ms 94800 KB Output is correct
5 Correct 20 ms 94800 KB Output is correct
6 Correct 19 ms 94680 KB Output is correct
7 Correct 19 ms 94696 KB Output is correct
8 Correct 24 ms 94800 KB Output is correct
9 Correct 17 ms 94800 KB Output is correct
10 Correct 18 ms 94856 KB Output is correct
11 Correct 19 ms 94800 KB Output is correct
12 Correct 23 ms 95056 KB Output is correct
13 Correct 24 ms 95568 KB Output is correct
14 Correct 22 ms 95740 KB Output is correct
15 Correct 25 ms 96336 KB Output is correct
16 Correct 26 ms 96432 KB Output is correct
17 Correct 37 ms 97988 KB Output is correct
18 Correct 37 ms 98508 KB Output is correct
19 Correct 50 ms 101056 KB Output is correct
20 Correct 17 ms 94876 KB Output is correct
21 Correct 18 ms 94872 KB Output is correct
22 Correct 18 ms 94800 KB Output is correct
23 Correct 18 ms 94800 KB Output is correct
24 Correct 17 ms 94800 KB Output is correct
25 Correct 21 ms 94864 KB Output is correct
26 Correct 19 ms 94800 KB Output is correct
27 Correct 25 ms 96080 KB Output is correct
28 Correct 37 ms 97176 KB Output is correct
29 Correct 35 ms 97424 KB Output is correct
30 Correct 58 ms 101084 KB Output is correct
31 Correct 55 ms 101056 KB Output is correct
32 Correct 54 ms 100288 KB Output is correct
33 Correct 81 ms 105148 KB Output is correct
34 Correct 22 ms 95568 KB Output is correct
35 Correct 122 ms 111796 KB Output is correct
36 Correct 29 ms 97104 KB Output is correct
37 Correct 28 ms 95560 KB Output is correct
38 Correct 25 ms 95472 KB Output is correct
39 Correct 27 ms 95312 KB Output is correct
40 Correct 29 ms 95616 KB Output is correct
41 Correct 30 ms 95568 KB Output is correct
42 Correct 26 ms 95568 KB Output is correct
43 Correct 31 ms 95560 KB Output is correct
44 Correct 25 ms 95568 KB Output is correct
45 Correct 25 ms 96080 KB Output is correct
46 Execution timed out 4116 ms 793176 KB Time limit exceeded
47 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 18 ms 94800 KB Output is correct
2 Correct 18 ms 94612 KB Output is correct
3 Correct 18 ms 94800 KB Output is correct
4 Correct 17 ms 94800 KB Output is correct
5 Correct 20 ms 94800 KB Output is correct
6 Correct 19 ms 94680 KB Output is correct
7 Correct 19 ms 94696 KB Output is correct
8 Correct 24 ms 94800 KB Output is correct
9 Correct 17 ms 94800 KB Output is correct
10 Correct 18 ms 94856 KB Output is correct
11 Correct 19 ms 94800 KB Output is correct
12 Correct 23 ms 95056 KB Output is correct
13 Correct 24 ms 95568 KB Output is correct
14 Correct 22 ms 95740 KB Output is correct
15 Correct 25 ms 96336 KB Output is correct
16 Correct 26 ms 96432 KB Output is correct
17 Correct 37 ms 97988 KB Output is correct
18 Correct 37 ms 98508 KB Output is correct
19 Correct 50 ms 101056 KB Output is correct
20 Correct 17 ms 94876 KB Output is correct
21 Correct 18 ms 94872 KB Output is correct
22 Correct 18 ms 94800 KB Output is correct
23 Correct 18 ms 94800 KB Output is correct
24 Correct 17 ms 94800 KB Output is correct
25 Correct 21 ms 94864 KB Output is correct
26 Correct 19 ms 94800 KB Output is correct
27 Correct 25 ms 96080 KB Output is correct
28 Correct 37 ms 97176 KB Output is correct
29 Correct 35 ms 97424 KB Output is correct
30 Correct 58 ms 101084 KB Output is correct
31 Correct 55 ms 101056 KB Output is correct
32 Correct 54 ms 100288 KB Output is correct
33 Correct 81 ms 105148 KB Output is correct
34 Correct 22 ms 95568 KB Output is correct
35 Correct 122 ms 111796 KB Output is correct
36 Correct 29 ms 97104 KB Output is correct
37 Correct 28 ms 95560 KB Output is correct
38 Correct 25 ms 95472 KB Output is correct
39 Correct 27 ms 95312 KB Output is correct
40 Correct 29 ms 95616 KB Output is correct
41 Correct 30 ms 95568 KB Output is correct
42 Correct 26 ms 95568 KB Output is correct
43 Correct 31 ms 95560 KB Output is correct
44 Correct 25 ms 95568 KB Output is correct
45 Correct 25 ms 96080 KB Output is correct
46 Execution timed out 4116 ms 793176 KB Time limit exceeded
47 Halted 0 ms 0 KB -