test/cpv_local/io/fio.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // competitive-verifier: STANDALONE | ||
| 2 | |||
| 3 | #include "../../../src/io/fastin/lib.hpp" | ||
| 4 | #include "../../../src/io/fastout/lib.hpp" | ||
| 5 | #include "../../../src/io/i128/lib.hpp" | ||
| 6 | #include "../base.hpp" | ||
| 7 | |||
| 8 | using namespace tifa_libs; | ||
| 9 | |||
| 10 | strn fn_in = "test/cpv_local/_data/others/io/io.in"; | ||
| 11 | strn fn_ans = "test/cpv_local/_data/others/io/io.out"; | ||
| 12 | |||
| 13 | template <class T> | ||
| 14 | 8 | void single_test() { | |
| 15 | 8 | CEXP T MIN = [] { | |
| 16 | if CEXP (imost64_c<T>) return std::numeric_limits<T>::min(); | ||
| 17 | else if (sint_c<T>) return (T)1 << (sizeof(T) * 8 - 1); | ||
| 18 | else return (T)0; | ||
| 19 | }(), | ||
| 20 | 8 | MAX = (T)~MIN; | |
| 21 | |||
| 22 | T x; | ||
| 23 | FILE* f; | ||
| 24 | |||
| 25 |
8/16void single_test<__int128>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<int>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<long>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<short>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<unsigned __int128>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<unsigned int>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<unsigned long>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<unsigned short>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
|
8 | f = fopen(fn_in.c_str(), "w"); |
| 26 | 8 | fout.rebind(f); | |
| 27 | 8 | fout << MIN; | |
| 28 | 8 | fout.flush(); | |
| 29 | 8 | fout.rebind(stdout); | |
| 30 |
8/16void single_test<__int128>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<int>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<long>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<short>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<unsigned __int128>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<unsigned int>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<unsigned long>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<unsigned short>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
|
8 | fclose(f); |
| 31 |
8/16void single_test<__int128>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<int>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<long>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<short>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<unsigned __int128>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<unsigned int>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<unsigned long>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<unsigned short>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
|
8 | f = fopen(fn_in.c_str(), "r"); |
| 32 | 8 | fid_stdin.rebind(f); | |
| 33 | 8 | fin >> x; | |
| 34 | 8 | fid_stdin.rebind(stdin); | |
| 35 |
8/16void single_test<__int128>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<int>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<long>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<short>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<unsigned __int128>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<unsigned int>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<unsigned long>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<unsigned short>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
|
8 | fclose(f); |
| 36 |
8/16void single_test<__int128>():
✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
void single_test<int>():
✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
void single_test<long>():
✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
void single_test<short>():
✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
void single_test<unsigned __int128>():
✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
void single_test<unsigned int>():
✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
void single_test<unsigned long>():
✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
void single_test<unsigned short>():
✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
|
8 | check(x, MIN); |
| 37 | |||
| 38 |
8/16void single_test<__int128>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<int>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<long>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<short>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<unsigned __int128>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<unsigned int>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<unsigned long>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<unsigned short>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
|
8 | f = fopen(fn_in.c_str(), "w"); |
| 39 | 8 | fout.rebind(f); | |
| 40 | 8 | fout << MAX; | |
| 41 | 8 | fout.flush(); | |
| 42 | 8 | fout.rebind(stdout); | |
| 43 |
8/16void single_test<__int128>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<int>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<long>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<short>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<unsigned __int128>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<unsigned int>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<unsigned long>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<unsigned short>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
|
8 | fclose(f); |
| 44 |
8/16void single_test<__int128>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<int>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<long>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<short>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<unsigned __int128>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<unsigned int>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<unsigned long>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
void single_test<unsigned short>():
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
|
8 | f = fopen(fn_in.c_str(), "r"); |
| 45 | 8 | fid_stdin.rebind(f); | |
| 46 | 8 | fin >> x; | |
| 47 | 8 | fid_stdin.rebind(stdin); | |
| 48 |
8/16void single_test<__int128>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<int>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<long>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<short>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<unsigned __int128>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<unsigned int>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<unsigned long>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
void single_test<unsigned short>():
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
|
8 | fclose(f); |
| 49 |
8/16void single_test<__int128>():
✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
void single_test<int>():
✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
void single_test<long>():
✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
void single_test<short>():
✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
void single_test<unsigned __int128>():
✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
void single_test<unsigned int>():
✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
void single_test<unsigned long>():
✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
void single_test<unsigned short>():
✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
|
8 | check(x, MAX); |
| 50 | 8 | } | |
| 51 | |||
| 52 | 1 | int main() { | |
| 53 |
3/6✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 time.
✗ Branch 11 not taken.
|
1 | timer_(single_test<i16>()); |
| 54 |
3/6✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 time.
✗ Branch 11 not taken.
|
1 | timer_(single_test<u16>()); |
| 55 |
3/6✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 time.
✗ Branch 11 not taken.
|
1 | timer_(single_test<i32>()); |
| 56 |
3/6✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 time.
✗ Branch 11 not taken.
|
1 | timer_(single_test<u32>()); |
| 57 |
3/6✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 time.
✗ Branch 11 not taken.
|
1 | timer_(single_test<i64>()); |
| 58 |
3/6✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 time.
✗ Branch 11 not taken.
|
1 | timer_(single_test<u64>()); |
| 59 |
3/6✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 time.
✗ Branch 11 not taken.
|
1 | timer_(single_test<i128>()); |
| 60 |
3/6✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 time.
✗ Branch 11 not taken.
|
1 | timer_(single_test<u128>()); |
| 61 | 1 | } | |
| 62 |