- 练30.1 鸡尾酒疗法
please tell me why
- 2025-4-16 20:08:38 @
自测结果一毛一样为毛递交会报错😡
1 comments
-
3149991033 LV 8 @ 2025-4-21 1:06:41Edited
//自测过了递交错了说明其他隐藏的用例没有通过 #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