Submission #1110268

# Submission time Handle Problem Language Result Execution time Memory
1110268 2024-11-09T03:57:39 Z vjudge1 Card Collection (JOI24_collection) C++17
11 / 100
84 ms 1136 KB
#include <bits/stdc++.h>
using namespace std;
#define rep(i, b, e) for(int i = (b); i <= (e); i++)
#define per(i, b, e) for(int i = (e); i >= (b); i--)
#define FOR(i, b, e) rep(i, b, (e) - 1)
#define SZ(x) int(x.size())
#define all(x) x.begin(), x.end()
#define pb push_back
#define mp make_pair
#define st first
#define nd second
using ll = long long;
using vi = vector<int>;
using pii = pair<int, int>;
 
auto &operator<<(auto &o, pair<auto, auto> p) {
	return o << "(" << p.st << ", " << p.nd << ")"; }
auto operator<<(auto &o, auto x)->decltype(end(x), o) {
	o << "{"; int i=0; for(auto e: x) o << ", " + 2*!i++ << e;
	return o << "}"; }
#ifdef LOCAL
#define deb(x...) cerr << "[" #x "]: ", [](auto...$) { \
	((cerr << $ << "; "),...) << endl; }(x)
#else
#define deb(...)
#endif
 
set<pair<int, int> > S[20][20];
 
void solve() {
	int n, m;
    cin>>n>>m;
    vector<pii> co(n);
    for(auto &[x,y]:co){
        cin>>x>>y;
    }
    for(int i=0; i<n; i++){
        S[i][i].insert(co[i]);
    }
    for(int d=1; d<n; d++){
        for(int i=0; i+d<n; i++){
            for(int j=i; j<i+d; j++){
                for(auto &[x, y] : S[i][j]){
                    for(auto &[x2, y2] : S[j+1][i+d]){
                        S[i][i+d].insert(mp(min(x, x2), min(y, y2)));
                        S[i][i+d].insert(mp(max(x, x2), max(y, y2)));
                    }
                }
            }
        }
    }
    for(int i=1; i<=m; i++){
        int x, y;
        cin>>x>>y;
        if(S[0][n-1].find(mp(x, y))!=S[0][n-1].end()){
            cout<<i<<" ";
        }
    }
    cout<<"\n";
}
 
int main() {
	cin.tie(0)->sync_with_stdio(0);
	int tt = 1;
	// cin >> tt;
	FOR(te, 0, tt) solve();
	return 0;
}

Compilation message

