-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathtest.cpp
More file actions
58 lines (45 loc) · 1005 Bytes
/
test.cpp
File metadata and controls
58 lines (45 loc) · 1005 Bytes
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
template<typename T> void mod(T value);
const int c1 = 42;
const int c2 = 43;
void m(int i, bool cond, int x, int y) {
int eq = i + 3;
int mul = eq * c1 + 3; // congruent 3 mod 42
int seven = 7;
if (mul % c2 == seven) {
mod(mul); // $ mod=0,3,42
}
int j = cond
? i * 4 + 3
: i * 8 + 7;
mod(j); // $ mod=0,3,4
if (x % c1 == 3 && y % c1 == 7) {
mod(x + y); // $ mod=0,10,42
}
if (x % c1 == 3 && y % c1 == 7) {
mod(x - y); // $ mod=0,38,42
}
if (cond) {
j = i * 4 + 3;
}
else {
j = i * 8 + 7;
}
mod(j); // $ mod=0,3,4
if (cond) {
mod(j); // $ mod=0,3,4
} else {
mod(j); // $ mod=0,3,4
}
if ((x & 15) == 3) {
mod(x); // $ mod=0,3,16
}
}
void loops(int cap)
{
for (int i = 0; i < cap; i++)
mod(i);
for (int j = 0; j < cap; j += 1)
mod(j);
for (int k = 0; k < cap; k += 3)
mod(k); // $ mod=0,0,3
}