编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#46143 #1153. wch和zxh的游♂戏 Wrong Answer 0 1901 ms 420 K C++ 11 / 2.2 K 电类943-朱子佳 2020-08-19 17:11:28
显示原始代码
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void tran(ll a[][4], ll x, ll y) {
    ll temp;
    temp = a[x][y + 1];
    a[x][y + 1] = a[x + 1][y + 1];
    a[x + 1][y + 1] = a[x + 1][y];
    a[x + 1][y] = a[x][y];
    a[x][y] = temp;
}
ll win(ll a[][4], ll k) {
    ll i = 0, j = 0, ii = 0, jj = 0;
    ll b[4][4], c[4][4], d[4][4], sum, s = 0, ss = 0, s1 = 0, s2 = 0, s22 = 0;
    for (i = 0; i < 4; i++) {
        for (j = 0; j < 4; j++) {
            if (a[i][j] < sum)
                sum = a[i][j];
        }
    }
    sum = 8 * k * sum;
    for (i = 0; i < 4; i++) {
        for (j = 0; j < 4; j++) {
            b[i][j] = a[i][j];
        }
    }  //��������ĵ���

    if (k == 1) {
        for (i = 0; i < 9; i++) {
            for (ii = 0; ii < 4; ii++) {
                for (jj = 0; jj < 4; jj++) {
                    a[ii][jj] = b[ii][jj];
                }
            }  //�ص�����ĵ���
            s1 = a[i / 3][i % 3] + a[i / 3][i % 3 + 1] + a[i / 3 + 1][i % 3] + a[i / 3 + 1][i % 3 + 1];
            tran(a, i / 3, i % 3);
            s22 = a[0][0] + a[0][1] + a[1][0] + a[1][1];
            for (j = 0; j < 9; j++) {
                s2 = a[j / 3][j % 3] + a[j / 3][j % 3 + 1] + a[j / 3 + 1][j % 3] + a[j / 3 + 1][j % 3 + 1];
                if (s2 < s22)
                    s22 = s2;
            }
            s = s1 + s22;
            // cout<<sum<<" "<<s<<endl;
            if (s > sum)
                sum = s;
        }

        return sum;
    } else {
        for (i = 0; i < 9; i++) {
            for (ii = 0; ii < 4; ii++) {
                for (jj = 0; jj < 4; jj++) {
                    a[ii][jj] = b[ii][jj];
                }
            }  //�ص�����ĵ���
            s1 = a[i / 3][i % 3] + a[i / 3][i % 3 + 1] + a[i / 3 + 1][i % 3] + a[i / 3 + 1][i % 3 + 1];
            tran(a, i / 3, i % 3);  //��ת90��
            for (ii = 0; ii < 4; ii++) {
                for (jj = 0; jj < 4; jj++) {
                    c[ii][jj] = a[ii][jj];
                }
            }
            s22 = a[0][0] + a[0][1] + a[1][0] + a[1][1] + win(a, k - 1);
            for (j = 0; j < 9; j++)  // zxh��������
            {
                for (ii = 0; ii < 4; ii++) {
                    for (jj = 0; jj < 4; jj++) {
                        a[ii][jj] = c[ii][jj];
                    }
                }  //�ص���һ�����
                s2 = a[j / 3][j % 3] + a[j / 3][j % 3 + 1] + a[j / 3 + 1][j % 3] + a[j / 3 + 1][j % 3 + 1];
                tran(a, j / 3, j % 3);
                s2 = s2 + win(a, k - 1);
                if (s2 < s22) {
                    s22 = s2;
                }
                // cout<<s2<<" "<<s1<<" ";//
            }
            s = s1 + s22;
            // cout<<s<<endl;//
            if (s > sum)  // wch��������
            {
                sum = s;
            }
        }
        return sum;
    }
}
int main() {
    ll T, k, y, i, j;
    cin >> T >> k;
    ll a[T][4][4];
    for (y = 0; y < T; y++) {
        for (i = 0; i < 4; i++) {
            for (j = 0; j < 4; j++) cin >> a[y][i][j];
        }
    }
    for (y = 0; y < T - 1; y++) {
        cout << win(a[y], k) << endl;
    }
    cout << win(a[T - 1], k);
    return 0;
}
子任务 #1
Wrong Answer
得分:0
测试点 #1
Wrong Answer
得分:0
用时:12 ms
内存:412 KiB

