自测结果一毛一样为毛递交会报错😡

1 comments

  • @ 2025-4-21 1:06:41
    //自测过了递交错了说明其他隐藏的用例没有通过
    #include<iostream>
    using namespace std;
    int main(){
        int n;
        cin >> n;
        int a,b;
        cin >> a >> b;
        double x = (double)b / a;(先算鸡尾酒的)
        for(int i = 1;i < n; i++){
            int c,d;
            cin >> c >> d;
            double y = (double)d / c;(在for循环里计算剩下四次的)
            if(y - x > 0.05) cout << "better" << endl;
            else if(x - y > 0.05) cout << "worse" << endl;
            else cout << "same" << endl;
        }
        return 0;
    }
    
    • 1

    Information

    ID
    94
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    10
    Tags
    # Submissions
    5
    Accepted
    1
    Uploaded By