编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#5170 #1035. 命运 Wrong Answer 25 2048 ms 384 K C++ 17 / 1.0 K TosakaUCW 2024-02-25 16:22:58
显示原始代码
#include <bits/stdc++.h>
// #define int long long
#define pb push_back

using std::cin, std::cout, std::string;
int read(int x = 0, int f = 0, char ch = getchar()) {
    while (ch < 48 or 57 < ch) f = ch == 45, ch = getchar();
    while (48 <= ch and ch <= 57) x = x * 10 + ch - 48, ch = getchar();
    return f ? -x : x;
}
const int N = 1e6 + 5;
const int INF = 1 << 30;
// const long long INF = 1LL << 60;
int n, q, a[N];
void solve() {
    n = read(), q = read();
    for (int i = 1; i <= n; i++) a[i] = read();
    for (int x, ans; q--;) {
        x = read(), ans = 0;
        for (int sta = 0; sta < (1 << n); sta++) {
            int sum = 0;
            for (int j = 0; j < n; j++)
                if ((sta >> j) & 1 == 1)
                    sum += a[j + 1];
            if (sum % x == 0)
                ans++;
        }
        cout << ans << '\n';
    }
}

signed main() {
#ifndef ONLINE_JUDGE
    freopen("F.in", "r", stdin);
#endif
    for (int T = 1; T--; solve())
        ;
    return 0;
}
子任务 #1
Accepted
得分:25
测试点 #1
Accepted
得分:100
用时:8 ms
内存:380 KiB

输入文件(choose0.in

4 3
593 601 601 595 
15
89
77

答案文件(choose0.out

1
1
1

用户输出

1
1
1

系统信息

Exited with return code 0
测试点 #2
Accepted
得分:100
用时:6 ms
内存:272 KiB

输入文件(choose1.in

10 3
471 471 473 474 473 478 476 478 469 476 
57
21
86

答案文件(choose1.out

29
28
30

用户输出

29
28
30

系统信息

Exited with return code 0
测试点 #3
Accepted
得分:100
用时:6 ms
内存:368 KiB

输入文件(choose2.in

6 4
494 489 492 493 491 494 
67
89
37
78

答案文件(choose2.out

4
1
2
1

用户输出

4
1
2
1

系统信息

Exited with return code 0
测试点 #4
Accepted
得分:100
用时:6 ms
内存:380 KiB

输入文件(choose3.in

5 4
621 622 623 614 616 
8
85
13
75

答案文件(choose3.out

4
1
4
2

用户输出

4
1
4
2

系统信息

Exited with return code 0
测试点 #5
Accepted
得分:100
用时:6 ms
内存:384 KiB

输入文件(choose4.in

10 5
645 642 642 652 646 652 649 644 649 652 
79
3
11
11
82

答案文件(choose4.out

23
344
80
80
1

用户输出

23
344
80
80
1

系统信息

Exited with return code 0
子任务 #2
Wrong Answer
得分:0
测试点 #1
Wrong Answer
得分:0
用时:4 ms
内存:360 KiB

输入文件(choose11.in

95 27
-997539194 -997539223 -997539203 -997539196 -997539200 -997539204 -997539191 -997539210 -99753
<1032 bytes omitted>

答案文件(choose11.out

805781535
713571652
560531218
417146333
300038627
255849128
688375560
567828174
116009787
791230879

<167 bytes omitted>

用户输出

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #2
Skipped
测试点 #3
Skipped
测试点 #4
Skipped
测试点 #5
Skipped
子任务 #3
Wrong Answer
得分:0
测试点 #1
Wrong Answer
得分:0
用时:6 ms
内存:372 KiB

输入文件(choose21.in

575 30
624834518 624834524 624834518 624834508 624834500 624834502 624834498 624834489 624834514 624
<5746 bytes omitted>

答案文件(choose21.out

155226838
328268214
899171208
331459190
455255862
95748906
210916867
210916867
331459190
890349468
8
<198 bytes omitted>

用户输出

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #2
Skipped
测试点 #3
Skipped
测试点 #4
Skipped
测试点 #5
Skipped
子任务 #4
Time Limit Exceeded
得分:0
测试点 #1
Time Limit Exceeded
得分:0
用时:2006 ms
内存:264 KiB

输入文件(choose31.in

9529 27
976772767 976772748 976772782 976772766 976772770 976772783 976772751 976772785 976772757 97
<95278 bytes omitted>

答案文件(choose31.out

739323732
689689818
829528267
689689818
735011245
463119032
578095250
876922170
812095388
816076913

<168 bytes omitted>
测试点 #2
Skipped
测试点 #3
Skipped
测试点 #4
Skipped
测试点 #5
Skipped