输入文件(wch11.in

200
2
5   3   3   4  
5   4   9   6  
5   6   2   7  
10   9   7   3  
2
4   8   6   9  
5   8   3  
<13446 bytes omitted>

答案文件(wch11.out

94
84
51
76
79
143
139
72
144
136
81
152
113
134
99
52
155
99
49
82
56
122
113
<773 bytes omitted>

用户输出

94
94
51
86
61
85
89
80
79
84
96
84
101
75
81
88
101
104
90
93
89
112
88
73
79
85
90
81
75
73
86
85
84
78
92
74
99
96
95
92
101

<498 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

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

输入文件(wch12.in

200
2
6   1   8   10  
6   9   8   7  
5   4   2   2  
8   1   8   7  
2
8   4   7   4  
4   9   7  
<13433 bytes omitted>

答案文件(wch12.out

94
97
108
68
81
103
42
89
140
135
104
113
90
46
132
110
114
85
150
87
39
33
50
<790 bytes omitted>

用户输出

94
91
97
78
78
94
69
111
78
96
68
101
98
100
82
90
86
75
79
106
90
82
62
82
72
76
79
97
108
80
79
88
100
94
84
86
81
77
72
92
86
<500 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #3
Wrong Answer
得分:0
用时:694 ms
内存:408 KiB

输入文件(wch13.in

200
3
10   1   1   8  
3   3   9   7  
4   2   8   1  
7   8   3   8  
3
1   8   5   1  
8   9   10 
<13437 bytes omitted>

答案文件(wch13.out

116
132
102
42
86
46
155
86
92
83
48
98
62
45
147
45
147
128
97
44
148
69
74

<782 bytes omitted>

用户输出

116
130
131
118
125
129
154
117
133
105
134
137
132
112
130
148
134
147
131
153
124
138
134
113
119
138
126
110
97
144
138
129
1
<661 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

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

输入文件(wch14.in

200
3
3   10   3   9  
10   6   1   5  
6   9   8   4  
7   2   1   2  
3
4   5   9   5  
5   9   1 
<13429 bytes omitted>

答案文件(wch14.out

131
146
126
57
110
139
42
146
41
123
46
38
90
42
101
48
84
135
80
34
46
140
12
<784 bytes omitted>

用户输出

131
151
125
137
123
140
119
116
159
104
121
121
111
130
127
126
144
120
118
120
96
123
130
121
137
140
121
127
116
120
131
136
1
<662 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #5
Wrong Answer
得分:0
用时:585 ms
内存:400 KiB

输入文件(wch15.in

200
3
8   5   2   2  
8   9   5   1  
8   2   3   5  
6   9   1   10  
3
7   5   7   10  
7   7   7 
<13439 bytes omitted>

答案文件(wch15.out

120
126
118
132
86
80
86
115
121
82
49
136
186
77
45
147
153
104
146
79
144
54
<789 bytes omitted>

用户输出

120
120
117
123
114
101
136
135
133
120
120
120
163
146
109
153
142
153
167
143
127
120
136
134
157
133
120
97
156
144
103
146
1
<659 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

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

输入文件(wch16.in

200
1
2   4   4   10  
8   6   9   10  
7   10   9   5  
2   10   1   7  
3
4   4   3   2  
9   5   
<13415 bytes omitted>

答案文件(wch16.out

57
104
98
75
115
153
155
44
90
51
136
39
48
113
42
115
93
51
39
77
153
129
144
<771 bytes omitted>

用户输出

57
35
49
35
37
48
53
47
45
51
44
47
44
51
34
42
35
48
51
43
32
52
39
45
41
42
39
48
54
40
44
47
47
48
48
26
37
48
38
53
40
50
34
<471 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

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

输入文件(wch17.in

200
1
2   3   9   6  
4   1   4   6  
9   10   5   6  
2   4   10   5  
1
5   7   6   1  
7   9   6 
<13410 bytes omitted>

答案文件(wch17.out

40
39
39
33
118
144
67
131
101
129
158
44
166
154
47
84
87
110
107
41
43
119
4
<769 bytes omitted>

用户输出

40
39
35
37
40
37
39
38
39
49
39
52
37
51
55
42
40
44
59
54
45
38
43
38
45
40
49
49
40
49
46
42
41
41
36
33
40
41
44
46
34
42
45
<471 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

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

输入文件(wch18.in

200
2
5   9   10   4  
2   9   3   5  
9   5   5   2  
2   8   2   10  
1
2   9   7   7  
2   5   10
<13409 bytes omitted>

答案文件(wch18.out

97
46
129
75
131
111
96
158
82
35
119
47
86
67
70
126
49
103
165
46
37
90
43

<771 bytes omitted>

用户输出

97
84
84
89
88
74
80
102
79
84
74
74
86
83
68
60
82
99
73
118
80
69
84
84
76
95
94
82
97
82
89
88
56
90
100
98
96
78
101
110
73

<492 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

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

输入文件(wch19.in

200
2
10   2   7   10  
6   4   8   7  
1   10   5   3  
8   6   1   4  
2
3   2   3   3  
3   10   
<13388 bytes omitted>

答案文件(wch19.out

91
94
77
127
82
113
97
38
45
41
111
45
91
82
45
35
84
92
88
115
119
77
121
16
<767 bytes omitted>

用户输出

91
85
72
85
83
102
102
82
88
66
100
74
98
79
76
89
70
84
82
78
76
72
86
69
101
95
71
81
80
83
67
79
96
67
68
87
104
81
82
99
84

<496 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

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

输入文件(wch110.in

200
2
2   8   1   4  
4   9   3   9  
4   2   1   3  
9   4   3   1  
2
1   9   6   8  
2   1   5   
<13413 bytes omitted>

答案文件(wch110.out

66
63
155
118
88
96
38
151
47
128
70
149
40
117
46
94
49
161
93
37
76
157
39

<780 bytes omitted>

用户输出

66
59
105
90
97
72
95
82
89
87
75
82
93
89
66
94
93
97
114
105
84
76
113
74
101
81
68
109
91
97
96
92
73
80
80
81
76
75
94
79
97
<496 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0