6 条题解

  • 0
    @ 2025-9-5 20:39:40

    已知,⌊lg⁡n⌋\lfloor\lg n\rfloor 所得到的结果就是 nn 的位数减 11。

    由于数据量过大,我们只能采用字符串输入的形式,而不能使用 long long。

    代码如下:

    // P2. [System Test] Common Logarithm
    // code by:cirrationaler
    // time:2025/08/21
    #include <bits/stdc++.h>
    
    using namespace std;
    
    string s;
    
    int main()
    {
        // freopen("code.in", "r", stdin);
        freopen("log.in", "r", stdin);
        freopen("log.out", "w", stdout);
        cin >> s;
        s.erase(s.end() - 1);
        cout << s.size();
        return 0;
    }
    
    

    信息

    ID
    2
    时间
    1000ms
    内存
    512MiB
    难度
    2
    标签
    递交数
    118
    已通过
    25
    上传者