编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#33430 #2029. C2M Wrong Answer 63 63 ms 436 K C++ 17 / 1.1 K C192023211755 2025-03-22 17:45:47
显示原始代码
#include <cstring>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;
using i64 = long long;
//#define int long long
void solve() {
    int n, m, a, b, c, d;
    cin >> n >> m >> a >> b >> c >> d;
    int ans = 0;
    if (n) {
        n--;
        ans++;
    }
    if (m) {
        m--;
        ans++;
    }
    int gong = min(n, m);
    if (gong && b) {
        gong--;
        b--;
        ans++;
    }
    if (gong && a) {
        gong--;
        a--;
        ans++;
    }
    if (gong && c) {
        gong--;
        c--;
        ans++;
    }
    int cha = min(n, m) - gong;
    n -= cha;
    m -= cha;
    if (d && n >= 2) {
        n -= 2;
        ans++;
    } else if (d && m >= 2) {
        m -= 2;
        ans++;
    }
    if (n >= 2 && a) {
        n -= 2;
        ans++;
    }
    if (n >= 2 && c) {
        n -= 2;
        ans++;
    }
    if (m >= 2 && a) {
        m -= 2;
        ans++;
    }
    if (m >= 2 && c) {
        m -= 2;
        ans++;
    }
    cout << ans << endl;
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int T = 1;
    cin >> T;
    while (T--) {
        solve();
    }
    return 0;
}
子任务 #1
Wrong Answer
得分:62
测试点 #1
Accepted
得分:100
用时:4 ms
内存:324 KiB

