//吃雪糕的其实很简单啊,先设想一下,如果没有3,全是1和2,那只要雪糕够用就随便吃,因为吃不冒,所以要解决3,看3的个数对2求余是否为1,若为0,则剩下的1和2还是随便吃,若为1,则需要看现在的1和2的数量能不能把这天补上,或者能不能不要这落单的3 #include<iostream> #include<string> #include<cmath> #include<vector> #include<algorithm> #include<queue> #include "stdlib.h" using namespace std; int main(){ int t; cin>>t; while(t--){  int n,a,b,c;  cin>>n>>a>>b>>c; if(a+2*b+c*3<n*6){      cout<<"No"<<endl;     }else{   if(c%2==0||c*3>=n*6){    cout<<"Yes"<<endl;   }   else{    if(a==0&&b!=0){     if(c*3+2*b-3>=n*6){      cout<<"Yes"<<endl;     }     else{      cout<<"No"<<endl;      }    }    else{    cout<<"Yes"<<endl;    }    }   } } }
点赞 评论

相关推荐

11-03 14:57
西北大学 营销
Belltrix:其实就是每根转动一定的角度
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务