MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / test

Function test

code/mathematics/crt.test.cpp:1–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1void test() {
2 /* Field testing: Kattis CRT, Kattis generalchineseremainder, Kattis solarly */
3
4 vector<ll> as, ns;
5
6 as.clear();
7 as.push_back(2);
8 as.push_back(3);
9 as.push_back(1);
10 ns.clear();
11 ns.push_back(3);
12 ns.push_back(4);
13 ns.push_back(5);
14 assert_equal(11LL, crt(as, ns));
15 assert_true(make_pair(11LL, 3*4*5LL) == gcrt(as, ns));
16
17 as.clear();
18 as.push_back(23);
19 as.push_back(12);
20 as.push_back(55);
21 ns.clear();
22 ns.push_back(11);
23 ns.push_back(21);
24 ns.push_back(31);
25 assert_equal(5325LL, crt(as, ns));
26 assert_true(make_pair(5325LL,11*21*31LL) == gcrt(as, ns));
27}
28// vim: cc=60 ts=2 sts=2 sw=2:

Callers

nothing calls this directly

Calls 6

crtFunction · 0.85
assert_trueFunction · 0.85
gcrtFunction · 0.85
push_backMethod · 0.80
assert_equalFunction · 0.50
clearMethod · 0.45

Tested by

no test coverage detected