Main.cpp:16:18: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   16 | auto &operator<<(auto &o, pair<auto, auto> p) {
      |                  ^~~~
Main.cpp:16:32: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   16 | auto &operator<<(auto &o, pair<auto, auto> p) {
      |                                ^~~~
Main.cpp:16:38: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   16 | auto &operator<<(auto &o, pair<auto, auto> p) {
      |                                      ^~~~
Main.cpp:18:17: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   18 | auto operator<<(auto &o, auto x)->decltype(end(x), o) {
      |                 ^~~~
Main.cpp:18:26: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   18 | auto operator<<(auto &o, auto x)->decltype(end(x), o) {
      |                          ^~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 1 ms 512 KB Output is correct
6 Correct 1 ms 336 KB Output is correct
7 Correct 1 ms 336 KB Output is correct
8 Correct 1 ms 336 KB Output is correct
9 Correct 1 ms 336 KB Output is correct
10 Correct 1 ms 336 KB Output is correct
11 Correct 2 ms 336 KB Output is correct
12 Correct 1 ms 336 KB Output is correct
13 Correct 4 ms 564 KB Output is correct
14 Correct 4 ms 760 KB Output is correct
15 Correct 7 ms 592 KB Output is correct
16 Correct 8 ms 544 KB Output is correct
17 Correct 18 ms 592 KB Output is correct
18 Correct 19 ms 592 KB Output is correct
19 Correct 27 ms 592 KB Output is correct
20 Correct 1 ms 336 KB Output is correct
21 Correct 1 ms 336 KB Output is correct
22 Correct 1 ms 336 KB Output is correct
23 Correct 1 ms 336 KB Output is correct
24 Correct 1 ms 336 KB Output is correct
25 Correct 1 ms 504 KB Output is correct
26 Correct 1 ms 336 KB Output is correct
27 Correct 7 ms 556 KB Output is correct
28 Correct 11 ms 592 KB Output is correct
29 Correct 12 ms 700 KB Output is correct
30 Correct 32 ms 848 KB Output is correct
31 Correct 28 ms 712 KB Output is correct
32 Correct 27 ms 776 KB Output is correct
33 Correct 46 ms 848 KB Output is correct
34 Correct 2 ms 336 KB Output is correct
35 Correct 84 ms 1136 KB Output is correct
36 Correct 8 ms 592 KB Output is correct
37 Correct 2 ms 568 KB Output is correct
38 Correct 3 ms 336 KB Output is correct
39 Correct 2 ms 336 KB Output is correct
40 Correct 3 ms 336 KB Output is correct
41 Correct 2 ms 492 KB Output is correct
42 Correct 2 ms 336 KB Output is correct
43 Correct 2 ms 548 KB Output is correct
44 Correct 2 ms 336 KB Output is correct
45 Correct 4 ms 592 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 1 ms 512 KB Output is correct
6 Correct 1 ms 336 KB Output is correct
7 Correct 1 ms 336 KB Output is correct
8 Correct 1 ms 336 KB Output is correct
9 Correct 1 ms 336 KB Output is correct
10 Correct 1 ms 336 KB Output is correct
11 Correct 2 ms 336 KB Output is correct
12 Correct 1 ms 336 KB Output is correct
13 Correct 4 ms 564 KB Output is correct
14 Correct 4 ms 760 KB Output is correct
15 Correct 7 ms 592 KB Output is correct
16 Correct 8 ms 544 KB Output is correct
17 Correct 18 ms 592 KB Output is correct
18 Correct 19 ms 592 KB Output is correct
19 Correct 27 ms 592 KB Output is correct
20 Correct 1 ms 336 KB Output is correct
21 Correct 1 ms 336 KB Output is correct
22 Correct 1 ms 336 KB Output is correct
23 Correct 1 ms 336 KB Output is correct
24 Correct 1 ms 336 KB Output is correct
25 Correct 1 ms 504 KB Output is correct
26 Correct 1 ms 336 KB Output is correct
27 Correct 7 ms 556 KB Output is correct
28 Correct 11 ms 592 KB Output is correct
29 Correct 12 ms 700 KB Output is correct
30 Correct 32 ms 848 KB Output is correct
31 Correct 28 ms 712 KB Output is correct
32 Correct 27 ms 776 KB Output is correct
33 Correct 46 ms 848 KB Output is correct
34 Correct 2 ms 336 KB Output is correct
35 Correct 84 ms 1136 KB Output is correct
36 Correct 8 ms 592 KB Output is correct
37 Correct 2 ms 568 KB Output is correct
38 Correct 3 ms 336 KB Output is correct
39 Correct 2 ms 336 KB Output is correct
40 Correct 3 ms 336 KB Output is correct
41 Correct 2 ms 492 KB Output is correct
42 Correct 2 ms 336 KB Output is correct
43 Correct 2 ms 548 KB Output is correct
44 Correct 2 ms 336 KB Output is correct
45 Correct 4 ms 592 KB Output is correct
46 Runtime error 2 ms 592 KB Execution killed with signal 11
47 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 1 ms 512 KB Output is correct
6 Correct 1 ms 336 KB Output is correct
7 Correct 1 ms 336 KB Output is correct
8 Correct 1 ms 336 KB Output is correct
9 Correct 1 ms 336 KB Output is correct
10 Correct 1 ms 336 KB Output is correct
11 Correct 2 ms 336 KB Output is correct
12 Correct 1 ms 336 KB Output is correct
13 Correct 4 ms 564 KB Output is correct
14 Correct 4 ms 760 KB Output is correct
15 Correct 7 ms 592 KB Output is correct
16 Correct 8 ms 544 KB Output is correct
17 Correct 18 ms 592 KB Output is correct
18 Correct 19 ms 592 KB Output is correct
19 Correct 27 ms 592 KB Output is correct
20 Correct 1 ms 336 KB Output is correct
21 Correct 1 ms 336 KB Output is correct
22 Correct 1 ms 336 KB Output is correct
23 Correct 1 ms 336 KB Output is correct
24 Correct 1 ms 336 KB Output is correct
25 Correct 1 ms 504 KB Output is correct
26 Correct 1 ms 336 KB Output is correct
27 Correct 7 ms 556 KB Output is correct
28 Correct 11 ms 592 KB Output is correct
29 Correct 12 ms 700 KB Output is correct
30 Correct 32 ms 848 KB Output is correct
31 Correct 28 ms 712 KB Output is correct
32 Correct 27 ms 776 KB Output is correct
33 Correct 46 ms 848 KB Output is correct
34 Correct 2 ms 336 KB Output is correct
35 Correct 84 ms 1136 KB Output is correct
36 Correct 8 ms 592 KB Output is correct
37 Correct 2 ms 568 KB Output is correct
38 Correct 3 ms 336 KB Output is correct
39 Correct 2 ms 336 KB Output is correct
40 Correct 3 ms 336 KB Output is correct
41 Correct 2 ms 492 KB Output is correct
42 Correct 2 ms 336 KB Output is correct
43 Correct 2 ms 548 KB Output is correct
44 Correct 2 ms 336 KB Output is correct
45 Correct 4 ms 592 KB Output is correct
46 Runtime error 2 ms 592 KB Execution killed with signal 11
47 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 1 ms 512 KB Output is correct
6 Correct 1 ms 336 KB Output is correct
7 Correct 1 ms 336 KB Output is correct
8 Correct 1 ms 336 KB Output is correct
9 Correct 1 ms 336 KB Output is correct
10 Correct 1 ms 336 KB Output is correct
11 Correct 2 ms 336 KB Output is correct
12 Correct 1 ms 336 KB Output is correct
13 Correct 4 ms 564 KB Output is correct
14 Correct 4 ms 760 KB Output is correct
15 Correct 7 ms 592 KB Output is correct
16 Correct 8 ms 544 KB Output is correct
17 Correct 18 ms 592 KB Output is correct
18 Correct 19 ms 592 KB Output is correct
19 Correct 27 ms 592 KB Output is correct
20 Correct 1 ms 336 KB Output is correct
21 Correct 1 ms 336 KB Output is correct
22 Correct 1 ms 336 KB Output is correct
23 Correct 1 ms 336 KB Output is correct
24 Correct 1 ms 336 KB Output is correct
25 Correct 1 ms 504 KB Output is correct
26 Correct 1 ms 336 KB Output is correct
27 Correct 7 ms 556 KB Output is correct
28 Correct 11 ms 592 KB Output is correct
29 Correct 12 ms 700 KB Output is correct
30 Correct 32 ms 848 KB Output is correct
31 Correct 28 ms 712 KB Output is correct
32 Correct 27 ms 776 KB Output is correct
33 Correct 46 ms 848 KB Output is correct
34 Correct 2 ms 336 KB Output is correct
35 Correct 84 ms 1136 KB Output is correct
36 Correct 8 ms 592 KB Output is correct
37 Correct 2 ms 568 KB Output is correct
38 Correct 3 ms 336 KB Output is correct
39 Correct 2 ms 336 KB Output is correct
40 Correct 3 ms 336 KB Output is correct
41 Correct 2 ms 492 KB Output is correct
42 Correct 2 ms 336 KB Output is correct
43 Correct 2 ms 548 KB Output is correct
44 Correct 2 ms 336 KB Output is correct
45 Correct 4 ms 592 KB Output is correct
46 Runtime error 2 ms 592 KB Execution killed with signal 11
47 Halted 0 ms 0 KB -