#include<bits/stdc++.h>
#define INF 1e18
#define fi first
#define se second
#define FOR(i, k, n) for(ll i = k; i <= n; i++)
#define FOR1(i, k, n) for(ll i = k; i >= n; i--)
#define pb push_back
#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define vi vector<int>
#define pii pair<int, int>
#define vii vector<pii>
#define ll long long
#define vll vector<ll>
#define pll pair<ll, ll>
#define re return 0
#define mii map<int, int>
#define input "BESIEGE.inp"
#define output "BESIEGE.out"
#define rf freopen(input, "r", stdin); freopen(output, "w", stdout)
using namespace std;
const int maxn = 2e5 + 5;
const int mod = 1e9 + 7;
const int base = 998244353;
void add(int &a, int b)
{
a += b;
if(a >= mod) a -= mod;
if(a < 0) a += mod;
}
int n, m;
pii a[maxn], b[maxn];
vii dp[2005][2005];
set<pii> s;
int main()
{
fastio;
cin >> n >> m;
FOR(i, 1, n)
cin >> a[i].fi >> a[i].se;
FOR(i, 1, m)
cin >> b[i].fi >> b[i].se;
FOR1(l, n, 1)
{
dp[l][l].pb(a[l]);
FOR(r, l + 1, n)
{
s.clear();
FOR(k, l, r - 1)
{
for(auto x : dp[l][k])
for(auto t : dp[k + 1][r])
{
int u = min(x.fi, t.fi);
int v = min(x.se, t.se);
s.insert({u, v});
u = max(x.fi, t.fi);
v = max(x.se, t.se);
s.insert({u, v});
}
}
for(auto x : s)
dp[l][r].pb(x);
}
}
FOR(i, 1, m)
{
bool ok = 0;
for(auto x : dp[1][n])
if(x.fi == b[i].fi && x.se == b[i].se)
{
ok = 1;
break;
}
if(ok)
cout << i << " ";
}
re;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
18 ms |
96848 KB |
Output is correct |
2 |
Correct |
17 ms |
96848 KB |
Output is correct |
3 |
Correct |
20 ms |
97024 KB |
Output is correct |
4 |
Correct |
19 ms |
96848 KB |
Output is correct |
5 |
Correct |
18 ms |
96848 KB |
Output is correct |
6 |
Correct |
19 ms |
96848 KB |
Output is correct |
7 |
Correct |
18 ms |
96848 KB |
Output is correct |
8 |
Correct |
17 ms |
96848 KB |
Output is correct |
9 |
Correct |
18 ms |
96848 KB |
Output is correct |
10 |
Correct |
19 ms |
96848 KB |
Output is correct |
11 |
Correct |
17 ms |
96848 KB |
Output is correct |
12 |
Correct |
18 ms |
96848 KB |
Output is correct |
13 |
Correct |
20 ms |
97104 KB |
Output is correct |
14 |
Correct |
20 ms |
96948 KB |
Output is correct |
15 |
Correct |
21 ms |
97104 KB |
Output is correct |
16 |
Correct |
29 ms |
97104 KB |
Output is correct |
17 |
Correct |
34 ms |
97104 KB |
Output is correct |
18 |
Correct |
30 ms |
97104 KB |
Output is correct |
19 |
Correct |
37 ms |
97104 KB |
Output is correct |
20 |
Correct |
24 ms |
94800 KB |
Output is correct |
21 |
Correct |
24 ms |
94800 KB |
Output is correct |
22 |
Correct |
17 ms |
96848 KB |
Output is correct |
23 |
Correct |
25 ms |
94800 KB |
Output is correct |
24 |
Correct |
18 ms |
94800 KB |
Output is correct |
25 |
Correct |
18 ms |
94800 KB |
Output is correct |
26 |
Correct |
19 ms |
94800 KB |
Output is correct |
27 |
Correct |
24 ms |
94800 KB |
Output is correct |
28 |
Correct |
36 ms |
94784 KB |
Output is correct |
29 |
Correct |
29 ms |
94928 KB |
Output is correct |
30 |
Correct |
41 ms |
94960 KB |
Output is correct |
31 |
Correct |
49 ms |
94800 KB |
Output is correct |
32 |
Correct |
44 ms |
94792 KB |
Output is correct |
33 |
Correct |
69 ms |
94796 KB |
Output is correct |
34 |
Correct |
19 ms |
94800 KB |
Output is correct |
35 |
Correct |
82 ms |
95056 KB |
Output is correct |
36 |
Correct |
31 ms |
94800 KB |
Output is correct |
37 |
Correct |
27 ms |
94800 KB |
Output is correct |
38 |
Correct |
26 ms |
94800 KB |
Output is correct |
39 |
Correct |
28 ms |
94800 KB |
Output is correct |
40 |
Correct |
35 ms |
94812 KB |
Output is correct |
41 |
Correct |
35 ms |
94796 KB |
Output is correct |
42 |
Correct |
30 ms |
94792 KB |
Output is correct |
43 |
Correct |
26 ms |
94800 KB |
Output is correct |
44 |
Correct |
34 ms |
94820 KB |
Output is correct |
45 |
Correct |
31 ms |
94792 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
18 ms |
96848 KB |
Output is correct |
2 |
Correct |
17 ms |
96848 KB |
Output is correct |
3 |
Correct |
20 ms |
97024 KB |
Output is correct |
4 |
Correct |
19 ms |
96848 KB |
Output is correct |
5 |
Correct |
18 ms |
96848 KB |
Output is correct |
6 |
Correct |
19 ms |
96848 KB |
Output is correct |
7 |
Correct |
18 ms |
96848 KB |
Output is correct |
8 |
Correct |
17 ms |
96848 KB |
Output is correct |
9 |
Correct |
18 ms |
96848 KB |
Output is correct |
10 |
Correct |
19 ms |
96848 KB |
Output is correct |
11 |
Correct |
17 ms |
96848 KB |
Output is correct |
12 |
Correct |
18 ms |
96848 KB |
Output is correct |
13 |
Correct |
20 ms |
97104 KB |
Output is correct |
14 |
Correct |
20 ms |
96948 KB |
Output is correct |
15 |
Correct |
21 ms |
97104 KB |
Output is correct |
16 |
Correct |
29 ms |
97104 KB |
Output is correct |
17 |
Correct |
34 ms |
97104 KB |
Output is correct |
18 |
Correct |
30 ms |
97104 KB |
Output is correct |
19 |
Correct |
37 ms |
97104 KB |
Output is correct |
20 |
Correct |
24 ms |
94800 KB |
Output is correct |
21 |
Correct |
24 ms |
94800 KB |
Output is correct |
22 |
Correct |
17 ms |
96848 KB |
Output is correct |
23 |
Correct |
25 ms |
94800 KB |
Output is correct |
24 |
Correct |
18 ms |
94800 KB |
Output is correct |
25 |
Correct |
18 ms |
94800 KB |
Output is correct |
26 |
Correct |
19 ms |
94800 KB |
Output is correct |
27 |
Correct |
24 ms |
94800 KB |
Output is correct |
28 |
Correct |
36 ms |
94784 KB |
Output is correct |
29 |
Correct |
29 ms |
94928 KB |
Output is correct |
30 |
Correct |
41 ms |
94960 KB |
Output is correct |
31 |
Correct |
49 ms |
94800 KB |
Output is correct |
32 |
Correct |
44 ms |
94792 KB |
Output is correct |
33 |
Correct |
69 ms |
94796 KB |
Output is correct |
34 |
Correct |
19 ms |
94800 KB |
Output is correct |
35 |
Correct |
82 ms |
95056 KB |
Output is correct |
36 |
Correct |
31 ms |
94800 KB |
Output is correct |
37 |
Correct |
27 ms |
94800 KB |
Output is correct |
38 |
Correct |
26 ms |
94800 KB |
Output is correct |
39 |
Correct |
28 ms |
94800 KB |
Output is correct |
40 |
Correct |
35 ms |
94812 KB |
Output is correct |
41 |
Correct |
35 ms |
94796 KB |
Output is correct |
42 |
Correct |
30 ms |
94792 KB |
Output is correct |
43 |
Correct |
26 ms |
94800 KB |
Output is correct |
44 |
Correct |
34 ms |
94820 KB |
Output is correct |
45 |
Correct |
31 ms |
94792 KB |
Output is correct |
46 |
Execution timed out |
4070 ms |
96640 KB |
Time limit exceeded |
47 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
18 ms |
96848 KB |
Output is correct |
2 |
Correct |
17 ms |
96848 KB |
Output is correct |
3 |
Correct |
20 ms |
97024 KB |
Output is correct |
4 |
Correct |
19 ms |
96848 KB |
Output is correct |
5 |
Correct |
18 ms |
96848 KB |
Output is correct |
6 |
Correct |
19 ms |
96848 KB |
Output is correct |
7 |
Correct |
18 ms |
96848 KB |
Output is correct |
8 |
Correct |
17 ms |
96848 KB |
Output is correct |
9 |
Correct |
18 ms |
96848 KB |
Output is correct |
10 |
Correct |
19 ms |
96848 KB |
Output is correct |
11 |
Correct |
17 ms |
96848 KB |
Output is correct |
12 |
Correct |
18 ms |
96848 KB |
Output is correct |
13 |
Correct |
20 ms |
97104 KB |
Output is correct |
14 |
Correct |
20 ms |
96948 KB |
Output is correct |
15 |
Correct |
21 ms |
97104 KB |
Output is correct |
16 |
Correct |
29 ms |
97104 KB |
Output is correct |
17 |
Correct |
34 ms |
97104 KB |
Output is correct |
18 |
Correct |
30 ms |
97104 KB |
Output is correct |
19 |
Correct |
37 ms |
97104 KB |
Output is correct |
20 |
Correct |
24 ms |
94800 KB |
Output is correct |
21 |
Correct |
24 ms |
94800 KB |
Output is correct |
22 |
Correct |
17 ms |
96848 KB |
Output is correct |
23 |
Correct |
25 ms |
94800 KB |
Output is correct |
24 |
Correct |
18 ms |
94800 KB |
Output is correct |
25 |
Correct |
18 ms |
94800 KB |
Output is correct |
26 |
Correct |
19 ms |
94800 KB |
Output is correct |
27 |
Correct |
24 ms |
94800 KB |
Output is correct |
28 |
Correct |
36 ms |
94784 KB |
Output is correct |
29 |
Correct |
29 ms |
94928 KB |
Output is correct |
30 |
Correct |
41 ms |
94960 KB |
Output is correct |
31 |
Correct |
49 ms |
94800 KB |
Output is correct |
32 |
Correct |
44 ms |
94792 KB |
Output is correct |
33 |
Correct |
69 ms |
94796 KB |
Output is correct |
34 |
Correct |
19 ms |
94800 KB |
Output is correct |
35 |
Correct |
82 ms |
95056 KB |
Output is correct |
36 |
Correct |
31 ms |
94800 KB |
Output is correct |
37 |
Correct |
27 ms |
94800 KB |
Output is correct |
38 |
Correct |
26 ms |
94800 KB |
Output is correct |
39 |
Correct |
28 ms |
94800 KB |
Output is correct |
40 |
Correct |
35 ms |
94812 KB |
Output is correct |
41 |
Correct |
35 ms |
94796 KB |
Output is correct |
42 |
Correct |
30 ms |
94792 KB |
Output is correct |
43 |
Correct |
26 ms |
94800 KB |
Output is correct |
44 |
Correct |
34 ms |
94820 KB |
Output is correct |
45 |
Correct |
31 ms |
94792 KB |
Output is correct |
46 |
Execution timed out |
4070 ms |
96640 KB |
Time limit exceeded |
47 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
18 ms |
96848 KB |
Output is correct |
2 |
Correct |
17 ms |
96848 KB |
Output is correct |
3 |
Correct |
20 ms |
97024 KB |
Output is correct |
4 |
Correct |
19 ms |
96848 KB |
Output is correct |
5 |
Correct |
18 ms |
96848 KB |
Output is correct |
6 |
Correct |
19 ms |
96848 KB |
Output is correct |
7 |
Correct |
18 ms |
96848 KB |
Output is correct |
8 |
Correct |
17 ms |
96848 KB |
Output is correct |
9 |
Correct |
18 ms |
96848 KB |
Output is correct |
10 |
Correct |
19 ms |
96848 KB |
Output is correct |
11 |
Correct |
17 ms |
96848 KB |
Output is correct |
12 |
Correct |
18 ms |
96848 KB |
Output is correct |
13 |
Correct |
20 ms |
97104 KB |
Output is correct |
14 |
Correct |
20 ms |
96948 KB |
Output is correct |
15 |
Correct |
21 ms |
97104 KB |
Output is correct |
16 |
Correct |
29 ms |
97104 KB |
Output is correct |
17 |
Correct |
34 ms |
97104 KB |
Output is correct |
18 |
Correct |
30 ms |
97104 KB |
Output is correct |
19 |
Correct |
37 ms |
97104 KB |
Output is correct |
20 |
Correct |
24 ms |
94800 KB |
Output is correct |
21 |
Correct |
24 ms |
94800 KB |
Output is correct |
22 |
Correct |
17 ms |
96848 KB |
Output is correct |
23 |
Correct |
25 ms |
94800 KB |
Output is correct |
24 |
Correct |
18 ms |
94800 KB |
Output is correct |
25 |
Correct |
18 ms |
94800 KB |
Output is correct |
26 |
Correct |
19 ms |
94800 KB |
Output is correct |
27 |
Correct |
24 ms |
94800 KB |
Output is correct |
28 |
Correct |
36 ms |
94784 KB |
Output is correct |
29 |
Correct |
29 ms |
94928 KB |
Output is correct |
30 |
Correct |
41 ms |
94960 KB |
Output is correct |
31 |
Correct |
49 ms |
94800 KB |
Output is correct |
32 |
Correct |
44 ms |
94792 KB |
Output is correct |
33 |
Correct |
69 ms |
94796 KB |
Output is correct |
34 |
Correct |
19 ms |
94800 KB |
Output is correct |
35 |
Correct |
82 ms |
95056 KB |
Output is correct |
36 |
Correct |
31 ms |
94800 KB |
Output is correct |
37 |
Correct |
27 ms |
94800 KB |
Output is correct |
38 |
Correct |
26 ms |
94800 KB |
Output is correct |
39 |
Correct |
28 ms |
94800 KB |
Output is correct |
40 |
Correct |
35 ms |
94812 KB |
Output is correct |
41 |
Correct |
35 ms |
94796 KB |
Output is correct |
42 |
Correct |
30 ms |
94792 KB |
Output is correct |
43 |
Correct |
26 ms |
94800 KB |
Output is correct |
44 |
Correct |
34 ms |
94820 KB |
Output is correct |
45 |
Correct |
31 ms |
94792 KB |
Output is correct |
46 |
Execution timed out |
4070 ms |
96640 KB |
Time limit exceeded |
47 |
Halted |
0 ms |
0 KB |
- |