题解 P5315 【头像上传】
本题就是按照题目模拟, 只是要注意一些细节问题。
看代码注释
#include<bits/stdc++.h>
using namespace std;
int n,l,g,i;
int main(){
cin>>n>>l>>g;
for(i=1;i<=n;i++){
int x,y;
cin>>x>>y;
while(x>g||y>g){//如果长度大于g,则除二并向下取整
x=floor(x/2);//向下取整函数:floor
y=floor(y/2);
}
if(x<l||y<l){//如果有一边小于l
cout<<"Too Young"<<endl;
continue;
}else if(x!=y){//如果都一边小于l但是不是正方形
cout<<"Too Simple"<<endl;
continue;
}else {//如果都一边小于l但是是正方形
cout<<"Sometimes Naive"<<endl;
continue;
}
}
return 0;//华丽丽的结束
}