-
Notifications
You must be signed in to change notification settings - Fork 0
/
expr.c
117 lines (115 loc) · 5.78 KB
/
expr.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#include "io.inc"
// This file use massive recursive expression to test: Common Expression
// substitution. For my optimized version: All: 1397 Load:
// 86 Store: 55 Jumped: 23 For my unoptimized version: All: 24519
// Load: 12183 Store: 55 Jumped: 23 A better result is welcomed. ------
// From JinTianxing.
int A = 1;
int B = 1;
int C = 1;
int main() {
while (C < (1 << 29) && C > -(1 << 29)) {
A = ((((((((C - A + B) - (A + B)) + ((C - A + B) - (A + B))) +
(((C - A + B) - (A + B)) + (C - A + B))) -
((((A + B) + (C - A + B)) - (A + B)) +
(((C - A + B) - (A + B)) + (C - A + B)))) -
(((((A + B) + (C - A + B)) - ((A + B) + (C - A + B))) -
(((A + B) + (C - A + B)) - (A + B))) +
((((C - A + B) - (A + B)) + (C - A + B)) -
(((A + B) + (C - A + B)) - (A + B))))) +
((((((C - A + B) - (A + B)) + ((C - A + B) - (A + B))) +
(((C - A + B) - (A + B)) + (C - A + B))) -
((((A + B) + (C - A + B)) - (A + B)) +
(((C - A + B) - (A + B)) + (C - A + B)))) -
(((((A + B) + (C - A + B)) - (A + B)) +
(((C - A + B) - (A + B)) + (C - A + B))) -
((((A + B) + (C - A + B)) - (A + B)) +
(((C - A + B) - (A + B)) + (C - A + B)))))) -
(((((((A + B) + (C - A + B)) - ((A + B) + (C - A + B))) -
(((A + B) + (C - A + B)) - (A + B))) +
((((C - A + B) - (A + B)) + (C - A + B)) -
(((A + B) + (C - A + B)) - (A + B)))) +
(((((C - A + B) - (A + B)) + (C - A + B)) -
(((A + B) + (C - A + B)) - (A + B))) +
((((C - A + B) - (A + B)) + (C - A + B)) -
(((A + B) + (C - A + B)) - (A + B))))) +
((((((C - A + B) - (A + B)) + ((C - A + B) - (A + B))) +
(((C - A + B) - (A + B)) + (C - A + B))) -
((((A + B) + (C - A + B)) - (A + B)) +
(((C - A + B) - (A + B)) + (C - A + B)))) -
(((((A + B) + (C - A + B)) - (A + B)) +
(((C - A + B) - (A + B)) + (C - A + B))) -
((((A + B) + (C - A + B)) - (A + B)) +
(((C - A + B) - (A + B)) + (C - A + B)))))));
B = ((((((((C - A + B) - (A + B)) + ((C - A + B) - (A + B))) +
(((C - A + B) - (A + B)) + (C - A + B))) -
((((A + B) + (C - A + B)) - (A + B)) +
(((C - A + B) - (A + B)) + (C - A + B)))) -
(((((A + B) + (C - A + B)) - ((A + B) + (C - A + B))) -
(((A + B) + (C - A + B)) - (A + B))) +
((((C - A + B) - (A + B)) + (C - A + B)) -
(((A + B) + (C - A + B)) - (A + B))))) +
((((((C - A + B) - (A + B)) + ((C - A + B) - (A + B))) +
(((C - A + B) - (A + B)) + (C - A + B))) -
((((A + B) + (C - A + B)) - (A + B)) +
(((C - A + B) - (A + B)) + (C - A + B)))) -
(((((A + B) + (C - A + B)) - (A + B)) +
(((C - A + B) - (A + B)) + (C - A + B))) -
((((A + B) + (C - A + B)) - (A + B)) +
(((C - A + B) - (A + B)) + (C - A + B)))))) -
(((((((A + B) + (C - A + B)) - ((A + B) + (C - A + B))) -
(((A + B) + (C - A + B)) - (A + B))) +
((((C - A + B) - (A + B)) + (C - A + B)) -
(((A + B) + (C - A + B)) - (A + B)))) +
(((((C - A + B) - (A + B)) + (C - A + B)) -
(((A + B) + (C - A + B)) - (A + B))) +
((((C - A + B) - (A + B)) + (C - A + B)) -
(((A + B) + (C - A + B)) - (A + B))))) +
((((((C - A + B) - (A + B)) + ((C - A + B) - (A + B))) +
(((C - A + B) - (A + B)) + (C - A + B))) -
((((A + B) + (C - A + B)) - (A + B)) +
(((C - A + B) - (A + B)) + (C - A + B)))) -
(((((A + B) + (C - A + B)) - (A + B)) +
(((C - A + B) - (A + B)) + (C - A + B))) -
((((A + B) + (C - A + B)) - (A + B)) +
(((C - A + B) - (A + B)) + (C - A + B)))))));
C = ((((((((C - A + B) - (A + B)) + ((C - A + B) - (A + B))) +
(((C - A + B) - (A + B)) + (C - A + B))) -
((((A + B) + (C - A + B)) - (A + B)) +
(((C - A + B) - (A + B)) + (C - A + B)))) -
(((((A + B) + (C - A + B)) - ((A + B) + (C - A + B))) -
(((A + B) + (C - A + B)) - (A + B))) +
((((C - A + B) - (A + B)) + (C - A + B)) -
(((A + B) + (C - A + B)) - (A + B))))) +
((((((C - A + B) - (A + B)) + ((C - A + B) - (A + B))) +
(((C - A + B) - (A + B)) + (C - A + B))) -
((((A + B) + (C - A + B)) - (A + B)) +
(((C - A + B) - (A + B)) + (C - A + B)))) -
(((((A + B) + (C - A + B)) - (A + B)) +
(((C - A + B) - (A + B)) + (C - A + B))) -
((((A + B) + (C - A + B)) - (A + B)) +
(((C - A + B) - (A + B)) + (C - A + B)))))) -
(((((((A + B) + (C - A + B)) - ((A + B) + (C - A + B))) -
(((A + B) + (C - A + B)) - (A + B))) +
((((C - A + B) - (A + B)) + (C - A + B)) -
(((A + B) + (C - A + B)) - (A + B)))) +
(((((C - A + B) - (A + B)) + (C - A + B)) -
(((A + B) + (C - A + B)) - (A + B))) +
((((C - A + B) - (A + B)) + (C - A + B)) -
(((A + B) + (C - A + B)) - (A + B))))) +
((((((C - A + B) - (A + B)) + ((C - A + B) - (A + B))) +
(((C - A + B) - (A + B)) + (C - A + B))) -
((((A + B) + (C - A + B)) - (A + B)) +
(((C - A + B) - (A + B)) + (C - A + B)))) -
(((((A + B) + (C - A + B)) - (A + B)) +
(((C - A + B) - (A + B)) + (C - A + B))) -
((((A + B) + (C - A + B)) - (A + B)) +
(((C - A + B) - (A + B)) + (C - A + B)))))));
}
printInt(A);
// print(" ");
printInt(B);
// print(" ");
printInt(C);
return judgeResult % Mod; // 58
}