typedef struct {
long
long
int
key[
24
];
long
long
int
L[
8
];
long
long
int
R[
8
];
long
long
int
X[
8
];
} exp;
int
main() {
exp var22;
exp var23;
exp var24;
exp var25;
var22.L[
0
]
=
0
;
var22.R[
0
]
=
8
;
var22.X[
0
]
=
11
;
var22.L[
1
]
=
15
;
var22.R[
1
]
=
23
;
var22.X[
1
]
=
-
13
;
var22.L[
2
]
=
2
;
var22.R[
2
]
=
11
;
var22.X[
2
]
=
17
;
var22.L[
3
]
=
10
;
var22.R[
3
]
=
20
;
var22.X[
3
]
=
-
19
;
var22.L[
4
]
=
6
;
var22.R[
4
]
=
13
;
var22.X[
4
]
=
23
;
var22.L[
5
]
=
9
;
var22.R[
5
]
=
21
;
var22.X[
5
]
=
-
29
;
var22.L[
6
]
=
1
;
var22.R[
6
]
=
19
;
var22.X[
6
]
=
31
;
var22.L[
7
]
=
4
;
var22.R[
7
]
=
17
;
var22.X[
7
]
=
-
37
;
var23.key[
0
]
=
252
;
var23.key[
1
]
=
352
;
var23.key[
2
]
=
484
;
var23.key[
3
]
=
470
;
var23.key[
4
]
=
496
;
var23.key[
5
]
=
487
;
var23.key[
6
]
=
539
;
var23.key[
7
]
=
585
;
var23.key[
8
]
=
447
;
var23.key[
9
]
=
474
;
var23.key[
10
]
=
577
;
var23.key[
11
]
=
454
;
var23.key[
12
]
=
466
;
var23.key[
13
]
=
345
;
var23.key[
14
]
=
344
;
var23.key[
15
]
=
486
;
var23.key[
16
]
=
501
;
var23.key[
17
]
=
423
;
var23.key[
18
]
=
490
;
var23.key[
19
]
=
375
;
var23.key[
20
]
=
257
;
var23.key[
21
]
=
203
;
var23.key[
22
]
=
265
;
var23.key[
23
]
=
125
;
/
/
初始化
for
(
int
i
=
0
; i <
24
; i
+
+
) {
var22.key[
23
-
i]
=
input
[i];
}
for
(
int
i
=
23
; i >
0
; i
-
-
) {
var22.key[i]
=
var22.key[i]
-
var22.key[i
-
1
];
}
/
/
对flag加密
for
(
int
i
=
0
; i <
8
; i
+
+
) {
var22.key[var22.L[i]]
+
=
var22.X[i];
var22.key[var22.R[i]]
-
=
var22.X[i];
}
for
(
int
i
=
1
; i <
24
; i
+
+
) {
var22.key[i]
+
=
var22.key[i
-
1
];
}
/
/
对var23密文进行运算
for
(
int
i
=
23
; i >
0
; i
-
-
) {
var23.key[i]
-
=
var23.key[i
-
1
];
}
for
(
int
i
=
0
; i <
8
; i
+
+
) {
var23.key[var22.L[i]]
-
=
var22.key[i
*
3
];
var23.key[var22.R[i]]
+
=
var22.key[i
*
3
];
}
for
(
int
i
=
1
; i <
24
; i
+
+
) {
var23.key[i]
+
=
var23.key[i
-
1
];
}
/
/
比较密文和输入flag的密文
for
(
int
i
=
0
; i <
24
; i
+
+
) {
if
(var22.key[i] !
=
var23.key[i]) {
exit;
/
/
不相等则退出
}
}
return
0
;
}