Codeforces Round #660 (Div. 2) A. Captain Flint and Crew Recruitment
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                Codeforces Round #660 (Div. 2) A. Captain Flint and Crew Recruitment
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.                        
                                題目鏈接
思路:
先算出來最小的三個近似質數,那么所組成的和最小就是31,小于31的都不能組成,另外因為不能重復,所以,36,40,44,都要特判一下,把14換成15就行了。
代碼:
#include<bits/stdc++.h> #define int long long #define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); const int N=1e5+5; const int M=2e4+5; const double eps=1e-8; const int mod=1e9+7; const int inf=0x7fffffff; const double pi=3.1415926; using namespace std; signed main() {int t;cin>>t;while(t--){int n,a,b,c,d;cin>>n;a=6;b=10;c=14;d=30;d=n-30;if(d==a||d==b||d==c){c=15;d-=1;cout<<"YES"<<endl;cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;}else if(d>0){cout<<"YES"<<endl;cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;}else{cout<<"NO"<<endl;}}return 0; }總結
以上是生活随笔為你收集整理的Codeforces Round #660 (Div. 2) A. Captain Flint and Crew Recruitment的全部內容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: iphone通用设置里显示UDID(tw
- 下一篇: java爬虫爬豆瓣图书_网络爬虫——爬取
