1 条题解

  • 1
    @ 2023-06-21 09:32:15
     Accepted
    正在同步测试数据,请稍后
    [Hydro](https://hydro.ac)提供评测服务
    #   状态  耗时  内存占用
    #1   Accepted   4ms 332.0 KiB
    #2   Accepted   4ms 412.0 KiB
    #3   Accepted   4ms 412.0 KiB
    #4   Accepted   4ms 412.0 KiB
    #5   Accepted   4ms 328.0 KiB
    #6   Accepted   4ms 412.0 KiB
    #7   Accepted   4ms 412.0 KiB
    #8   Accepted   4ms 412.0 KiB
    #9   Accepted   4ms 412.0 KiB
    #10  Accepted   3ms 412.0 KiB
    #11  Accepted   4ms 412.0 KiB
    #12  Accepted   3ms 412.0 KiB
    #13  Accepted   4ms 412.0 KiB
    #14  Accepted   3ms 412.0 KiB
    #15  Accepted   5ms 412.0 KiB
    #16  Accepted   4ms 412.0 KiB
    #17  Accepted   4ms 412.0 KiB
    #18  Accepted   4ms 412.0 KiB
    #19  Accepted   4ms 368.0 KiB
    #20  Accepted   4ms 360.0 KiB
    #21  Accepted   4ms 412.0 KiB
    #22  Accepted   4ms 412.0 KiB
    #23  Accepted   4ms 412.0 KiB
    #24  Accepted   4ms 372.0 KiB
    #25  Accepted   4ms 340.0 KiB
    #26  Accepted   4ms 412.0 KiB
    #27  Accepted   4ms 412.0 KiB
    #28  Accepted   4ms 312.0 KiB
    #29  Accepted   4ms 412.0 KiB
    #30  Accepted   4ms 412.0 KiB
    #31  Accepted   4ms 376.0 KiB
    #32  Accepted   4ms 328.0 KiB
    #33  Accepted   4ms 412.0 KiB
    #34  Accepted   4ms 352.0 KiB
    #35  Accepted   4ms 320.0 KiB
    #36  Accepted   4ms 412.0 KiB
    #37  Accepted   4ms 412.0 KiB
    #38  Accepted   4ms 420.0 KiB
    #39  Accepted   4ms 412.0 KiB
    #40  Accepted   4ms 328.0 KiB
    #41  Accepted   3ms 412.0 KiB
    #42  Accepted   4ms 412.0 KiB
    #43  Accepted   3ms 412.0 KiB
    #44  Accepted   3ms 412.0 KiB
    #45  Accepted   4ms 412.0 KiB
    #46  Accepted   4ms 312.0 KiB
    #47  Accepted   4ms 412.0 KiB
    #48  Accepted   4ms 412.0 KiB
    #49  Accepted   4ms 328.0 KiB
    #50  Accepted   4ms 412.0 KiB
    

    跑的飞快

    #include <bits/stdc++.h>
    using namespace std;
    // #define int long long
    #define yh ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
    int l,r,cnt=0;
    void c(int x)
    {
        while(x>0)
        {
            if(x%10==2)cnt++;
            x/=10;
        }
    }
    int main()
    {
        //   freopen("D:\\Vijos\\Input\\input0.txt","r",stdin);
        // freopen("D:\\Vijos\\Output\\output0.txt","w",stdout);
        yh;
        cin>>l>>r;
        for(int i = l;i <= r;i++)c(i);
        cout<<cnt;
        return 0;
    }
    
  • 1

信息

ID
2360
难度
9
分类
(无)
标签
(无)
递交数
1
已通过
1
通过率
100%
上传者