5 条题解
- 1
信息
- ID
- 2171
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 1
- 标签
- 递交数
- 184
- 已通过
- 92
- 上传者
#include<bits/stdc++.h>
using namespace std;
int main()
{ int a,z,s,x,d;
cin>>a>>s>>z>>x;
d=a*2+s*5+z*3;
if(d<=x){
cout<<"Yes"<<endl<<x-d;
}
else{
cout<<"No"<<endl<<d-x;
}
return 0;
}
#include <bits/stdc++.h>
using namespace std;
int main(){
int x,y,z,q,a,o;
cin>>x>>y>>z>>q;
a=q-x*2-y*5-z*3;
if (a>=0) {
cout<<"Yes"<<endl;
cout<<a;
}else {
o=a-a*2;
cout<<"No"<<endl;
cout<<o;
}
return 0;
}
#include<bits/stdc++.h> using namespace std; int main(){ int x,y,z,q,p,x1=2,y1=5,z1=3,a,b,c,d,e,f; cin>>x>>y>>z>>q; a=xx1; b=yy1; c=z*z1; d=a+b+c; e=d-q; f=q-d; if(q<d){ cout<<"No"<<endl; cout<<e; }else{ cout<<"Yes"<<endl; cout<<f; } return 0; }
#include<bits/stdc++.h>
using namespace std;
int main()
{ int a,z,s,x,d;
cin>>a>>s>>z>>x;
d=a*2+s*5+z*3;
if(d<=x){
cout<<"Yes"<<endl<<x-d;
}
else{
cout<<"No"<<endl<<d-x;
}
return 0;
}