编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#45695 #1153. wch和zxh的游♂戏 Wrong Answer 0 6144 ms 2468 K C++ / 5.4 K 233nihao 2020-08-03 21:31:58
显示原始代码
#include <stdio.h>
#include <iostream>
using namespace std;
int maxsum(int k);
int min(int a, int b) {
    if (a > b)
        return b;
    if (b >= a)
        return a;
}
int max(int a, int b) {
    if (a > b)
        return a;
    if (b >= a)
        return b;
}
int a[4][4] = { 0 };
int s[4][4] = { 0 };
int xuanzhuan(int k) {
    int x = k / 3;
    int y = k % 3;

    int temp = a[x][y];
    a[x][y] = a[x + 1][y];
    a[x + 1][y] = a[x + 1][y + 1];
    a[x + 1][y + 1] = a[x][y + 1];
    a[x][y + 1] = temp;

    return 0;
}

int jisuan(int s) {
    int x = s / 3;
    int y = s % 3;
    int k = a[x][y] + a[x + 1][y] + a[x + 1][y + 1] + a[x][y + 1];
    return k;
}
int mini(int k) {
    int m = 0;
    for (int i = 0; i < 9; i++) {
    }
    return m;
}
int nihao[9][9][9][9][9][9] = { 0 };

int main() {
    int a1, a2, a3, a4, a5, a6;
    int huiheshu;
    int l;
    int mm[200];
    int cishu;
    cin >> cishu;
    for (int d = 0; d < cishu; d++) {
        cin >> huiheshu;
        for (int j = 0; j < 4; j++) {
            for (int i = 0; i < 4; i++) {
                cin >> a[i][j];
                s[i][j] = a[i][j];
            }
        }

        if (huiheshu == 3) {
            for (a1 = 0; a1 < 9; a1++) {
                for (a2 = 0; a2 < 9; a2++) {
                    for (a3 = 0; a3 < 9; a3++) {
                        for (a4 = 0; a4 < 9; a4++) {
                            for (a5 = 0; a5 < 9; a5++) {
                                for (a6 = 0; a6 < 9; a6++) {
                                    l = l + jisuan(a1);
                                    xuanzhuan(a1);
                                    l = l + jisuan(a2);
                                    xuanzhuan(a2);
                                    l = l + jisuan(a3);
                                    xuanzhuan(a3);
                                    l = l + jisuan(a4);
                                    xuanzhuan(a4);
                                    l = l + jisuan(a5);
                                    xuanzhuan(a5);
                                    nihao[a1][a2][a3][a4][a5][a6] = jisuan(a6) + l;
                                    l = 0;
                                    for (int i = 0; i < 4; i++) {
                                        for (int j = 0; j < 4; j++) {
                                            a[i][j] = s[i][j];
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            if (huiheshu == 3) {
                for (a1 = 0; a1 < 9; a1++) {
                    for (a2 = 0; a2 < 9; a2++) {
                        for (a3 = 0; a3 < 9; a3++) {
                            for (a4 = 0; a4 < 9; a4++) {
                                for (a5 = 0; a5 < 9; a5++) {
                                    for (a6 = 0; a6 < 9; a6++) {
                                        nihao[a1][a2][a3][a4][a5][0] =
                                            min(nihao[a1][a2][a3][a4][a5][0], nihao[a1][a2][a3][a4][a5][a6]);
                                    }
                                    nihao[a1][a2][a3][a4][0][0] =
                                        max(nihao[a1][a2][a3][a4][a5][0], nihao[a1][a2][a3][a4][a5][0]);
                                }
                                nihao[a1][a2][a3][0][0][0] =
                                    min(nihao[a1][a2][a3][a4][a5][0], nihao[a1][a2][a3][a4][0][0]);
                            }
                            nihao[a1][a2][0][0][0][0] =
                                max(nihao[a1][a2][a3][a4][a5][0], nihao[a1][a2][a3][0][0][0]);
                        }
                        nihao[a1][0][0][0][0][0] = min(nihao[a1][a2][a3][0][0][0], nihao[a1][a2][0][0][0][0]);
                    }
                    nihao[0][0][0][0][0][0] = max(nihao[a1][0][0][0][0][0], nihao[0][0][0][0][0][0]);
                }
            }
            mm[d] = nihao[0][0][0][0][0][0];
        }
        if (huiheshu == 2) {
            for (a1 = 0; a1 < 9; a1++) {
                for (a2 = 0; a2 < 9; a2++) {
                    for (a3 = 0; a3 < 9; a3++) {
                        for (a4 = 0; a4 < 9; a4++) {
                            l = l + jisuan(a1);
                            xuanzhuan(a1);
                            l = l + jisuan(a2);
                            xuanzhuan(a2);
                            l = l + jisuan(a3);
                            xuanzhuan(a3);
                            nihao[a1][a2][a3][a4][0][0] = jisuan(a4) + l;
                            l = 0;
                            for (int i = 0; i < 4; i++) {
                                for (int j = 0; j < 4; j++) {
                                    a[i][j] = s[i][j];
                                }
                            }
                        }
                    }
                }
            }
            if (huiheshu == 2) {
                for (a1 = 0; a1 < 9; a1++) {
                    for (a2 = 0; a2 < 9; a2++) {
                        for (a3 = 0; a3 < 9; a3++) {
                            for (a4 = 0; a4 < 9; a4++) {
                                nihao[a1][a2][a3][0][0][0] =
                                    min(nihao[a1][a2][a3][a4][0][0], nihao[a1][a2][a3][0][0][0]);
                            }
                            nihao[a1][a2][0][0][0][0] =
                                max(nihao[a1][a2][a3][a4][a5][0], nihao[a1][a2][a3][0][0][0]);
                        }
                        nihao[a1][0][0][0][0][0] = min(nihao[a1][a2][a3][0][0][0], nihao[a1][a2][0][0][0][0]);
                    }
                    nihao[0][0][0][0][0][0] = max(nihao[a1][0][0][0][0][0], nihao[0][0][0][0][0][0]);
                }
            }
            mm[d] = nihao[0][0][0][0][0][0];
        }

        if (huiheshu == 1) {
            for (a1 = 0; a1 < 9; a1++) {
                for (a2 = 0; a2 < 9; a2++) {
                    l = l + jisuan(a1);
                    xuanzhuan(a1);

                    nihao[a1][a2][0][0][0][0] = jisuan(a2) + l;

                    l = 0;
                    for (int i = 0; i < 4; i++) {
                        for (int j = 0; j < 4; j++) {
                            a[i][j] = s[i][j];
                        }
                    }
                }
            }
            if (huiheshu == 1) {
                for (a1 = 0; a1 < 9; a1++) {
                    for (a2 = 0; a2 < 9; a2++) {
                        nihao[a1][0][0][0][0][0] = min(nihao[a1][0][0][0][0][0], nihao[a1][a2][0][0][0][0]);
                    }
                    nihao[0][0][0][0][0][0] = max(nihao[a1][0][0][0][0][0], nihao[0][0][0][0][0][0]);
                }
            }
            mm[d] = nihao[0][0][0][0][0][0];
        }
    }
    for (int i = 0; i < cishu; i++) {
        cout << mm[i] << endl;
    }

    return 0;
}
子任务 #1
Wrong Answer
得分:0
测试点 #1
Wrong Answer
得分:0
用时:533 ms
内存:2404 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>

用户输出

82
98
63
105
84
126
148
102
151
164
89
169
138
183
98
52
163
101
49
103
56
130
99
134
79
156
36
84
53
108
135
36
46
153
60
124
4
<561 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #2
Wrong Answer
得分:0
用时:678 ms
内存:2468 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>

用户输出

93
106
111
82
90
110
42
92
125
143
71
104
98
46
155
135
126
93
151
85
39
33
50
38
160
45
182
84
70
159
97
130
125
43
84
82
40
99
<571 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #3
Wrong Answer
得分:0
用时:710 ms
内存:2456 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>

用户输出

136
161
100
42
95
46
182
79
110
76
48
93
63
45
144
45
159
137
94
44
169
94
75
145
43
149
77
89
124
105
149
119
114
45
102
38
185
<565 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #4
Wrong Answer
得分:0
用时:695 ms
内存:2424 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>

用户输出

164
154
143
57
105
174
42
136
41
122
46
38
83
42
101
48
79
129
95
34
46
149
135
178
48
47
40
75
127
47
43
68
106
104
136
54
108

<565 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #5
Wrong Answer
得分:0
用时:671 ms
内存:2404 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>

用户输出

175
149
132
118
89
72
113
122
149
99
49
142
218
73
45
147
158
132
177
91
136
54
140
151
169
40
158
107
71
53
135
53
114
98
98
12
<583 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #6
Wrong Answer
得分:0
用时:553 ms
内存:2420 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
128
118
117
161
158
170
44
90
51
134
39
48
125
42
146
100
51
39
75
188
134
153
154
100
124
131
178
109
94
114
44
100
30
84
16
<564 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #7
Wrong Answer
得分:0
用时:541 ms
内存:2420 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
39
33
111
124
66
155
89
152
168
44
185
145
47
106
112
131
101
41
43
155
44
54
123
55
47
42
50
123
40
134
81
108
112
141
11
<558 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #8
Wrong Answer
得分:0
用时:532 ms
内存:2416 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>

用户输出

109
46
145
103
167
135
89
161
78
35
128
47
87
93
88
114
49
114
183
46
37
95
43
46
55
115
92
139
50
145
29
102
89
164
129
100
45

<555 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #9
Wrong Answer
得分:0
用时:484 ms
内存:2464 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>

用户输出

98
93
90
148
83
129
120
38
45
41
128
45
109
91
45
35
81
96
98
135
110
99
114
221
121
44
140
44
84
42
76
70
72
136
106
86
86
117

<550 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #10
Wrong Answer
得分:0
用时:747 ms
内存:2412 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>

用户输出

81
68
188
126
107
89
38
166
47
112
62
140
40
153
46
96
49
183
115
37
106
203
39
85
74
80
160
123
50
137
118
34
108
48
96
92
50
9
<571 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0