P5315 头像上传 题解

Doveqise

2019-04-20 18:31:56

Solution

这道题,一道模拟题...机房巨佬调半天...(while写错了 (幸亏我一遍就A了 接下来解释代码 ```cpp #include<bits/stdc++.h> using namespace std; int n,l,g; void solve(int w,int h){ if(l>min(w,h)){puts("Too Young");return;}//尺寸过小 if(g>=max(w,h))/*符合条件*/{puts(w==h/*判断是否相等*/?"Sometimes Naive":"Too Simple");return;} solve(w>>1,h>>1);//裁剪照片 } signed main(){ scanf("%d%d%d",&n,&l,&g); while(n--){int w,h;scanf("%d%d",&w,&h);solve(w,h);} return 0; } ```