Upd: 移除了一些无用信息
This commit is contained in:
@ -1,40 +0,0 @@
|
|||||||
/*
|
|
||||||
Time: 2023-10-20
|
|
||||||
Test: Custom constructor. Div and mod.
|
|
||||||
std Time: 0.00s
|
|
||||||
Time Limit: 1.00s
|
|
||||||
Notes: Sanity check.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "int2048.h"
|
|
||||||
|
|
||||||
void sanity_check(sjtu::int2048 &x,sjtu::int2048 &y) {
|
|
||||||
// Sanity check of division
|
|
||||||
std::cout
|
|
||||||
<< x / y << ' '
|
|
||||||
<< -x / y << ' '
|
|
||||||
<< x / -y << ' '
|
|
||||||
<< -x / -y << '\n';
|
|
||||||
|
|
||||||
// Sanity check of mod
|
|
||||||
std::cout
|
|
||||||
<< x % y << ' '
|
|
||||||
<< -x % y << ' '
|
|
||||||
<< x % -y << ' '
|
|
||||||
<< -x % -y << '\n';
|
|
||||||
}
|
|
||||||
|
|
||||||
signed main() {
|
|
||||||
sjtu::int2048 x {"0000000000001145141919810"};
|
|
||||||
sjtu::int2048 y {"-1145141919810"};
|
|
||||||
|
|
||||||
y += 1;
|
|
||||||
sanity_check(x, y);
|
|
||||||
|
|
||||||
y += -2;
|
|
||||||
y -= -1;
|
|
||||||
|
|
||||||
sanity_check(x, y);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
@ -1,4 +0,0 @@
|
|||||||
-2 1 1 -2
|
|
||||||
-1145141919808 -1 1 1145141919808
|
|
||||||
-1 1 1 -1
|
|
||||||
0 0 0 0
|
|
@ -1,30 +0,0 @@
|
|||||||
/*
|
|
||||||
Time: 2023-10-20
|
|
||||||
Test: Custom constructor. Div and mod.
|
|
||||||
std Time: 0.00s
|
|
||||||
Time Limit: 1.00s
|
|
||||||
Notes: Sanity check.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "int2048.h"
|
|
||||||
|
|
||||||
void sanity_check(sjtu::int2048 &x) {
|
|
||||||
(0 / x).print(); std::cout << ' ';
|
|
||||||
(1 / x).print(); std::cout << ' ';
|
|
||||||
(-1 / x).print();std::cout << ' ';
|
|
||||||
|
|
||||||
(0 % x).print(); std::cout << ' ';
|
|
||||||
(1 % x).print(); std::cout << ' ';
|
|
||||||
(-1 % x).print();std::cout << '\n';
|
|
||||||
}
|
|
||||||
|
|
||||||
signed main() {
|
|
||||||
sjtu::int2048 x;
|
|
||||||
|
|
||||||
x.read("-1919810");
|
|
||||||
sanity_check(x);
|
|
||||||
|
|
||||||
x = -x;
|
|
||||||
sanity_check(x);
|
|
||||||
return 0;
|
|
||||||
}
|
|
@ -1,2 +0,0 @@
|
|||||||
0 -1 0 0 -1919809 -1
|
|
||||||
0 0 -1 0 1 1919809
|
|
@ -1,26 +0,0 @@
|
|||||||
/*
|
|
||||||
Time: 2023-10-20
|
|
||||||
Test: Copy constructor and assignment operator. Operator +,-.
|
|
||||||
std Time: 0.00s
|
|
||||||
Time Limit: 1.00s
|
|
||||||
Notes: Sanity check.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "int2048.h"
|
|
||||||
|
|
||||||
void sanity_check(sjtu::int2048 &x) {
|
|
||||||
x = x = x = x = x = x = x = x = x;
|
|
||||||
sjtu::int2048 y = (((((((((((((x)))))))))))));
|
|
||||||
sjtu::int2048 z = (((((((-(((((x))))))))))));
|
|
||||||
x = ( x = (x = (x = y + z + x)));
|
|
||||||
}
|
|
||||||
|
|
||||||
signed main() {
|
|
||||||
sjtu::int2048 x {"111111111111111111111111111111111111111111111111111111111111111111111111112"};
|
|
||||||
sanity_check(x);
|
|
||||||
std::cout << +(+(+(+x))) << '\n';
|
|
||||||
std::cout << - - -sjtu::int2048{0} << '\n';
|
|
||||||
x.read("-0");
|
|
||||||
std::cout << x << '\n';
|
|
||||||
return 0;
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
111111111111111111111111111111111111111111111111111111111111111111111111112
|
|
||||||
0
|
|
||||||
0
|
|
Reference in New Issue
Block a user