Submission #877472

# Submission time Handle Problem Language Result Execution time Memory
877472 2023-11-23T09:11:46 Z vjudge1 Art Collections (BOI22_art) C++17
35 / 100
153 ms 63388 KB
#include "art.h"
#include <bits/stdc++.h>

using namespace std;

//#define int long long

#define pb push_back
#define mp make_pair
#define mt make_tuple
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

using ll = long long;
using ld = long double;
 
const int mxn = 4005;


int c[mxn][mxn];
int n;
bool comp(int a,int b){
    if(c[a][b] != -1)return c[a][b];
    vector<int> v1,v2;
    v2.pb(b);
    v2.pb(a);
    v1.pb(a);
    v1.pb(b);

    for(int i = 1;i<=n;i++){
        if(i !=  a&& i != b){
            v1.pb(i);
            v2.pb(i);
        }
    }

    return c[a][b] = (publish(v1) < publish(v2));
}

void solve(int _n) {
    memset(c, -1, sizeof c);
    n = _n;
    vector<int> v;
    for(int i = 1;i<=n;i++)v.pb(i);
    stable_sort(all(v), comp);

    answer(v);

}

Compilation message

art.cpp: In function 'bool comp(int, int)':
art.cpp:37:20: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   37 |     return c[a][b] = (publish(v1) < publish(v2));
      |            ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
