题目链接:https://www.patest.cn/contests/gplt
第一个卡的题是“到底是不是太胖了”,当时以为卡精度,因为各种eps都过不了。。但是结束后队友说不卡精度,随便一个eps就过了- -,可能是代码写搓了。但是更好的方法是全部变成整数做来规避精度的问题。具体见代码:
1 #include <stdio.h> 2 #include <algorithm> 3 #include <string.h> 4 #include <vector> 5 #include <map> 6 #include <set> 7 #include <queue> 8 #include <iostream> 9 using namespace std; 10 const int inf = 0x3f3f3f3f; 11 typedef long long ll; 12 const int N = 500 + 5; 13 14 int main() 15 { 16 int T; 17 cin >> T; 18 while(T--) 19 { 20 int h,w; 21 cin >> h >> w; 22 int biaozhun = 2*(h-100); 23 if(w*100>biaozhun*9*9 && w*100<biaozhun*11*9) puts("You are wan mei!"); 24 else if(w*100>=biaozhun*11*9) puts("You are tai pang le!"); 25 else puts("You are tai shou le!"); 26 } 27 }