# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
696400 | 2023-02-06T12:00:30 Z | vjudge1 | Amusement Park (CEOI19_amusementpark) | C++14 | 2476 ms | 2576 KB |
#include<bits/stdc++.h> using namespace std; const int mod=998244353,inv2=(mod+1)/2; int qpow(int a,int b){ int c=1; for(;b;b>>=1){ if(b&1)c=1ll*a*c%mod; a=1ll*a*a%mod; } return c; } int n,m,f[1<<18]; bool a[19][19]; int b[1<<18]; int main(){ scanf("%d%d",&n,&m); for(int u,v,i=0;i<m;i++)scanf("%d%d",&u,&v),u--,v--,a[u][v]=a[v][u]=1; f[0]=1; for(int s=1;s<(1<<n);s++){ b[s]=1; for(int i=0;i<n;i++)if((s>>i)&1)for(int j=0;j<n;j++)if((s>>j)&1) b[s]&=!a[i][j]; b[s]=-b[s]; for(int i=0;i<n;i++)if((s>>i)&1)b[s]=-b[s]; for(int j=s;j;j=(j-1)&s)if(b[j]) (f[s]+=1ll*b[j]*f[j^s]%mod)%=mod; } return printf("%d",(1ll*f[(1<<n)-1]*m%mod*inv2%mod+mod)%mod),0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 308 KB | Output is correct |
5 | Correct | 0 ms | 212 KB | Output is correct |
6 | Correct | 0 ms | 316 KB | Output is correct |
7 | Correct | 1 ms | 212 KB | Output is correct |
8 | Correct | 0 ms | 212 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 308 KB | Output is correct |
5 | Correct | 0 ms | 212 KB | Output is correct |
6 | Correct | 0 ms | 316 KB | Output is correct |
7 | Correct | 1 ms | 212 KB | Output is correct |
8 | Correct | 0 ms | 212 KB | Output is correct |
9 | Correct | 1 ms | 316 KB | Output is correct |
10 | Correct | 0 ms | 308 KB | Output is correct |
11 | Correct | 1 ms | 212 KB | Output is correct |
12 | Correct | 1 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 | 1 ms | 212 KB | Output is correct |
16 | Correct | 1 ms | 212 KB | Output is correct |
17 | Correct | 1 ms | 212 KB | Output is correct |
18 | Correct | 0 ms | 212 KB | Output is correct |
19 | Correct | 0 ms | 308 KB | Output is correct |
20 | Correct | 0 ms | 212 KB | Output is correct |
21 | Correct | 0 ms | 212 KB | Output is correct |
22 | Correct | 0 ms | 212 KB | Output is correct |
23 | Correct | 1 ms | 312 KB | Output is correct |
24 | Correct | 0 ms | 212 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 308 KB | Output is correct |
5 | Correct | 0 ms | 212 KB | Output is correct |
6 | Correct | 0 ms | 316 KB | Output is correct |
7 | Correct | 1 ms | 212 KB | Output is correct |
8 | Correct | 0 ms | 212 KB | Output is correct |
9 | Correct | 1 ms | 316 KB | Output is correct |
10 | Correct | 0 ms | 308 KB | Output is correct |
11 | Correct | 1 ms | 212 KB | Output is correct |
12 | Correct | 1 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 | 1 ms | 212 KB | Output is correct |
16 | Correct | 1 ms | 212 KB | Output is correct |
17 | Correct | 1 ms | 212 KB | Output is correct |
18 | Correct | 0 ms | 212 KB | Output is correct |
19 | Correct | 0 ms | 308 KB | Output is correct |
20 | Correct | 0 ms | 212 KB | Output is correct |
21 | Correct | 0 ms | 212 KB | Output is correct |
22 | Correct | 0 ms | 212 KB | Output is correct |
23 | Correct | 1 ms | 312 KB | Output is correct |
24 | Correct | 0 ms | 212 KB | Output is correct |
25 | Correct | 1 ms | 324 KB | Output is correct |
26 | Correct | 0 ms | 212 KB | Output is correct |
27 | Correct | 1 ms | 308 KB | Output is correct |
28 | Correct | 1 ms | 212 KB | Output is correct |
29 | Correct | 0 ms | 212 KB | Output is correct |
30 | Correct | 0 ms | 316 KB | Output is correct |
31 | Correct | 0 ms | 212 KB | Output is correct |
32 | Correct | 1 ms | 212 KB | Output is correct |
33 | Correct | 1 ms | 316 KB | Output is correct |
34 | Correct | 0 ms | 312 KB | Output is correct |
35 | Correct | 0 ms | 212 KB | Output is correct |
36 | Correct | 1 ms | 340 KB | Output is correct |
37 | Correct | 1 ms | 312 KB | Output is correct |
38 | Correct | 1 ms | 308 KB | Output is correct |
39 | Correct | 1 ms | 312 KB | Output is correct |
40 | Correct | 1 ms | 212 KB | Output is correct |
41 | Correct | 1 ms | 212 KB | Output is correct |
42 | Correct | 1 ms | 212 KB | Output is correct |
43 | Correct | 1 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 | 1 ms | 308 KB | Output is correct |
49 | Correct | 0 ms | 212 KB | Output is correct |
50 | Correct | 1 ms | 312 KB | Output is correct |
51 | Correct | 1 ms | 212 KB | Output is correct |
52 | Correct | 1 ms | 312 KB | Output is correct |
53 | Correct | 1 ms | 308 KB | Output is correct |
54 | Correct | 1 ms | 212 KB | Output is correct |
55 | Correct | 1 ms | 316 KB | Output is correct |
56 | Correct | 1 ms | 212 KB | Output is correct |
57 | Correct | 1 ms | 316 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 | 212 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 | 0 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 308 KB | Output is correct |
5 | Correct | 0 ms | 212 KB | Output is correct |
6 | Correct | 0 ms | 316 KB | Output is correct |
7 | Correct | 1 ms | 212 KB | Output is correct |
8 | Correct | 0 ms | 212 KB | Output is correct |
9 | Correct | 1 ms | 316 KB | Output is correct |
10 | Correct | 0 ms | 308 KB | Output is correct |
11 | Correct | 1 ms | 212 KB | Output is correct |
12 | Correct | 1 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 | 1 ms | 212 KB | Output is correct |
16 | Correct | 1 ms | 212 KB | Output is correct |
17 | Correct | 1 ms | 212 KB | Output is correct |
18 | Correct | 0 ms | 212 KB | Output is correct |
19 | Correct | 0 ms | 308 KB | Output is correct |
20 | Correct | 0 ms | 212 KB | Output is correct |
21 | Correct | 0 ms | 212 KB | Output is correct |
22 | Correct | 0 ms | 212 KB | Output is correct |
23 | Correct | 1 ms | 312 KB | Output is correct |
24 | Correct | 0 ms | 212 KB | Output is correct |
25 | Correct | 1 ms | 324 KB | Output is correct |
26 | Correct | 0 ms | 212 KB | Output is correct |
27 | Correct | 1 ms | 308 KB | Output is correct |
28 | Correct | 1 ms | 212 KB | Output is correct |
29 | Correct | 0 ms | 212 KB | Output is correct |
30 | Correct | 0 ms | 316 KB | Output is correct |
31 | Correct | 0 ms | 212 KB | Output is correct |
32 | Correct | 1 ms | 212 KB | Output is correct |
33 | Correct | 1 ms | 316 KB | Output is correct |
34 | Correct | 0 ms | 312 KB | Output is correct |
35 | Correct | 0 ms | 212 KB | Output is correct |
36 | Correct | 1 ms | 340 KB | Output is correct |
37 | Correct | 1 ms | 312 KB | Output is correct |
38 | Correct | 1 ms | 308 KB | Output is correct |
39 | Correct | 1 ms | 312 KB | Output is correct |
40 | Correct | 1 ms | 212 KB | Output is correct |
41 | Correct | 1 ms | 212 KB | Output is correct |
42 | Correct | 1 ms | 212 KB | Output is correct |
43 | Correct | 1 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 | 1 ms | 308 KB | Output is correct |
49 | Correct | 0 ms | 212 KB | Output is correct |
50 | Correct | 1 ms | 312 KB | Output is correct |
51 | Correct | 1 ms | 212 KB | Output is correct |
52 | Correct | 1 ms | 312 KB | Output is correct |
53 | Correct | 1 ms | 308 KB | Output is correct |
54 | Correct | 1 ms | 212 KB | Output is correct |
55 | Correct | 1 ms | 316 KB | Output is correct |
56 | Correct | 1 ms | 212 KB | Output is correct |
57 | Correct | 1 ms | 316 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 | 212 KB | Output is correct |
63 | Correct | 1 ms | 212 KB | Output is correct |
64 | Correct | 1 ms | 212 KB | Output is correct |
65 | Correct | 14 ms | 340 KB | Output is correct |
66 | Correct | 14 ms | 340 KB | Output is correct |
67 | Correct | 13 ms | 340 KB | Output is correct |
68 | Correct | 13 ms | 360 KB | Output is correct |
69 | Correct | 26 ms | 340 KB | Output is correct |
70 | Correct | 19 ms | 332 KB | Output is correct |
71 | Correct | 20 ms | 308 KB | Output is correct |
72 | Correct | 21 ms | 340 KB | Output is correct |
73 | Correct | 16 ms | 452 KB | Output is correct |
74 | Correct | 16 ms | 436 KB | Output is correct |
75 | Correct | 18 ms | 340 KB | Output is correct |
76 | Correct | 18 ms | 372 KB | Output is correct |
77 | Correct | 42 ms | 548 KB | Output is correct |
78 | Correct | 38 ms | 548 KB | Output is correct |
79 | Correct | 37 ms | 476 KB | Output is correct |
80 | Correct | 38 ms | 460 KB | Output is correct |
81 | Correct | 34 ms | 568 KB | Output is correct |
82 | Correct | 32 ms | 472 KB | Output is correct |
83 | Correct | 30 ms | 492 KB | Output is correct |
84 | Correct | 31 ms | 528 KB | Output is correct |
85 | Correct | 70 ms | 460 KB | Output is correct |
86 | Correct | 54 ms | 512 KB | Output is correct |
87 | Correct | 57 ms | 532 KB | Output is correct |
88 | Correct | 59 ms | 544 KB | Output is correct |
89 | Correct | 41 ms | 532 KB | Output is correct |
90 | Correct | 45 ms | 460 KB | Output is correct |
91 | Correct | 47 ms | 444 KB | Output is correct |
92 | Correct | 47 ms | 440 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 308 KB | Output is correct |
5 | Correct | 0 ms | 212 KB | Output is correct |
6 | Correct | 0 ms | 316 KB | Output is correct |
7 | Correct | 1 ms | 212 KB | Output is correct |
8 | Correct | 0 ms | 212 KB | Output is correct |
9 | Correct | 1 ms | 316 KB | Output is correct |
10 | Correct | 0 ms | 308 KB | Output is correct |
11 | Correct | 1 ms | 212 KB | Output is correct |
12 | Correct | 1 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 | 1 ms | 212 KB | Output is correct |
16 | Correct | 1 ms | 212 KB | Output is correct |
17 | Correct | 1 ms | 212 KB | Output is correct |
18 | Correct | 0 ms | 212 KB | Output is correct |
19 | Correct | 0 ms | 308 KB | Output is correct |
20 | Correct | 0 ms | 212 KB | Output is correct |
21 | Correct | 0 ms | 212 KB | Output is correct |
22 | Correct | 0 ms | 212 KB | Output is correct |
23 | Correct | 1 ms | 312 KB | Output is correct |
24 | Correct | 0 ms | 212 KB | Output is correct |
25 | Correct | 1 ms | 324 KB | Output is correct |
26 | Correct | 0 ms | 212 KB | Output is correct |
27 | Correct | 1 ms | 308 KB | Output is correct |
28 | Correct | 1 ms | 212 KB | Output is correct |
29 | Correct | 0 ms | 212 KB | Output is correct |
30 | Correct | 0 ms | 316 KB | Output is correct |
31 | Correct | 0 ms | 212 KB | Output is correct |
32 | Correct | 1 ms | 212 KB | Output is correct |
33 | Correct | 1 ms | 316 KB | Output is correct |
34 | Correct | 0 ms | 312 KB | Output is correct |
35 | Correct | 0 ms | 212 KB | Output is correct |
36 | Correct | 1 ms | 340 KB | Output is correct |
37 | Correct | 1 ms | 312 KB | Output is correct |
38 | Correct | 1 ms | 308 KB | Output is correct |
39 | Correct | 1 ms | 312 KB | Output is correct |
40 | Correct | 1 ms | 212 KB | Output is correct |
41 | Correct | 1 ms | 212 KB | Output is correct |
42 | Correct | 1 ms | 212 KB | Output is correct |
43 | Correct | 1 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 | 1 ms | 308 KB | Output is correct |
49 | Correct | 0 ms | 212 KB | Output is correct |
50 | Correct | 1 ms | 312 KB | Output is correct |
51 | Correct | 1 ms | 212 KB | Output is correct |
52 | Correct | 1 ms | 312 KB | Output is correct |
53 | Correct | 1 ms | 308 KB | Output is correct |
54 | Correct | 1 ms | 212 KB | Output is correct |
55 | Correct | 1 ms | 316 KB | Output is correct |
56 | Correct | 1 ms | 212 KB | Output is correct |
57 | Correct | 1 ms | 316 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 | 212 KB | Output is correct |
63 | Correct | 1 ms | 212 KB | Output is correct |
64 | Correct | 1 ms | 212 KB | Output is correct |
65 | Correct | 14 ms | 340 KB | Output is correct |
66 | Correct | 14 ms | 340 KB | Output is correct |
67 | Correct | 13 ms | 340 KB | Output is correct |
68 | Correct | 13 ms | 360 KB | Output is correct |
69 | Correct | 26 ms | 340 KB | Output is correct |
70 | Correct | 19 ms | 332 KB | Output is correct |
71 | Correct | 20 ms | 308 KB | Output is correct |
72 | Correct | 21 ms | 340 KB | Output is correct |
73 | Correct | 16 ms | 452 KB | Output is correct |
74 | Correct | 16 ms | 436 KB | Output is correct |
75 | Correct | 18 ms | 340 KB | Output is correct |
76 | Correct | 18 ms | 372 KB | Output is correct |
77 | Correct | 42 ms | 548 KB | Output is correct |
78 | Correct | 38 ms | 548 KB | Output is correct |
79 | Correct | 37 ms | 476 KB | Output is correct |
80 | Correct | 38 ms | 460 KB | Output is correct |
81 | Correct | 34 ms | 568 KB | Output is correct |
82 | Correct | 32 ms | 472 KB | Output is correct |
83 | Correct | 30 ms | 492 KB | Output is correct |
84 | Correct | 31 ms | 528 KB | Output is correct |
85 | Correct | 70 ms | 460 KB | Output is correct |
86 | Correct | 54 ms | 512 KB | Output is correct |
87 | Correct | 57 ms | 532 KB | Output is correct |
88 | Correct | 59 ms | 544 KB | Output is correct |
89 | Correct | 41 ms | 532 KB | Output is correct |
90 | Correct | 45 ms | 460 KB | Output is correct |
91 | Correct | 47 ms | 444 KB | Output is correct |
92 | Correct | 47 ms | 440 KB | Output is correct |
93 | Correct | 1183 ms | 2324 KB | Output is correct |
94 | Correct | 1173 ms | 2308 KB | Output is correct |
95 | Correct | 1177 ms | 2352 KB | Output is correct |
96 | Correct | 886 ms | 2412 KB | Output is correct |
97 | Correct | 843 ms | 2332 KB | Output is correct |
98 | Correct | 951 ms | 2332 KB | Output is correct |
99 | Correct | 118 ms | 764 KB | Output is correct |
100 | Correct | 99 ms | 704 KB | Output is correct |
101 | Correct | 99 ms | 800 KB | Output is correct |
102 | Correct | 90 ms | 760 KB | Output is correct |
103 | Correct | 838 ms | 1444 KB | Output is correct |
104 | Correct | 462 ms | 1288 KB | Output is correct |
105 | Correct | 371 ms | 1236 KB | Output is correct |
106 | Correct | 279 ms | 1304 KB | Output is correct |
107 | Correct | 2476 ms | 2332 KB | Output is correct |
108 | Correct | 1016 ms | 2360 KB | Output is correct |
109 | Correct | 743 ms | 2544 KB | Output is correct |
110 | Correct | 653 ms | 2340 KB | Output is correct |
111 | Correct | 84 ms | 716 KB | Output is correct |
112 | Correct | 82 ms | 800 KB | Output is correct |
113 | Correct | 83 ms | 796 KB | Output is correct |
114 | Correct | 195 ms | 796 KB | Output is correct |
115 | Correct | 145 ms | 816 KB | Output is correct |
116 | Correct | 165 ms | 780 KB | Output is correct |
117 | Correct | 172 ms | 752 KB | Output is correct |
118 | Correct | 110 ms | 804 KB | Output is correct |
119 | Correct | 115 ms | 844 KB | Output is correct |
120 | Correct | 128 ms | 716 KB | Output is correct |
121 | Correct | 134 ms | 772 KB | Output is correct |
122 | Correct | 254 ms | 1320 KB | Output is correct |
123 | Correct | 226 ms | 1356 KB | Output is correct |
124 | Correct | 214 ms | 1276 KB | Output is correct |
125 | Correct | 214 ms | 1428 KB | Output is correct |
126 | Correct | 216 ms | 1224 KB | Output is correct |
127 | Correct | 194 ms | 1244 KB | Output is correct |
128 | Correct | 189 ms | 1368 KB | Output is correct |
129 | Correct | 185 ms | 1220 KB | Output is correct |
130 | Correct | 183 ms | 1320 KB | Output is correct |
131 | Correct | 579 ms | 1252 KB | Output is correct |
132 | Correct | 400 ms | 1316 KB | Output is correct |
133 | Correct | 435 ms | 1316 KB | Output is correct |
134 | Correct | 463 ms | 1440 KB | Output is correct |
135 | Correct | 311 ms | 1312 KB | Output is correct |
136 | Correct | 320 ms | 1336 KB | Output is correct |
137 | Correct | 346 ms | 1308 KB | Output is correct |
138 | Correct | 365 ms | 1228 KB | Output is correct |
139 | Correct | 264 ms | 1212 KB | Output is correct |
140 | Correct | 304 ms | 1280 KB | Output is correct |
141 | Correct | 305 ms | 1292 KB | Output is correct |
142 | Correct | 584 ms | 2332 KB | Output is correct |
143 | Correct | 584 ms | 2300 KB | Output is correct |
144 | Correct | 536 ms | 2512 KB | Output is correct |
145 | Correct | 509 ms | 2308 KB | Output is correct |
146 | Correct | 501 ms | 2380 KB | Output is correct |
147 | Correct | 488 ms | 2292 KB | Output is correct |
148 | Correct | 595 ms | 2380 KB | Output is correct |
149 | Correct | 582 ms | 2256 KB | Output is correct |
150 | Correct | 576 ms | 2252 KB | Output is correct |
151 | Correct | 726 ms | 2360 KB | Output is correct |
152 | Correct | 712 ms | 2252 KB | Output is correct |
153 | Correct | 863 ms | 2528 KB | Output is correct |
154 | Correct | 895 ms | 2412 KB | Output is correct |
155 | Correct | 995 ms | 2252 KB | Output is correct |
156 | Correct | 1042 ms | 2308 KB | Output is correct |
157 | Correct | 926 ms | 2420 KB | Output is correct |
158 | Correct | 1002 ms | 2432 KB | Output is correct |
159 | Correct | 741 ms | 2232 KB | Output is correct |
160 | Correct | 777 ms | 2224 KB | Output is correct |
161 | Correct | 855 ms | 2384 KB | Output is correct |
162 | Correct | 674 ms | 2372 KB | Output is correct |
163 | Correct | 701 ms | 2576 KB | Output is correct |
164 | Correct | 654 ms | 2344 KB | Output is correct |
165 | Correct | 673 ms | 2348 KB | Output is correct |
166 | Correct | 699 ms | 2420 KB | Output is correct |
167 | Correct | 723 ms | 2296 KB | Output is correct |