interface.cpp: In function 'int publish(std::vector<int>)':
interface.cpp:20:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   20 |     if(v.size() != N) {
      |        ~~~~~~~~~^~~~
interface.cpp: In function 'void answer(std::vector<int>)':
interface.cpp:36:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   36 |     if(v.size() != N) {
      |        ~~~~~~~~~^~~~
# Verdict Execution time Memory Grader output
1 Correct 12 ms 63064 KB Output is correct
2 Correct 8 ms 63064 KB Output is correct
3 Correct 8 ms 63064 KB Output is correct
4 Correct 8 ms 63064 KB Output is correct
5 Correct 8 ms 63064 KB Output is correct
6 Correct 8 ms 63148 KB Output is correct
7 Correct 8 ms 63064 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 12 ms 63064 KB Output is correct
2 Correct 8 ms 63064 KB Output is correct
3 Correct 8 ms 63064 KB Output is correct
4 Correct 8 ms 63064 KB Output is correct
5 Correct 8 ms 63064 KB Output is correct
6 Correct 8 ms 63148 KB Output is correct
7 Correct 8 ms 63064 KB Output is correct
8 Correct 8 ms 63060 KB Output is correct
9 Correct 12 ms 63320 KB Output is correct
10 Correct 10 ms 63064 KB Output is correct
11 Correct 10 ms 63152 KB Output is correct
12 Correct 10 ms 63064 KB Output is correct
13 Correct 7 ms 63064 KB Output is correct
14 Correct 8 ms 63064 KB Output is correct
15 Correct 8 ms 63076 KB Output is correct
16 Correct 8 ms 63172 KB Output is correct
17 Correct 8 ms 63128 KB Output is correct
18 Correct 8 ms 63064 KB Output is correct
19 Correct 10 ms 63320 KB Output is correct
20 Correct 9 ms 63064 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 12 ms 63064 KB Output is correct
2 Correct 8 ms 63064 KB Output is correct
3 Correct 8 ms 63064 KB Output is correct
4 Correct 8 ms 63064 KB Output is correct
5 Correct 8 ms 63064 KB Output is correct
6 Correct 8 ms 63148 KB Output is correct
7 Correct 8 ms 63064 KB Output is correct
8 Correct 8 ms 63060 KB Output is correct
9 Correct 12 ms 63320 KB Output is correct
10 Correct 10 ms 63064 KB Output is correct
11 Correct 10 ms 63152 KB Output is correct
12 Correct 10 ms 63064 KB Output is correct
13 Correct 7 ms 63064 KB Output is correct
14 Correct 8 ms 63064 KB Output is correct
15 Correct 8 ms 63076 KB Output is correct
16 Correct 8 ms 63172 KB Output is correct
17 Correct 8 ms 63128 KB Output is correct
18 Correct 8 ms 63064 KB Output is correct
19 Correct 10 ms 63320 KB Output is correct
20 Correct 9 ms 63064 KB Output is correct
21 Correct 8 ms 63084 KB Output is correct
22 Correct 10 ms 63064 KB Output is correct
23 Correct 10 ms 63064 KB Output is correct
24 Correct 10 ms 63064 KB Output is correct
25 Correct 10 ms 63064 KB Output is correct
26 Correct 60 ms 63064 KB Output is correct
27 Correct 43 ms 63064 KB Output is correct
28 Correct 88 ms 63064 KB Output is correct
29 Correct 89 ms 63064 KB Output is correct
30 Correct 88 ms 63064 KB Output is correct
31 Correct 88 ms 63064 KB Output is correct
32 Correct 8 ms 63064 KB Output is correct
33 Correct 7 ms 63064 KB Output is correct
34 Correct 8 ms 63064 KB Output is correct
35 Correct 8 ms 63064 KB Output is correct
36 Correct 8 ms 63064 KB Output is correct
37 Correct 8 ms 63128 KB Output is correct
38 Correct 9 ms 63064 KB Output is correct
39 Correct 9 ms 63172 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 12 ms 63064 KB Output is correct
2 Correct 8 ms 63064 KB Output is correct
3 Correct 8 ms 63064 KB Output is correct
4 Correct 8 ms 63064 KB Output is correct
5 Correct 8 ms 63064 KB Output is correct
6 Correct 8 ms 63148 KB Output is correct
7 Correct 8 ms 63064 KB Output is correct
8 Correct 8 ms 63060 KB Output is correct
9 Correct 12 ms 63320 KB Output is correct
10 Correct 10 ms 63064 KB Output is correct
11 Correct 10 ms 63152 KB Output is correct
12 Correct 10 ms 63064 KB Output is correct
13 Correct 7 ms 63064 KB Output is correct
14 Correct 8 ms 63064 KB Output is correct
15 Correct 8 ms 63076 KB Output is correct
16 Correct 8 ms 63172 KB Output is correct
17 Correct 8 ms 63128 KB Output is correct
18 Correct 8 ms 63064 KB Output is correct
19 Correct 10 ms 63320 KB Output is correct
20 Correct 9 ms 63064 KB Output is correct
21 Correct 8 ms 63084 KB Output is correct
22 Correct 10 ms 63064 KB Output is correct
23 Correct 10 ms 63064 KB Output is correct
24 Correct 10 ms 63064 KB Output is correct
25 Correct 10 ms 63064 KB Output is correct
26 Correct 60 ms 63064 KB Output is correct
27 Correct 43 ms 63064 KB Output is correct
28 Correct 88 ms 63064 KB Output is correct
29 Correct 89 ms 63064 KB Output is correct
30 Correct 88 ms 63064 KB Output is correct
31 Correct 88 ms 63064 KB Output is correct
32 Correct 8 ms 63064 KB Output is correct
33 Correct 7 ms 63064 KB Output is correct
34 Correct 8 ms 63064 KB Output is correct
35 Correct 8 ms 63064 KB Output is correct
36 Correct 8 ms 63064 KB Output is correct
37 Correct 8 ms 63128 KB Output is correct
38 Correct 9 ms 63064 KB Output is correct
39 Correct 9 ms 63172 KB Output is correct
40 Correct 8 ms 63388 KB Output is correct
41 Correct 10 ms 63064 KB Output is correct
42 Correct 10 ms 63108 KB Output is correct
43 Correct 11 ms 63064 KB Output is correct
44 Correct 11 ms 63096 KB Output is correct
45 Correct 59 ms 63112 KB Output is correct
46 Correct 43 ms 63064 KB Output is correct
47 Correct 90 ms 63064 KB Output is correct
48 Correct 90 ms 63064 KB Output is correct
49 Correct 90 ms 63064 KB Output is correct
50 Correct 88 ms 63064 KB Output is correct
51 Correct 8 ms 63064 KB Output is correct
52 Incorrect 153 ms 63232 KB Not correct
53 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 12 ms 63064 KB Output is correct
2 Correct 8 ms 63064 KB Output is correct
3 Correct 8 ms 63064 KB Output is correct
4 Correct 8 ms 63064 KB Output is correct
5 Correct 8 ms 63064 KB Output is correct
6 Correct 8 ms 63148 KB Output is correct
7 Correct 8 ms 63064 KB Output is correct
8 Correct 8 ms 63060 KB Output is correct
9 Correct 12 ms 63320 KB Output is correct
10 Correct 10 ms 63064 KB Output is correct
11 Correct 10 ms 63152 KB Output is correct
12 Correct 10 ms 63064 KB Output is correct
13 Correct 7 ms 63064 KB Output is correct
14 Correct 8 ms 63064 KB Output is correct
15 Correct 8 ms 63076 KB Output is correct
16 Correct 8 ms 63172 KB Output is correct
17 Correct 8 ms 63128 KB Output is correct
18 Correct 8 ms 63064 KB Output is correct
19 Correct 10 ms 63320 KB Output is correct
20 Correct 9 ms 63064 KB Output is correct
21 Correct 8 ms 63084 KB Output is correct
22 Correct 10 ms 63064 KB Output is correct
23 Correct 10 ms 63064 KB Output is correct
24 Correct 10 ms 63064 KB Output is correct
25 Correct 10 ms 63064 KB Output is correct
26 Correct 60 ms 63064 KB Output is correct
27 Correct 43 ms 63064 KB Output is correct
28 Correct 88 ms 63064 KB Output is correct
29 Correct 89 ms 63064 KB Output is correct
30 Correct 88 ms 63064 KB Output is correct
31 Correct 88 ms 63064 KB Output is correct
32 Correct 8 ms 63064 KB Output is correct
33 Correct 7 ms 63064 KB Output is correct
34 Correct 8 ms 63064 KB Output is correct
35 Correct 8 ms 63064 KB Output is correct
36 Correct 8 ms 63064 KB Output is correct
37 Correct 8 ms 63128 KB Output is correct
38 Correct 9 ms 63064 KB Output is correct
39 Correct 9 ms 63172 KB Output is correct
40 Correct 8 ms 63388 KB Output is correct
41 Correct 10 ms 63064 KB Output is correct
42 Correct 10 ms 63108 KB Output is correct
43 Correct 11 ms 63064 KB Output is correct
44 Correct 11 ms 63096 KB Output is correct
45 Correct 59 ms 63112 KB Output is correct
46 Correct 43 ms 63064 KB Output is correct
47 Correct 90 ms 63064 KB Output is correct
48 Correct 90 ms 63064 KB Output is correct
49 Correct 90 ms 63064 KB Output is correct
50 Correct 88 ms 63064 KB Output is correct
51 Correct 8 ms 63064 KB Output is correct
52 Incorrect 153 ms 63232 KB Not correct
53 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 12 ms 63064 KB Output is correct
2 Correct 8 ms 63064 KB Output is correct
3 Correct 8 ms 63064 KB Output is correct
4 Correct 8 ms 63064 KB Output is correct
5 Correct 8 ms 63064 KB Output is correct
6 Correct 8 ms 63148 KB Output is correct
7 Correct 8 ms 63064 KB Output is correct
8 Correct 8 ms 63060 KB Output is correct
9 Correct 12 ms 63320 KB Output is correct
10 Correct 10 ms 63064 KB Output is correct
11 Correct 10 ms 63152 KB Output is correct
12 Correct 10 ms 63064 KB Output is correct
13 Correct 7 ms 63064 KB Output is correct
14 Correct 8 ms 63064 KB Output is correct
15 Correct 8 ms 63076 KB Output is correct
16 Correct 8 ms 63172 KB Output is correct
17 Correct 8 ms 63128 KB Output is correct
18 Correct 8 ms 63064 KB Output is correct
19 Correct 10 ms 63320 KB Output is correct
20 Correct 9 ms 63064 KB Output is correct
21 Correct 8 ms 63084 KB Output is correct
22 Correct 10 ms 63064 KB Output is correct
23 Correct 10 ms 63064 KB Output is correct
24 Correct 10 ms 63064 KB Output is correct
25 Correct 10 ms 63064 KB Output is correct
26 Correct 60 ms 63064 KB Output is correct
27 Correct 43 ms 63064 KB Output is correct
28 Correct 88 ms 63064 KB Output is correct
29 Correct 89 ms 63064 KB Output is correct
30 Correct 88 ms 63064 KB Output is correct
31 Correct 88 ms 63064 KB Output is correct
32 Correct 8 ms 63064 KB Output is correct
33 Correct 7 ms 63064 KB Output is correct
34 Correct 8 ms 63064 KB Output is correct
35 Correct 8 ms 63064 KB Output is correct
36 Correct 8 ms 63064 KB Output is correct
37 Correct 8 ms 63128 KB Output is correct
38 Correct 9 ms 63064 KB Output is correct
39 Correct 9 ms 63172 KB Output is correct
40 Correct 8 ms 63388 KB Output is correct
41 Correct 10 ms 63064 KB Output is correct
42 Correct 10 ms 63108 KB Output is correct
43 Correct 11 ms 63064 KB Output is correct
44 Correct 11 ms 63096 KB Output is correct
45 Correct 59 ms 63112 KB Output is correct
46 Correct 43 ms 63064 KB Output is correct
47 Correct 90 ms 63064 KB Output is correct
48 Correct 90 ms 63064 KB Output is correct
49 Correct 90 ms 63064 KB Output is correct
50 Correct 88 ms 63064 KB Output is correct
51 Correct 8 ms 63064 KB Output is correct
52 Incorrect 153 ms 63232 KB Not correct
53 Halted 0 ms 0 KB -