2 条题解

  • 1
    @ 2024-1-4 19:21:27

    这么简单的题,那就用数学的方法来做啦

    #include<bits/stdc++.h>
    
    using namespace std;
    
    int main()
    
    {
    
        //freopen(".in","r",stdin);
    
        //freopen(".out","w",stdout);
    
        int head,leg;
    
        cin>>head>>leg;
    
        int t=(leg-2*head)/2;
    
        cout<<head-t<<" "<<t;
    
        return 0;
    
    }
    

    信息

    ID
    111
    时间
    1000ms
    内存
    256MiB
    难度
    1
    标签
    (无)
    递交数
    142
    已通过
    83
    上传者