답안 #1008683

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1008683 2024-06-26T16:39:14 Z m5588ohammed Bootfall (IZhO17_bootfall) C++14
100 / 100
542 ms 4948 KB
/******************************************************************************
 
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
 
*******************************************************************************/
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
#define mod 10000000000037
const int S=500*500+1;
int sum[S+2],fre[S+2],t,New[S+1];
void inc(int x){
    for(int j=S;j>=x;j--){
        sum[j]+=sum[j-x];
        sum[j]%=mod;
    }
    return;
}
void dec(int x){
    for(int j=0;j<=S-x;j++){
        sum[j+x]-=sum[j];
        sum[j+x]+=mod;
        sum[j+x]%=mod;
    }
    return;
}
signed main()
{
    int n;
    cin>>n;
    int arr[n];
    sum[0]=1;
    for(int i=0;i<n;i++){
        cin>>arr[i];
        inc(arr[i]);
        t+=arr[i];
    }
    if(sum[t/2]==0){cout<<0<<endl;return 0;}
    for(int i=0;i<n;i++){
        dec(arr[i]);
        t-=arr[i];
        for(int j=0;j<=t-1;j++) {
            if((t-j)-j>0&&sum[j]>0&&sum[(t-j)]>0) fre[(t-j)-j]++;
        }
        t+=arr[i];
        inc(arr[i]);
    }
    int siz=0;
    for(int j=1;j<=S;j++){
        if(fre[j]==n) siz++;
    }
    cout<<siz<<endl;
    for(int j=1;j<=S;j++){
        if(fre[j]==n) cout<<j<<" ";
    }
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 2396 KB Output is correct
2 Correct 7 ms 2396 KB Output is correct
3 Correct 2 ms 2408 KB Output is correct
4 Correct 4 ms 2396 KB Output is correct
5 Correct 12 ms 2416 KB Output is correct
6 Correct 7 ms 2392 KB Output is correct
7 Correct 6 ms 2396 KB Output is correct
8 Correct 12 ms 2216 KB Output is correct
9 Correct 10 ms 2396 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 2396 KB Output is correct
2 Correct 7 ms 2396 KB Output is correct
3 Correct 2 ms 2408 KB Output is correct
4 Correct 4 ms 2396 KB Output is correct
5 Correct 12 ms 2416 KB Output is correct
6 Correct 7 ms 2392 KB Output is correct
7 Correct 6 ms 2396 KB Output is correct
8 Correct 12 ms 2216 KB Output is correct
9 Correct 10 ms 2396 KB Output is correct
10 Correct 27 ms 2396 KB Output is correct
11 Correct 27 ms 2392 KB Output is correct
12 Correct 26 ms 2396 KB Output is correct
13 Correct 25 ms 2396 KB Output is correct
14 Correct 25 ms 2396 KB Output is correct
15 Correct 27 ms 2408 KB Output is correct
16 Correct 31 ms 2396 KB Output is correct
17 Correct 17 ms 2408 KB Output is correct
18 Correct 21 ms 2408 KB Output is correct
19 Correct 23 ms 2396 KB Output is correct
20 Correct 24 ms 2392 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 2396 KB Output is correct
2 Correct 7 ms 2396 KB Output is correct
3 Correct 2 ms 2408 KB Output is correct
4 Correct 4 ms 2396 KB Output is correct
5 Correct 12 ms 2416 KB Output is correct
6 Correct 7 ms 2392 KB Output is correct
7 Correct 6 ms 2396 KB Output is correct
8 Correct 12 ms 2216 KB Output is correct
9 Correct 10 ms 2396 KB Output is correct
10 Correct 27 ms 2396 KB Output is correct
11 Correct 27 ms 2392 KB Output is correct
12 Correct 26 ms 2396 KB Output is correct
13 Correct 25 ms 2396 KB Output is correct
14 Correct 25 ms 2396 KB Output is correct
15 Correct 27 ms 2408 KB Output is correct
16 Correct 31 ms 2396 KB Output is correct
17 Correct 17 ms 2408 KB Output is correct
18 Correct 21 ms 2408 KB Output is correct
19 Correct 23 ms 2396 KB Output is correct
20 Correct 24 ms 2392 KB Output is correct
21 Correct 48 ms 2396 KB Output is correct
22 Correct 62 ms 2396 KB Output is correct
23 Correct 44 ms 2396 KB Output is correct
24 Correct 82 ms 2392 KB Output is correct
25 Correct 76 ms 2392 KB Output is correct
26 Correct 87 ms 2476 KB Output is correct
27 Correct 78 ms 2456 KB Output is correct
28 Correct 78 ms 2392 KB Output is correct
29 Correct 80 ms 2392 KB Output is correct
30 Correct 79 ms 2424 KB Output is correct
31 Correct 79 ms 2396 KB Output is correct
32 Correct 80 ms 2640 KB Output is correct
33 Correct 78 ms 2468 KB Output is correct
34 Correct 80 ms 2468 KB Output is correct
35 Correct 89 ms 2392 KB Output is correct
36 Correct 89 ms 2396 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 2396 KB Output is correct
2 Correct 7 ms 2396 KB Output is correct
3 Correct 2 ms 2408 KB Output is correct
4 Correct 4 ms 2396 KB Output is correct
5 Correct 12 ms 2416 KB Output is correct
6 Correct 7 ms 2392 KB Output is correct
7 Correct 6 ms 2396 KB Output is correct
8 Correct 12 ms 2216 KB Output is correct
9 Correct 10 ms 2396 KB Output is correct
10 Correct 27 ms 2396 KB Output is correct
11 Correct 27 ms 2392 KB Output is correct
12 Correct 26 ms 2396 KB Output is correct
13 Correct 25 ms 2396 KB Output is correct
14 Correct 25 ms 2396 KB Output is correct
15 Correct 27 ms 2408 KB Output is correct
16 Correct 31 ms 2396 KB Output is correct
17 Correct 17 ms 2408 KB Output is correct
18 Correct 21 ms 2408 KB Output is correct
19 Correct 23 ms 2396 KB Output is correct
20 Correct 24 ms 2392 KB Output is correct
21 Correct 48 ms 2396 KB Output is correct
22 Correct 62 ms 2396 KB Output is correct
23 Correct 44 ms 2396 KB Output is correct
24 Correct 82 ms 2392 KB Output is correct
25 Correct 76 ms 2392 KB Output is correct
26 Correct 87 ms 2476 KB Output is correct
27 Correct 78 ms 2456 KB Output is correct
28 Correct 78 ms 2392 KB Output is correct
29 Correct 80 ms 2392 KB Output is correct
30 Correct 79 ms 2424 KB Output is correct
31 Correct 79 ms 2396 KB Output is correct
32 Correct 80 ms 2640 KB Output is correct
33 Correct 78 ms 2468 KB Output is correct
34 Correct 80 ms 2468 KB Output is correct
35 Correct 89 ms 2392 KB Output is correct
36 Correct 89 ms 2396 KB Output is correct
37 Correct 192 ms 2396 KB Output is correct
38 Correct 155 ms 2392 KB Output is correct
39 Correct 202 ms 2640 KB Output is correct
40 Correct 225 ms 2656 KB Output is correct
41 Correct 233 ms 2916 KB Output is correct
42 Correct 231 ms 2624 KB Output is correct
43 Correct 232 ms 2904 KB Output is correct
44 Correct 234 ms 2820 KB Output is correct
45 Correct 220 ms 2916 KB Output is correct
46 Correct 241 ms 2640 KB Output is correct
47 Correct 217 ms 2644 KB Output is correct
48 Correct 262 ms 2900 KB Output is correct
49 Correct 232 ms 2644 KB Output is correct
50 Correct 234 ms 2640 KB Output is correct
51 Correct 219 ms 2644 KB Output is correct
52 Correct 254 ms 2896 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 2396 KB Output is correct
2 Correct 7 ms 2396 KB Output is correct
3 Correct 2 ms 2408 KB Output is correct
4 Correct 4 ms 2396 KB Output is correct
5 Correct 12 ms 2416 KB Output is correct
6 Correct 7 ms 2392 KB Output is correct
7 Correct 6 ms 2396 KB Output is correct
8 Correct 12 ms 2216 KB Output is correct
9 Correct 10 ms 2396 KB Output is correct
10 Correct 27 ms 2396 KB Output is correct
11 Correct 27 ms 2392 KB Output is correct
12 Correct 26 ms 2396 KB Output is correct
13 Correct 25 ms 2396 KB Output is correct
14 Correct 25 ms 2396 KB Output is correct
15 Correct 27 ms 2408 KB Output is correct
16 Correct 31 ms 2396 KB Output is correct
17 Correct 17 ms 2408 KB Output is correct
18 Correct 21 ms 2408 KB Output is correct
19 Correct 23 ms 2396 KB Output is correct
20 Correct 24 ms 2392 KB Output is correct
21 Correct 48 ms 2396 KB Output is correct
22 Correct 62 ms 2396 KB Output is correct
23 Correct 44 ms 2396 KB Output is correct
24 Correct 82 ms 2392 KB Output is correct
25 Correct 76 ms 2392 KB Output is correct
26 Correct 87 ms 2476 KB Output is correct
27 Correct 78 ms 2456 KB Output is correct
28 Correct 78 ms 2392 KB Output is correct
29 Correct 80 ms 2392 KB Output is correct
30 Correct 79 ms 2424 KB Output is correct
31 Correct 79 ms 2396 KB Output is correct
32 Correct 80 ms 2640 KB Output is correct
33 Correct 78 ms 2468 KB Output is correct
34 Correct 80 ms 2468 KB Output is correct
35 Correct 89 ms 2392 KB Output is correct
36 Correct 89 ms 2396 KB Output is correct
37 Correct 192 ms 2396 KB Output is correct
38 Correct 155 ms 2392 KB Output is correct
39 Correct 202 ms 2640 KB Output is correct
40 Correct 225 ms 2656 KB Output is correct
41 Correct 233 ms 2916 KB Output is correct
42 Correct 231 ms 2624 KB Output is correct
43 Correct 232 ms 2904 KB Output is correct
44 Correct 234 ms 2820 KB Output is correct
45 Correct 220 ms 2916 KB Output is correct
46 Correct 241 ms 2640 KB Output is correct
47 Correct 217 ms 2644 KB Output is correct
48 Correct 262 ms 2900 KB Output is correct
49 Correct 232 ms 2644 KB Output is correct
50 Correct 234 ms 2640 KB Output is correct
51 Correct 219 ms 2644 KB Output is correct
52 Correct 254 ms 2896 KB Output is correct
53 Correct 275 ms 2644 KB Output is correct
54 Correct 309 ms 2896 KB Output is correct
55 Correct 355 ms 3412 KB Output is correct
56 Correct 268 ms 2904 KB Output is correct
57 Correct 294 ms 3408 KB Output is correct
58 Correct 285 ms 2912 KB Output is correct
59 Correct 303 ms 3152 KB Output is correct
60 Correct 300 ms 2644 KB Output is correct
61 Correct 279 ms 3156 KB Output is correct
62 Correct 263 ms 3176 KB Output is correct
63 Correct 297 ms 3412 KB Output is correct
64 Correct 277 ms 3408 KB Output is correct
65 Correct 273 ms 2896 KB Output is correct
66 Correct 263 ms 2660 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 2396 KB Output is correct
2 Correct 7 ms 2396 KB Output is correct
3 Correct 2 ms 2408 KB Output is correct
4 Correct 4 ms 2396 KB Output is correct
5 Correct 12 ms 2416 KB Output is correct
6 Correct 7 ms 2392 KB Output is correct
7 Correct 6 ms 2396 KB Output is correct
8 Correct 12 ms 2216 KB Output is correct
9 Correct 10 ms 2396 KB Output is correct
10 Correct 27 ms 2396 KB Output is correct
11 Correct 27 ms 2392 KB Output is correct
12 Correct 26 ms 2396 KB Output is correct
13 Correct 25 ms 2396 KB Output is correct
14 Correct 25 ms 2396 KB Output is correct
15 Correct 27 ms 2408 KB Output is correct
16 Correct 31 ms 2396 KB Output is correct
17 Correct 17 ms 2408 KB Output is correct
18 Correct 21 ms 2408 KB Output is correct
19 Correct 23 ms 2396 KB Output is correct
20 Correct 24 ms 2392 KB Output is correct
21 Correct 48 ms 2396 KB Output is correct
22 Correct 62 ms 2396 KB Output is correct
23 Correct 44 ms 2396 KB Output is correct
24 Correct 82 ms 2392 KB Output is correct
25 Correct 76 ms 2392 KB Output is correct
26 Correct 87 ms 2476 KB Output is correct
27 Correct 78 ms 2456 KB Output is correct
28 Correct 78 ms 2392 KB Output is correct
29 Correct 80 ms 2392 KB Output is correct
30 Correct 79 ms 2424 KB Output is correct
31 Correct 79 ms 2396 KB Output is correct
32 Correct 80 ms 2640 KB Output is correct
33 Correct 78 ms 2468 KB Output is correct
34 Correct 80 ms 2468 KB Output is correct
35 Correct 89 ms 2392 KB Output is correct
36 Correct 89 ms 2396 KB Output is correct
37 Correct 192 ms 2396 KB Output is correct
38 Correct 155 ms 2392 KB Output is correct
39 Correct 202 ms 2640 KB Output is correct
40 Correct 225 ms 2656 KB Output is correct
41 Correct 233 ms 2916 KB Output is correct
42 Correct 231 ms 2624 KB Output is correct
43 Correct 232 ms 2904 KB Output is correct
44 Correct 234 ms 2820 KB Output is correct
45 Correct 220 ms 2916 KB Output is correct
46 Correct 241 ms 2640 KB Output is correct
47 Correct 217 ms 2644 KB Output is correct
48 Correct 262 ms 2900 KB Output is correct
49 Correct 232 ms 2644 KB Output is correct
50 Correct 234 ms 2640 KB Output is correct
51 Correct 219 ms 2644 KB Output is correct
52 Correct 254 ms 2896 KB Output is correct
53 Correct 275 ms 2644 KB Output is correct
54 Correct 309 ms 2896 KB Output is correct
55 Correct 355 ms 3412 KB Output is correct
56 Correct 268 ms 2904 KB Output is correct
57 Correct 294 ms 3408 KB Output is correct
58 Correct 285 ms 2912 KB Output is correct
59 Correct 303 ms 3152 KB Output is correct
60 Correct 300 ms 2644 KB Output is correct
61 Correct 279 ms 3156 KB Output is correct
62 Correct 263 ms 3176 KB Output is correct
63 Correct 297 ms 3412 KB Output is correct
64 Correct 277 ms 3408 KB Output is correct
65 Correct 273 ms 2896 KB Output is correct
66 Correct 263 ms 2660 KB Output is correct
67 Correct 365 ms 3156 KB Output is correct
68 Correct 134 ms 2396 KB Output is correct
69 Correct 483 ms 4688 KB Output is correct
70 Correct 466 ms 3640 KB Output is correct
71 Correct 460 ms 3668 KB Output is correct
72 Correct 494 ms 3372 KB Output is correct
73 Correct 438 ms 3172 KB Output is correct
74 Correct 474 ms 4692 KB Output is correct
75 Correct 475 ms 4176 KB Output is correct
76 Correct 542 ms 4800 KB Output is correct
77 Correct 519 ms 4948 KB Output is correct