跳到正文

Wangyixi007

1033244

ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็†(有兴趣加团62404)\24届初中牲\₯

在洛谷打开
资料、奖项与版本

资料

编号
1033244
抓取

奖项

2025 CSP-J
一等奖
2025 CSP-S
二等奖
2024 CSP-J
二等奖
2024 CSP-S
三等奖

emmmmmm

https://www.luogu.com/article/nnn0rfvd

LaTeX\LaTeX

https://oier.baoshuo.dev/

题解机

cpret.online

我的MC存档

↑点击这里得到我的mc存档

QAQ

《诈骗专家》

我的团队

原地tp

大佬牛逼

6

sb

ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็

666

高精度:

C++
struct BigInt {
    std::string num;
    bool isNegative;

    // 构造函数
    BigInt(const std::string& s = "0") {
        if (s[0] == '-') {
            isNegative = true;
            num = s.substr(1);
        } else {
            isNegative = false;
            num = s;
        }
        // 去除前导零
        while (num.length() > 1 && num[0] == '0') {
            num.erase(0, 1);
        }
        if (num == "0") {
            isNegative = false;
        }
    }

    // 重载输入运算符
    friend std::istream& operator>>(std::istream& is, BigInt& bi) {
        std::string s;
        is >> s;
        bi = BigInt(s);
        return is;
    }

    // 重载输出运算符
    friend std::ostream& operator<<(std::ostream& os, const BigInt& bi) {
        if (bi.isNegative && bi.num != "0") {
            os << '-';
        }
        os << bi.num;
        return os;
    }

    // 比较绝对值大小
    bool absGreater(const BigInt& other) const {
        if (num.length() != other.num.length()) {
            return num.length() > other.num.length();
        }
        return num > other.num;
    }

    // 重载比较运算符
    bool operator>(const BigInt& other) const {
        if (isNegative != other.isNegative) {
            return !isNegative;
        }
        if (isNegative) {
            return absGreater(other) ? false : true;
        }
        return absGreater(other);
    }

    bool operator<(const BigInt& other) const {
        return other > *this;
    }

    bool operator>=(const BigInt& other) const {
        return !(*this < other);
    }

    bool operator<=(const BigInt& other) const {
        return !(*this > other);
    }

    bool operator==(const BigInt& other) const {
        return isNegative == other.isNegative && num == other.num;
    }

    bool operator!=(const BigInt& other) const {
        return !(*this == other);
    }

    // 高精度加法
    BigInt operator+(const BigInt& other) const {
        if (isNegative == other.isNegative) {
            BigInt result;
            result.isNegative = isNegative;
            std::string a = num, b = other.num;
            std::reverse(a.begin(), a.end());
            std::reverse(b.begin(), b.end());
            int carry = 0;
            for (int i = 0; i < std::max(a.length(), b.length()) || carry; ++i) {
                if (i < a.length()) carry += a[i] - '0';
                if (i < b.length()) carry += b[i] - '0';
                result.num.push_back(carry % 10 + '0');
                carry /= 10;
            }
            std::reverse(result.num.begin(), result.num.end());
            return result;
        }
        if (isNegative) {
            return other - BigInt(num);
        }
        return *this - BigInt(other.num);
    }

    // 高精度减法
    BigInt operator-(const BigInt& other) const {
        if (isNegative == other.isNegative) {
            if (absGreater(other)) {
                BigInt result;
                result.isNegative = isNegative;
                std::string a = num, b = other.num;
                std::reverse(a.begin(), a.end());
                std::reverse(b.begin(), b.end());
                int borrow = 0;
                for (int i = 0; i < a.length(); ++i) {
                    int x = a[i] - '0' - borrow;
                    if (i < b.length()) x -= b[i] - '0';
                    if (x < 0) {
                        x += 10;
                        borrow = 1;
                    } else {
                        borrow = 0;
                    }
                    result.num.push_back(x + '0');
                }
                while (result.num.length() > 1 && result.num.back() == '0') {
                    result.num.pop_back();
                }
                std::reverse(result.num.begin(), result.num.end());
                return result;
            }
            BigInt result = other - *this;
            result.isNegative = !isNegative;
            return result;
        }
        if (isNegative) {
            BigInt result = BigInt(num) + other;
            result.isNegative = true;
            return result;
        }
        return *this + BigInt(other.num);
    }

    // 高精度乘法
    BigInt operator*(const BigInt& other) const {
        BigInt result("0");
        for (int i = other.num.length() - 1; i >= 0; --i) {
            BigInt temp;
            int carry = 0;
            for (int j = 0; j < other.num.length() - 1 - i; ++j) {
                temp.num.push_back('0');
            }
            for (int j = num.length() - 1; j >= 0; --j) {
                int mul = (num[j] - '0') * (other.num[i] - '0') + carry;
                temp.num.push_back(mul % 10 + '0');
                carry = mul / 10;
            }
            if (carry) {
                temp.num.push_back(carry + '0');
            }
            std::reverse(temp.num.begin(), temp.num.end());
            result = result + temp;
        }
        result.isNegative = isNegative != other.isNegative;
        return result;
    }

    // 高精度除法
    BigInt operator/(const BigInt& other) const {
        if (other == BigInt("0")) {
            throw std::runtime_error("Division by zero");
        }
        BigInt dividend = BigInt(num);
        BigInt divisor = BigInt(other.num);
        BigInt quotient("0");
        BigInt remainder("0");
        for (int i = 0; i < dividend.num.length(); ++i) {
            remainder = remainder * BigInt("10") + BigInt(std::string(1, dividend.num[i]));
            int count = 0;
            while (remainder >= divisor) {
                remainder = remainder - divisor;
                ++count;
            }
            quotient.num.push_back(count + '0');
        }
        // 去除前导零
        while (quotient.num.length() > 1 && quotient.num[0] == '0') {
            quotient.num.erase(0, 1);
        }
        quotient.isNegative = isNegative != other.isNegative;
        return quotient;
    }
};

f(x)=sin⁡(ax2+bx+c)⋅cos⁡(ax3+bx2+cx+d)f\left(x\right)=\sin\left(ax^{2}+bx+c\right)\cdot\cos\left(ax^{3}+bx^{2}+cx+d\right)

LaTeX\LaTeX

共 1 篇
  1. 题解

    【MX-X28-T1】「FAOI-R12」min*mex problem 题解

    Update on 2026.5.10:修改了一些意义不明的描述,感谢 @rui_er 提出建议。 初看可能会以为是 dp,但仔细一想会发现一个小性质:若一列数不按 [0,1,2,3,4,…,n] 排列,则 mexA=0,否则为 n+1,我们可以对其向下进行思考: 设集合 A=a…