1 条题解

  • 0
    @ 2024-8-2 16:19:44

    C++ :

    #include<bits/stdc++.h>
    using namespace std;
    
    int main() {
        int a,b;
        cin>>a>>b;
        if(a%2==0&&b%2!=0){
            cout<<(b-a)/2+2;
        }else{
            cout<<(b-a)/2+1;
        }
        return 0;
    }
    
    
    • 1

    信息

    ID
    1009
    时间
    1000ms
    内存
    128MiB
    难度
    10
    标签
    递交数
    3
    已通过
    2
    上传者