# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
696780 | 2023-02-07T08:51:31 Z | vjudge1 | Amusement Park (CEOI19_amusementpark) | C++17 | 2377 ms | 3720 KB |
#include<bits/stdc++.h> using namespace std; const int N=18,mod=998244353,inv2=499122177; int n,m,a[500],b[500],coef[1<<N],dp[1<<N],d[1<<N]; int main(){ scanf("%d%d",&n,&m); dp[0]=1; coef[0]=mod-1; for(int i=1;i<1<<n;i++)coef[i]=mod-coef[i&(i-1)]; for(int i=1;i<=m;i++)scanf("%d%d",&a[i],&b[i]),a[i]--,b[i]--; for(int i=1;i<1<<n;i++){ for(int o=1;o<=m;o++){ if((i>>a[o]&1)&&(i>>b[o]&1))d[i]=1; } } for(int i=1;i<1<<n;i++){ for(int o=i;o;o=((o-1)&i)){ if(!d[o])dp[i]=(dp[i]+1ll*dp[i^o]*coef[o])%mod; } } printf("%lld\n",1ll*dp[(1<<n)-1]*m%mod*inv2%mod); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 212 KB | Output is correct |
5 | Correct | 0 ms | 212 KB | Output is correct |
6 | Correct | 0 ms | 212 KB | Output is correct |
7 | Correct | 0 ms | 212 KB | Output is correct |
8 | Correct | 0 ms | 212 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 212 KB | Output is correct |
5 | Correct | 0 ms | 212 KB | Output is correct |
6 | Correct | 0 ms | 212 KB | Output is correct |
7 | Correct | 0 ms | 212 KB | Output is correct |
8 | Correct | 0 ms | 212 KB | Output is correct |
9 | Correct | 0 ms | 212 KB | Output is correct |
10 | Correct | 0 ms | 212 KB | Output is correct |
11 | Correct | 0 ms | 212 KB | Output is correct |
12 | Correct | 0 ms | 212 KB | Output is correct |
13 | Correct | 0 ms | 212 KB | Output is correct |
14 | Correct | 0 ms | 212 KB | Output is correct |
15 | Correct | 0 ms | 212 KB | Output is correct |
16 | Correct | 0 ms | 212 KB | Output is correct |
17 | Correct | 0 ms | 212 KB | Output is correct |
18 | Correct | 0 ms | 212 KB | Output is correct |
19 | Correct | 0 ms | 212 KB | Output is correct |
20 | Correct | 0 ms | 212 KB | Output is correct |
21 | Correct | 1 ms | 212 KB | Output is correct |
22 | Correct | 0 ms | 212 KB | Output is correct |
23 | Correct | 0 ms | 212 KB | Output is correct |
24 | Correct | 0 ms | 212 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 212 KB | Output is correct |
5 | Correct | 0 ms | 212 KB | Output is correct |
6 | Correct | 0 ms | 212 KB | Output is correct |
7 | Correct | 0 ms | 212 KB | Output is correct |
8 | Correct | 0 ms | 212 KB | Output is correct |
9 | Correct | 0 ms | 212 KB | Output is correct |
10 | Correct | 0 ms | 212 KB | Output is correct |
11 | Correct | 0 ms | 212 KB | Output is correct |
12 | Correct | 0 ms | 212 KB | Output is correct |
13 | Correct | 0 ms | 212 KB | Output is correct |
14 | Correct | 0 ms | 212 KB | Output is correct |
15 | Correct | 0 ms | 212 KB | Output is correct |
16 | Correct | 0 ms | 212 KB | Output is correct |
17 | Correct | 0 ms | 212 KB | Output is correct |
18 | Correct | 0 ms | 212 KB | Output is correct |
19 | Correct | 0 ms | 212 KB | Output is correct |
20 | Correct | 0 ms | 212 KB | Output is correct |
21 | Correct | 1 ms | 212 KB | Output is correct |
22 | Correct | 0 ms | 212 KB | Output is correct |
23 | Correct | 0 ms | 212 KB | Output is correct |
24 | Correct | 0 ms | 212 KB | Output is correct |
25 | Correct | 1 ms | 260 KB | Output is correct |
26 | Correct | 0 ms | 212 KB | Output is correct |
27 | Correct | 0 ms | 212 KB | Output is correct |
28 | Correct | 0 ms | 212 KB | Output is correct |
29 | Correct | 0 ms | 212 KB | Output is correct |
30 | Correct | 1 ms | 212 KB | Output is correct |
31 | Correct | 0 ms | 212 KB | Output is correct |
32 | Correct | 0 ms | 212 KB | Output is correct |
33 | Correct | 0 ms | 212 KB | Output is correct |
34 | Correct | 1 ms | 212 KB | Output is correct |
35 | Correct | 0 ms | 212 KB | Output is correct |
36 | Correct | 0 ms | 212 KB | Output is correct |
37 | Correct | 0 ms | 212 KB | Output is correct |
38 | Correct | 1 ms | 212 KB | Output is correct |
39 | Correct | 1 ms | 212 KB | Output is correct |
40 | Correct | 0 ms | 212 KB | Output is correct |
41 | Correct | 0 ms | 212 KB | Output is correct |
42 | Correct | 0 ms | 212 KB | Output is correct |
43 | Correct | 0 ms | 212 KB | Output is correct |
44 | Correct | 1 ms | 212 KB | Output is correct |
45 | Correct | 1 ms | 212 KB | Output is correct |
46 | Correct | 1 ms | 212 KB | Output is correct |
47 | Correct | 1 ms | 212 KB | Output is correct |
48 | Correct | 0 ms | 212 KB | Output is correct |
49 | Correct | 1 ms | 212 KB | Output is correct |
50 | Correct | 0 ms | 212 KB | Output is correct |
51 | Correct | 0 ms | 212 KB | Output is correct |
52 | Correct | 1 ms | 212 KB | Output is correct |
53 | Correct | 1 ms | 212 KB | Output is correct |
54 | Correct | 1 ms | 312 KB | Output is correct |
55 | Correct | 1 ms | 212 KB | Output is correct |
56 | Correct | 1 ms | 212 KB | Output is correct |
57 | Correct | 1 ms | 212 KB | Output is correct |
58 | Correct | 1 ms | 212 KB | Output is correct |
59 | Correct | 1 ms | 212 KB | Output is correct |
60 | Correct | 1 ms | 212 KB | Output is correct |
61 | Correct | 1 ms | 212 KB | Output is correct |
62 | Correct | 1 ms | 340 KB | Output is correct |
63 | Correct | 1 ms | 212 KB | Output is correct |
64 | Correct | 1 ms | 212 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 212 KB | Output is correct |
5 | Correct | 0 ms | 212 KB | Output is correct |
6 | Correct | 0 ms | 212 KB | Output is correct |
7 | Correct | 0 ms | 212 KB | Output is correct |
8 | Correct | 0 ms | 212 KB | Output is correct |
9 | Correct | 0 ms | 212 KB | Output is correct |
10 | Correct | 0 ms | 212 KB | Output is correct |
11 | Correct | 0 ms | 212 KB | Output is correct |
12 | Correct | 0 ms | 212 KB | Output is correct |
13 | Correct | 0 ms | 212 KB | Output is correct |
14 | Correct | 0 ms | 212 KB | Output is correct |
15 | Correct | 0 ms | 212 KB | Output is correct |
16 | Correct | 0 ms | 212 KB | Output is correct |
17 | Correct | 0 ms | 212 KB | Output is correct |
18 | Correct | 0 ms | 212 KB | Output is correct |
19 | Correct | 0 ms | 212 KB | Output is correct |
20 | Correct | 0 ms | 212 KB | Output is correct |
21 | Correct | 1 ms | 212 KB | Output is correct |
22 | Correct | 0 ms | 212 KB | Output is correct |
23 | Correct | 0 ms | 212 KB | Output is correct |
24 | Correct | 0 ms | 212 KB | Output is correct |
25 | Correct | 1 ms | 260 KB | Output is correct |
26 | Correct | 0 ms | 212 KB | Output is correct |
27 | Correct | 0 ms | 212 KB | Output is correct |
28 | Correct | 0 ms | 212 KB | Output is correct |
29 | Correct | 0 ms | 212 KB | Output is correct |
30 | Correct | 1 ms | 212 KB | Output is correct |
31 | Correct | 0 ms | 212 KB | Output is correct |
32 | Correct | 0 ms | 212 KB | Output is correct |
33 | Correct | 0 ms | 212 KB | Output is correct |
34 | Correct | 1 ms | 212 KB | Output is correct |
35 | Correct | 0 ms | 212 KB | Output is correct |
36 | Correct | 0 ms | 212 KB | Output is correct |
37 | Correct | 0 ms | 212 KB | Output is correct |
38 | Correct | 1 ms | 212 KB | Output is correct |
39 | Correct | 1 ms | 212 KB | Output is correct |
40 | Correct | 0 ms | 212 KB | Output is correct |
41 | Correct | 0 ms | 212 KB | Output is correct |
42 | Correct | 0 ms | 212 KB | Output is correct |
43 | Correct | 0 ms | 212 KB | Output is correct |
44 | Correct | 1 ms | 212 KB | Output is correct |
45 | Correct | 1 ms | 212 KB | Output is correct |
46 | Correct | 1 ms | 212 KB | Output is correct |
47 | Correct | 1 ms | 212 KB | Output is correct |
48 | Correct | 0 ms | 212 KB | Output is correct |
49 | Correct | 1 ms | 212 KB | Output is correct |
50 | Correct | 0 ms | 212 KB | Output is correct |
51 | Correct | 0 ms | 212 KB | Output is correct |
52 | Correct | 1 ms | 212 KB | Output is correct |
53 | Correct | 1 ms | 212 KB | Output is correct |
54 | Correct | 1 ms | 312 KB | Output is correct |
55 | Correct | 1 ms | 212 KB | Output is correct |
56 | Correct | 1 ms | 212 KB | Output is correct |
57 | Correct | 1 ms | 212 KB | Output is correct |
58 | Correct | 1 ms | 212 KB | Output is correct |
59 | Correct | 1 ms | 212 KB | Output is correct |
60 | Correct | 1 ms | 212 KB | Output is correct |
61 | Correct | 1 ms | 212 KB | Output is correct |
62 | Correct | 1 ms | 340 KB | Output is correct |
63 | Correct | 1 ms | 212 KB | Output is correct |
64 | Correct | 1 ms | 212 KB | Output is correct |
65 | Correct | 12 ms | 476 KB | Output is correct |
66 | Correct | 12 ms | 468 KB | Output is correct |
67 | Correct | 12 ms | 468 KB | Output is correct |
68 | Correct | 12 ms | 460 KB | Output is correct |
69 | Correct | 21 ms | 468 KB | Output is correct |
70 | Correct | 15 ms | 500 KB | Output is correct |
71 | Correct | 17 ms | 508 KB | Output is correct |
72 | Correct | 20 ms | 468 KB | Output is correct |
73 | Correct | 12 ms | 468 KB | Output is correct |
74 | Correct | 13 ms | 500 KB | Output is correct |
75 | Correct | 13 ms | 468 KB | Output is correct |
76 | Correct | 15 ms | 476 KB | Output is correct |
77 | Correct | 33 ms | 596 KB | Output is correct |
78 | Correct | 32 ms | 820 KB | Output is correct |
79 | Correct | 32 ms | 636 KB | Output is correct |
80 | Correct | 30 ms | 672 KB | Output is correct |
81 | Correct | 32 ms | 704 KB | Output is correct |
82 | Correct | 30 ms | 676 KB | Output is correct |
83 | Correct | 32 ms | 644 KB | Output is correct |
84 | Correct | 31 ms | 692 KB | Output is correct |
85 | Correct | 63 ms | 656 KB | Output is correct |
86 | Correct | 43 ms | 632 KB | Output is correct |
87 | Correct | 47 ms | 652 KB | Output is correct |
88 | Correct | 50 ms | 572 KB | Output is correct |
89 | Correct | 35 ms | 680 KB | Output is correct |
90 | Correct | 36 ms | 656 KB | Output is correct |
91 | Correct | 38 ms | 596 KB | Output is correct |
92 | Correct | 40 ms | 568 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 212 KB | Output is correct |
5 | Correct | 0 ms | 212 KB | Output is correct |
6 | Correct | 0 ms | 212 KB | Output is correct |
7 | Correct | 0 ms | 212 KB | Output is correct |
8 | Correct | 0 ms | 212 KB | Output is correct |
9 | Correct | 0 ms | 212 KB | Output is correct |
10 | Correct | 0 ms | 212 KB | Output is correct |
11 | Correct | 0 ms | 212 KB | Output is correct |
12 | Correct | 0 ms | 212 KB | Output is correct |
13 | Correct | 0 ms | 212 KB | Output is correct |
14 | Correct | 0 ms | 212 KB | Output is correct |
15 | Correct | 0 ms | 212 KB | Output is correct |
16 | Correct | 0 ms | 212 KB | Output is correct |
17 | Correct | 0 ms | 212 KB | Output is correct |
18 | Correct | 0 ms | 212 KB | Output is correct |
19 | Correct | 0 ms | 212 KB | Output is correct |
20 | Correct | 0 ms | 212 KB | Output is correct |
21 | Correct | 1 ms | 212 KB | Output is correct |
22 | Correct | 0 ms | 212 KB | Output is correct |
23 | Correct | 0 ms | 212 KB | Output is correct |
24 | Correct | 0 ms | 212 KB | Output is correct |
25 | Correct | 1 ms | 260 KB | Output is correct |
26 | Correct | 0 ms | 212 KB | Output is correct |
27 | Correct | 0 ms | 212 KB | Output is correct |
28 | Correct | 0 ms | 212 KB | Output is correct |
29 | Correct | 0 ms | 212 KB | Output is correct |
30 | Correct | 1 ms | 212 KB | Output is correct |
31 | Correct | 0 ms | 212 KB | Output is correct |
32 | Correct | 0 ms | 212 KB | Output is correct |
33 | Correct | 0 ms | 212 KB | Output is correct |
34 | Correct | 1 ms | 212 KB | Output is correct |
35 | Correct | 0 ms | 212 KB | Output is correct |
36 | Correct | 0 ms | 212 KB | Output is correct |
37 | Correct | 0 ms | 212 KB | Output is correct |
38 | Correct | 1 ms | 212 KB | Output is correct |
39 | Correct | 1 ms | 212 KB | Output is correct |
40 | Correct | 0 ms | 212 KB | Output is correct |
41 | Correct | 0 ms | 212 KB | Output is correct |
42 | Correct | 0 ms | 212 KB | Output is correct |
43 | Correct | 0 ms | 212 KB | Output is correct |
44 | Correct | 1 ms | 212 KB | Output is correct |
45 | Correct | 1 ms | 212 KB | Output is correct |
46 | Correct | 1 ms | 212 KB | Output is correct |
47 | Correct | 1 ms | 212 KB | Output is correct |
48 | Correct | 0 ms | 212 KB | Output is correct |
49 | Correct | 1 ms | 212 KB | Output is correct |
50 | Correct | 0 ms | 212 KB | Output is correct |
51 | Correct | 0 ms | 212 KB | Output is correct |
52 | Correct | 1 ms | 212 KB | Output is correct |
53 | Correct | 1 ms | 212 KB | Output is correct |
54 | Correct | 1 ms | 312 KB | Output is correct |
55 | Correct | 1 ms | 212 KB | Output is correct |
56 | Correct | 1 ms | 212 KB | Output is correct |
57 | Correct | 1 ms | 212 KB | Output is correct |
58 | Correct | 1 ms | 212 KB | Output is correct |
59 | Correct | 1 ms | 212 KB | Output is correct |
60 | Correct | 1 ms | 212 KB | Output is correct |
61 | Correct | 1 ms | 212 KB | Output is correct |
62 | Correct | 1 ms | 340 KB | Output is correct |
63 | Correct | 1 ms | 212 KB | Output is correct |
64 | Correct | 1 ms | 212 KB | Output is correct |
65 | Correct | 12 ms | 476 KB | Output is correct |
66 | Correct | 12 ms | 468 KB | Output is correct |
67 | Correct | 12 ms | 468 KB | Output is correct |
68 | Correct | 12 ms | 460 KB | Output is correct |
69 | Correct | 21 ms | 468 KB | Output is correct |
70 | Correct | 15 ms | 500 KB | Output is correct |
71 | Correct | 17 ms | 508 KB | Output is correct |
72 | Correct | 20 ms | 468 KB | Output is correct |
73 | Correct | 12 ms | 468 KB | Output is correct |
74 | Correct | 13 ms | 500 KB | Output is correct |
75 | Correct | 13 ms | 468 KB | Output is correct |
76 | Correct | 15 ms | 476 KB | Output is correct |
77 | Correct | 33 ms | 596 KB | Output is correct |
78 | Correct | 32 ms | 820 KB | Output is correct |
79 | Correct | 32 ms | 636 KB | Output is correct |
80 | Correct | 30 ms | 672 KB | Output is correct |
81 | Correct | 32 ms | 704 KB | Output is correct |
82 | Correct | 30 ms | 676 KB | Output is correct |
83 | Correct | 32 ms | 644 KB | Output is correct |
84 | Correct | 31 ms | 692 KB | Output is correct |
85 | Correct | 63 ms | 656 KB | Output is correct |
86 | Correct | 43 ms | 632 KB | Output is correct |
87 | Correct | 47 ms | 652 KB | Output is correct |
88 | Correct | 50 ms | 572 KB | Output is correct |
89 | Correct | 35 ms | 680 KB | Output is correct |
90 | Correct | 36 ms | 656 KB | Output is correct |
91 | Correct | 38 ms | 596 KB | Output is correct |
92 | Correct | 40 ms | 568 KB | Output is correct |
93 | Correct | 1096 ms | 3316 KB | Output is correct |
94 | Correct | 1099 ms | 3420 KB | Output is correct |
95 | Correct | 1097 ms | 3452 KB | Output is correct |
96 | Correct | 808 ms | 3268 KB | Output is correct |
97 | Correct | 739 ms | 3360 KB | Output is correct |
98 | Correct | 853 ms | 3456 KB | Output is correct |
99 | Correct | 97 ms | 1060 KB | Output is correct |
100 | Correct | 85 ms | 1072 KB | Output is correct |
101 | Correct | 81 ms | 1024 KB | Output is correct |
102 | Correct | 79 ms | 1228 KB | Output is correct |
103 | Correct | 786 ms | 1316 KB | Output is correct |
104 | Correct | 419 ms | 1872 KB | Output is correct |
105 | Correct | 305 ms | 1748 KB | Output is correct |
106 | Correct | 235 ms | 1804 KB | Output is correct |
107 | Correct | 2377 ms | 2672 KB | Output is correct |
108 | Correct | 881 ms | 3416 KB | Output is correct |
109 | Correct | 651 ms | 3364 KB | Output is correct |
110 | Correct | 624 ms | 3360 KB | Output is correct |
111 | Correct | 77 ms | 996 KB | Output is correct |
112 | Correct | 75 ms | 1024 KB | Output is correct |
113 | Correct | 79 ms | 1024 KB | Output is correct |
114 | Correct | 185 ms | 1196 KB | Output is correct |
115 | Correct | 127 ms | 1104 KB | Output is correct |
116 | Correct | 137 ms | 1144 KB | Output is correct |
117 | Correct | 143 ms | 996 KB | Output is correct |
118 | Correct | 95 ms | 980 KB | Output is correct |
119 | Correct | 104 ms | 1068 KB | Output is correct |
120 | Correct | 113 ms | 1004 KB | Output is correct |
121 | Correct | 114 ms | 1040 KB | Output is correct |
122 | Correct | 236 ms | 1740 KB | Output is correct |
123 | Correct | 207 ms | 1716 KB | Output is correct |
124 | Correct | 202 ms | 1884 KB | Output is correct |
125 | Correct | 204 ms | 1892 KB | Output is correct |
126 | Correct | 200 ms | 2012 KB | Output is correct |
127 | Correct | 201 ms | 1824 KB | Output is correct |
128 | Correct | 214 ms | 1912 KB | Output is correct |
129 | Correct | 212 ms | 1744 KB | Output is correct |
130 | Correct | 218 ms | 1804 KB | Output is correct |
131 | Correct | 544 ms | 1876 KB | Output is correct |
132 | Correct | 379 ms | 1812 KB | Output is correct |
133 | Correct | 407 ms | 1740 KB | Output is correct |
134 | Correct | 428 ms | 1676 KB | Output is correct |
135 | Correct | 276 ms | 1940 KB | Output is correct |
136 | Correct | 297 ms | 1816 KB | Output is correct |
137 | Correct | 320 ms | 1740 KB | Output is correct |
138 | Correct | 333 ms | 1676 KB | Output is correct |
139 | Correct | 234 ms | 1800 KB | Output is correct |
140 | Correct | 268 ms | 1720 KB | Output is correct |
141 | Correct | 270 ms | 1788 KB | Output is correct |
142 | Correct | 543 ms | 3332 KB | Output is correct |
143 | Correct | 545 ms | 3280 KB | Output is correct |
144 | Correct | 550 ms | 3416 KB | Output is correct |
145 | Correct | 548 ms | 3632 KB | Output is correct |
146 | Correct | 557 ms | 3356 KB | Output is correct |
147 | Correct | 568 ms | 3380 KB | Output is correct |
148 | Correct | 566 ms | 3448 KB | Output is correct |
149 | Correct | 548 ms | 3404 KB | Output is correct |
150 | Correct | 555 ms | 3336 KB | Output is correct |
151 | Correct | 662 ms | 3508 KB | Output is correct |
152 | Correct | 651 ms | 3352 KB | Output is correct |
153 | Correct | 809 ms | 3720 KB | Output is correct |
154 | Correct | 802 ms | 3352 KB | Output is correct |
155 | Correct | 946 ms | 3304 KB | Output is correct |
156 | Correct | 984 ms | 3208 KB | Output is correct |
157 | Correct | 867 ms | 3340 KB | Output is correct |
158 | Correct | 947 ms | 3424 KB | Output is correct |
159 | Correct | 694 ms | 3276 KB | Output is correct |
160 | Correct | 731 ms | 3276 KB | Output is correct |
161 | Correct | 793 ms | 3464 KB | Output is correct |
162 | Correct | 619 ms | 3244 KB | Output is correct |
163 | Correct | 657 ms | 3548 KB | Output is correct |
164 | Correct | 602 ms | 3244 KB | Output is correct |
165 | Correct | 624 ms | 3532 KB | Output is correct |
166 | Correct | 665 ms | 3332 KB | Output is correct |
167 | Correct | 662 ms | 3360 KB | Output is correct |