输入文件(test0.in

3
2 2 1 0 1 0
2 1 0 0 0 0
2 2 0 1 0 1

答案文件(test0.out

3
2
3

用户输出

3
2
3

系统信息

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

输入文件(test1.in

3
9 0 2 1 7 2
1 8 7 3 3 6
6 8 2 2 9 7

答案文件(test1.out

4
5
8

用户输出

4
5
8

系统信息

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

输入文件(test2.in

3
3 0 0 7 9 5
3 9 5 4 9 8
4 3 9 6 4 8

答案文件(test2.out

2
7
4

用户输出

2
7
4

系统信息

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

输入文件(test3.in

8
5 4 7 5 9 3
4 2 3 5 6 8
9 4 2 8 4 8
8 7 3 6 9 1
4 8 7 9 8 0
8 4 3 6 4 7
0 9 5 5 0 4
1 7 9 
<7 bytes omitted>

答案文件(test3.out

5
4
7
8
7
7
3
5

用户输出

5
4
7
8
7
7
3
5

系统信息

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

输入文件(test4.in

3
3 6 8 1 0 2
1 1 4 2 0 6
0 1 9 3 8 0

答案文件(test4.out

5
2
1

用户输出

5
2
1

系统信息

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

输入文件(test5.in

0

系统信息

Exited with return code 0
测试点 #7
Wrong Answer
得分:0
用时:4 ms
内存:324 KiB

输入文件(test6.in

77
18 15 94 79 1 67
60 41 80 54 42 30
19 25 1 41 9 65
42 64 10 24 26 36
57 20 88 46 68 13
71 2
<1334 bytes omitted>

答案文件(test6.out

8
10
8
10
10
10
4
10
10
10
10
9
10
10
10
10
10
10
10
10
10
10
7
10
10
10
1
<193 bytes omitted>

用户输出

8
10
8
10
10
10
4
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
7
10
10
10
10
10
10
10
10
10
10
10
8
10
10
10
10
8
10
10
10
10
10
<91 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #8
Wrong Answer
得分:0
用时:4 ms
内存:344 KiB

输入文件(test7.in

58
82 23 28 17 98 88
27 20 80 74 79 60
32 4 78 95 38 0
64 66 86 38 91 15
65 11 7 15 76 64
73 1
<975 bytes omitted>

答案文件(test7.out

10
10
7
10
10
10
10
10
5
9
10
8
10
10
10
9
10
10
8
10
10
10
10
10
10
9
10
<120 bytes omitted>

用户输出

10
10
7
10
10
10
10
10
5
9
10
8
10
10
10
10
10
10
8
10
10
10
10
10
10
9
10
8
10
10
10
10
4
10
9
10
10
10
10
10
10
10
10
10
7
10

<34 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #9
Wrong Answer
得分:0
用时:4 ms
内存:412 KiB

输入文件(test8.in

90
94 66 10 27 23 47
66 66 16 49 59 22
36 57 18 48 92 60
2 72 54 96 7 77
11 69 65 71 49 82
4 9
<1560 bytes omitted>

答案文件(test8.out

10
10
10
6
10
8
10
10
10
10
10
6
10
10
10
10
10
10
10
6
10
10
10
7
10
10
1
<239 bytes omitted>

用户输出

10
10
10
6
10
8
10
10
10
10
10
6
10
10
10
10
10
10
10
6
10
10
10
7
10
10
10
10
8
10
10
10
10
10
10
10
10
10
10
10
8
10
10
10
8
7
<119 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

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

输入文件(test9.in

25
64 99 11 6 64 72
47 78 49 14 72 85
81 4 46 75 81 87
92 33 42 10 89 10
68 56 59 70 3 48
54 5
<365 bytes omitted>

答案文件(test9.out

10
10
8
10
10
8
10
10
10
10
10
10
10
10
10
10
9
8
10
10
10
10
10
9
7

用户输出

10
10
8
10
10
8
10
10
10
10
10
10
10
10
10
10
9
8
10
10
10
10
10
9
7

系统信息

Exited with return code 0
测试点 #11
Wrong Answer
得分:0
用时:4 ms
内存:328 KiB

输入文件(test10.in

73
30 89 13 86 62 49
91 60 2 77 71 29
89 69 3 62 64 46
9 36 63 68 2 69
99 18 10 45 18 95
60 73
<1237 bytes omitted>

答案文件(test10.out

10
9
10
9
10
10
10
4
10
8
10
10
10
10
10
10
10
10
8
10
10
10
4
7
10
10
10
<172 bytes omitted>

用户输出

10
10
10
9
10
10
10
4
10
8
10
10
10
10
10
10
10
10
8
10
10
10
4
6
10
10
10
10
8
10
10
9
5
10
5
10
10
10
10
10
10
10
5
8
10
5
10

<72 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #12
Wrong Answer
得分:0
用时:7 ms
内存:320 KiB

输入文件(test11.in

966
96 56 66 81 61 51
35 37 85 12 25 26
34 23 44 46 77 84
75 7 21 18 63 56
39 24 73 41 26 14
9
<17700 bytes omitted>

答案文件(test11.out

10
10
10
9
10
10
10
10
10
9
10
10
10
10
8
10
10
8
9
10
10
10
10
10
10
10
9
<3555 bytes omitted>

用户输出

10
10
10
9
10
10
10
10
10
9
10
10
10
10
7
10
10
10
8
10
10
10
10
10
10
10
10
10
10
10
10
10
10
9
10
10
10
10
10
7
10
10
10
10
8

<2572 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #13
Wrong Answer
得分:0
用时:4 ms
内存:324 KiB

输入文件(test12.in

360
12 73 46 12 51 74
90 27 95 52 16 84
60 36 88 42 93 70
89 90 0 54 34 37
93 79 80 39 1 37
36
<6541 bytes omitted>

答案文件(test12.out

10
10
10
7
8
10
10
10
10
6
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
<1271 bytes omitted>

用户输出

10
10
10
7
8
10
10
10
10
6
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
8
10
10
10
10
10
10
10
10
10
10
10
10
9
8
10
10
<882 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

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

输入文件(test13.in

289
37532 38852 71613 10443 33986 36769
79307 75575 58190 28114 84001 27482
85067 88248 48583 185
<10374 bytes omitted>

答案文件(test13.out

10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10

<1056 bytes omitted>

用户输出

10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
<739 bytes omitted>

系统信息

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

输入文件(test14.in

148
43321 76296 60475 68219 24984 8680
5273 87067 3728 68399 34913 16776
44143 30697 4164 87265 2
<5278 bytes omitted>

答案文件(test14.out

10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10

<492 bytes omitted>

用户输出

10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
<316 bytes omitted>

系统信息

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

输入文件(test15.in

153
23442 36949 37568 93909 36387 89770
36763 13525 20004 25640 26242 68073
81713 14482 57110 792
<5479 bytes omitted>

答案文件(test15.out

10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10

<512 bytes omitted>

用户输出

10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
<331 bytes omitted>

系统信息

Exited with return code 0