感觉这题好像有点数学
2025-02-19 18:01:37
发布于:北京
3阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int t;
cin >> t;
while(t--){
int x, y, a, b;
cin >> x >> y >> a >> b;
int v_need = ceil(b * 1.0 / x);// 这里是算出SHERRY打败魔王所需次数
if ((v_need - 1) * a < y){
cout << "victory\n";
} else {
cout << "defeat\n";
}
// 如果能在需打败魔王次数前抗住所有魔王攻击,那就是victory,否则defeat
}
return 0;
}
有没有人看看这段代码是碰巧AC的吗?
这里空空如也
有帮助,赞一个