0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-23 21:28:48 +00:00

fix(templates/BigInt): add != operator

This commit is contained in:
Baoshuo Ren 2022-01-22 09:26:43 +08:00
parent 552b92d595
commit 1feb2670c5
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

View File

@ -7,9 +7,8 @@ class BigInt {
int sign;
std::string s;
BigInt() {
s = "";
}
BigInt()
: s("") {}
BigInt(std::string x) {
*this = x;
@ -44,6 +43,10 @@ class BigInt {
return (s == x.s && sign == x.sign);
}
bool operator!=(const BigInt& x) const {
return (s != x.s || sign != x.sign);
}
bool operator<(const BigInt& x) const {
if (sign != x.sign) {
return sign < x.sign;