当前位置: 首页 > news >正文

网站建设毕业设计论文贸易公司如何做英文网站

网站建设毕业设计论文,贸易公司如何做英文网站,查看网站域名,个人怎么做网站优化A - Partition A题传送门 这道题不难发现#xff0c;如果数字最终的和大于等于K#xff0c;我们可以把这个原数列从大到小排序#xff0c;得到最终答案。 如果和小于K#xff0c;则从小到大排序#xff0c;同时验证是否符合要求。 #pragma GCC optimize(3) //O2优化开启…A - Partition A题传送门 这道题不难发现如果数字最终的和大于等于K我们可以把这个原数列从大到小排序得到最终答案。 如果和小于K则从小到大排序同时验证是否符合要求。 #pragma GCC optimize(3) //O2优化开启 #includebits/stdc.h using namespace std; #define int long long typedef long long ll; typedef unsigned long long ull; typedef pairint,int PII; // const int mod1e97; const int MX0x3f3f3f3f3f3f3f3f; //inline int read() //快读 //{ // int xr0,F1; char cr; // while(crgetchar(),cr0||cr9) if(cr-) F-1; // while(cr0cr9) // xr(xr3)(xr1)(cr^48),crgetchar(); // return xr*F; //} //void write(int x) //快写 //{ // if(x0) putchar(-),x-x; // if(x9) write(x/10); putchar(x%100); //} // 比 unordered_map 更快的哈希表 // #include ext/pb_ds/assoc_container.hpp // using namespace __gnu_pbds; // const int RANDOM chrono::high_resolution_clock::now().time_since_epoch().count(); // struct chash { // int operator()(int x) const { return x ^ RANDOM; } // }; // typedef gp_hash_tableint, int, chash hash_t; constexpr ll mod 1e9 7; //此处为自动取模的数 class modint{ll num; public:modint(ll num 0) :num(num % mod){}ll val() const {return num;}modint pow(ll other) {modint res(1), temp *this;while(other) {if(other 1) res res * temp;temp temp * temp;other 1;}return res;}constexpr ll norm(ll num) const {if (num 0) num mod;if (num mod) num - mod;return num;}modint inv(){ return pow(mod - 2); }modint operator(modint other){ return modint(num other.num); }modint operator-(){ return { -num }; }modint operator-(modint other){ return modint(-other *this); }modint operator*(modint other){ return modint(num * other.num); }modint operator/(modint other){ return *this * other.inv(); }modint operator*(modint other) { num num * other.num % mod; return *this; }modint operator(modint other) { num norm(num other.num); return *this; }modint operator-(modint other) { num norm(num - other.num); return *this; }modint operator/(modint other) { return *this * other.inv(); }friend istream operator(istream is, modint other){ is other.num; other.num % mod; return is; }friend ostream operator(ostream os, modint other){ other.num (other.num mod) % mod; return os other.num; } };int n,k; int a[500005]; void icealsoheat(){cinnk;for(int i1;in;i)cina[i];// sort(a1,a1n);if(k0){int sum0;for(int i1;in;i){suma[i];}if(sumk){coutYes\n;sort(a1,a1n,[](int x,int y){return xy;});for(int i1;in;i){couta[i] ;}}else{coutNo\n;}}else{coutYes\n;sort(a1,a1n);for(int i1;in;i){couta[i] ;}}} signed main(){ios::sync_with_stdio(false); //int128不能用快读cin.tie();cout.tie();int _yq;_yq1;// cin_yq;while(_yq--){icealsoheat();} } // //⠀⠀⠀ ⠀⢸⣿⣿⣿⠀⣼⣿⣿⣦⡀ //⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⠀⠀⠀ ⠀⢸⣿⣿⡟⢰⣿⣿⣿⠟⠁ //⠀⠀⠀⠀⠀⠀⠀⢰⣿⠿⢿⣦⣀⠀⠘⠛⠛⠃⠸⠿⠟⣫⣴⣶⣾⡆ //⠀⠀⠀⠀⠀⠀⠀⠸⣿⡀⠀⠉⢿⣦⡀⠀⠀⠀⠀⠀⠀ ⠛⠿⠿⣿⠃ //⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣦⠀⠀⠹⣿⣶⡾⠛⠛⢷⣦⣄⠀ //⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣧⠀⠀⠈⠉⣀⡀⠀ ⠀⠙⢿⡇ //⠀⠀⠀⠀⠀⠀⢀⣠⣴⡿⠟⠋⠀⠀⢠⣾⠟⠃⠀⠀⠀⢸⣿⡆ //⠀⠀⠀⢀⣠⣶⡿⠛⠉⠀⠀⠀⠀⠀⣾⡇⠀⠀⠀⠀⠀⢸⣿⠇ //⢀⣠⣾⠿⠛⠁⠀⠀⠀⠀⠀⠀⠀⢀⣼⣧⣀⠀⠀⠀⢀⣼⠇ //⠈⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⡿⠋⠙⠛⠛⠛⠛⠛⠁ //⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣾⡿⠋⠀ //⠀⠀⠀⠀⠀⠀⠀⠀⢾⠿⠋⠀ // B - Between B and B B题传送门 想了半天没搞出来后来看了大佬的题解提示才恍然大悟。 这题可以用dp的思想去求通过题目的数据我们可以大胆去猜首先复杂度一定要带个n其次m仅仅等于10也让我们可以发散性的去想到状压的 2 10 2^{10} 210的复杂度还可以再添一个m所以最终的复杂度最多为O(nmlog 2 10 2^{10} 210)。 我们可通过状压来枚举各个数是否符合条件可以放入的情况。比如第i位假如我向这个数位放入的数字是j首先放入j的前提条件是在当前位数和上一个放入j的位数之间我们放入了至少一个a[j]此时j可以放入同时放入了j后j会使得后面所有a[x]j的数字都可以放入我们可以通过状态去枚举各个数字是否可以放入能放入的话对应的二进制位数就是1不能放入就是0。 #pragma GCC optimize(3) //O2优化开启 #includebits/stdc.h using namespace std; #define int long long typedef long long ll; typedef unsigned long long ull; typedef pairint,int PII; // const int mod1e97; const int MX0x3f3f3f3f3f3f3f3f; //inline int read() //快读 //{ // int xr0,F1; char cr; // while(crgetchar(),cr0||cr9) if(cr-) F-1; // while(cr0cr9) // xr(xr3)(xr1)(cr^48),crgetchar(); // return xr*F; //} //void write(int x) //快写 //{ // if(x0) putchar(-),x-x; // if(x9) write(x/10); putchar(x%100); //} // 比 unordered_map 更快的哈希表 // #include ext/pb_ds/assoc_container.hpp // using namespace __gnu_pbds; // const int RANDOM chrono::high_resolution_clock::now().time_since_epoch().count(); // struct chash { // int operator()(int x) const { return x ^ RANDOM; } // }; // typedef gp_hash_tableint, int, chash hash_t; constexpr ll mod 998244353; //此处为自动取模的数 class modint{ll num; public:modint(ll num 0) :num(num % mod){}ll val() const {return num;}modint pow(ll other) {modint res(1), temp *this;while(other) {if(other 1) res res * temp;temp temp * temp;other 1;}return res;}constexpr ll norm(ll num) const {if (num 0) num mod;if (num mod) num - mod;return num;}modint inv(){ return pow(mod - 2); }modint operator(modint other){ return modint(num other.num); }modint operator-(){ return { -num }; }modint operator-(modint other){ return modint(-other *this); }modint operator*(modint other){ return modint(num * other.num); }modint operator/(modint other){ return *this * other.inv(); }modint operator*(modint other) { num num * other.num % mod; return *this; }modint operator(modint other) { num norm(num other.num); return *this; }modint operator-(modint other) { num norm(num - other.num); return *this; }modint operator/(modint other) { return *this * other.inv(); }friend istream operator(istream is, modint other){ is other.num; other.num % mod; return is; }friend ostream operator(ostream os, modint other){ other.num (other.num mod) % mod; return os other.num; } };int n,m; int a[50005]; modint dp[20005][2000]; int id[50005]; void icealsoheat(){int m,n;cinnm;for(int i1;in;i)cina[i];for(int i1;in;i){id[a[i]]|(1(i-1));}// for(int i0;in;i)dp[0][1i]1;dp[0][(1n)-1]1;for(int i1;im;i){for(int j1;jn;j){for(int o0;o(1n);o){if(o(j-1)1){int xo;x-(1(j-1));x|id[j];dp[i][x]dp[i-1][o];}}}}modint ans0;for(int i0;i(1n);i)ansdp[m][i];coutans;} signed main(){ios::sync_with_stdio(false); //int128不能用快读cin.tie();cout.tie();int _yq;_yq1;// cin_yq;while(_yq--){icealsoheat();} } // //⠀⠀⠀ ⠀⢸⣿⣿⣿⠀⣼⣿⣿⣦⡀ //⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⠀⠀⠀ ⠀⢸⣿⣿⡟⢰⣿⣿⣿⠟⠁ //⠀⠀⠀⠀⠀⠀⠀⢰⣿⠿⢿⣦⣀⠀⠘⠛⠛⠃⠸⠿⠟⣫⣴⣶⣾⡆ //⠀⠀⠀⠀⠀⠀⠀⠸⣿⡀⠀⠉⢿⣦⡀⠀⠀⠀⠀⠀⠀ ⠛⠿⠿⣿⠃ //⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣦⠀⠀⠹⣿⣶⡾⠛⠛⢷⣦⣄⠀ //⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣧⠀⠀⠈⠉⣀⡀⠀ ⠀⠙⢿⡇ //⠀⠀⠀⠀⠀⠀⢀⣠⣴⡿⠟⠋⠀⠀⢠⣾⠟⠃⠀⠀⠀⢸⣿⡆ //⠀⠀⠀⢀⣠⣶⡿⠛⠉⠀⠀⠀⠀⠀⣾⡇⠀⠀⠀⠀⠀⢸⣿⠇ //⢀⣠⣾⠿⠛⠁⠀⠀⠀⠀⠀⠀⠀⢀⣼⣧⣀⠀⠀⠀⢀⣼⠇ //⠈⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⡿⠋⠙⠛⠛⠛⠛⠛⠁ //⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣾⡿⠋⠀ //⠀⠀⠀⠀⠀⠀⠀⠀⢾⠿⠋⠀ // C - Beware of Overflow C题传送门 还是我太菜了看题目都费劲最后还是不争气的看了题解竟然题解把查询放入了排序的cmp函数中确实还是我自己的思维太局限了容易想到的是我们把所有的数从小到大排序然后头尾相加再把相加的数通过二分按顺序放入这个数中重复上述操作知道符合最后条件为止O(nlogn)的复杂度所以不会超过25000次询问。 #pragma GCC optimize(3) //O2优化开启 #includebits/stdc.h using namespace std; #define int long long typedef long long ll; typedef unsigned long long ull; typedef pairint,int PII; // const int mod1e97; const int MX0x3f3f3f3f3f3f3f3f; //inline int read() //快读 //{ // int xr0,F1; char cr; // while(crgetchar(),cr0||cr9) if(cr-) F-1; // while(cr0cr9) // xr(xr3)(xr1)(cr^48),crgetchar(); // return xr*F; //} //void write(int x) //快写 //{ // if(x0) putchar(-),x-x; // if(x9) write(x/10); putchar(x%100); //} // 比 unordered_map 更快的哈希表 // #include ext/pb_ds/assoc_container.hpp // using namespace __gnu_pbds; // const int RANDOM chrono::high_resolution_clock::now().time_since_epoch().count(); // struct chash { // int operator()(int x) const { return x ^ RANDOM; } // }; // typedef gp_hash_tableint, int, chash hash_t; constexpr ll mod 998244353; //此处为自动取模的数 class modint{ll num; public:modint(ll num 0) :num(num % mod){}ll val() const {return num;}modint pow(ll other) {modint res(1), temp *this;while(other) {if(other 1) res res * temp;temp temp * temp;other 1;}return res;}constexpr ll norm(ll num) const {if (num 0) num mod;if (num mod) num - mod;return num;}modint inv(){ return pow(mod - 2); }modint operator(modint other){ return modint(num other.num); }modint operator-(){ return { -num }; }modint operator-(modint other){ return modint(-other *this); }modint operator*(modint other){ return modint(num * other.num); }modint operator/(modint other){ return *this * other.inv(); }modint operator*(modint other) { num num * other.num % mod; return *this; }modint operator(modint other) { num norm(num other.num); return *this; }modint operator-(modint other) { num norm(num - other.num); return *this; }modint operator/(modint other) { return *this * other.inv(); }friend istream operator(istream is, modint other){ is other.num; other.num % mod; return is; }friend ostream operator(ostream os, modint other){ other.num (other.num mod) % mod; return os other.num; } }; int n; bool cmp(int a,int b){cout? a bendl;int s;cins;return s; } // bool check(int p,int o){ // cout? p oendl; // int x; // cinx; // return x0; // } void icealsoheat(){cinn;vectorintve;for(int i1;in;i){ve.push_back(i);}sort(ve.begin(),ve.end(),cmp);while(ve.size()1){int leve[0];int reve.back();// int xlere;cout le reendl;int x;cinx;ve.erase(ve.begin());ve.pop_back();// coutiif(ve.size()0){break;}int l0,rve.size()-1;int mid;while(lr){mid(lr)1;if(cmp(x,ve[mid]))rmid;else lmid1;}if(!cmp(x,ve[l]))l;ve.insert(ve.begin()l,x);}cout!endl; } signed main(){ios::sync_with_stdio(false); //int128不能用快读cin.tie();cout.tie();int _yq;_yq1;// cin_yq;while(_yq--){icealsoheat();} } // //⠀⠀⠀ ⠀⢸⣿⣿⣿⠀⣼⣿⣿⣦⡀ //⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⠀⠀⠀ ⠀⢸⣿⣿⡟⢰⣿⣿⣿⠟⠁ //⠀⠀⠀⠀⠀⠀⠀⢰⣿⠿⢿⣦⣀⠀⠘⠛⠛⠃⠸⠿⠟⣫⣴⣶⣾⡆ //⠀⠀⠀⠀⠀⠀⠀⠸⣿⡀⠀⠉⢿⣦⡀⠀⠀⠀⠀⠀⠀ ⠛⠿⠿⣿⠃ //⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣦⠀⠀⠹⣿⣶⡾⠛⠛⢷⣦⣄⠀ //⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣧⠀⠀⠈⠉⣀⡀⠀ ⠀⠙⢿⡇ //⠀⠀⠀⠀⠀⠀⢀⣠⣴⡿⠟⠋⠀⠀⢠⣾⠟⠃⠀⠀⠀⢸⣿⡆ //⠀⠀⠀⢀⣠⣶⡿⠛⠉⠀⠀⠀⠀⠀⣾⡇⠀⠀⠀⠀⠀⢸⣿⠇ //⢀⣠⣾⠿⠛⠁⠀⠀⠀⠀⠀⠀⠀⢀⣼⣧⣀⠀⠀⠀⢀⣼⠇ //⠈⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⡿⠋⠙⠛⠛⠛⠛⠛⠁ //⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣾⡿⠋⠀ //⠀⠀⠀⠀⠀⠀⠀⠀⢾⠿⠋⠀ //
http://www.dnsts.com.cn/news/79964.html

相关文章:

  • asp.net做网站后台wordpress如何修改代码
  • 台州网站建设公司哪个好vps看网站蜘蛛
  • 怎样做视频网站中英文切换网站
  • 网站建设需注意的无锡网站建设原则
  • 乐清 网站建设鹤壁建设网站推广公司
  • 官网开发安徽新站优化
  • 网站建设公司海外中国专业做鞋子的网站
  • 河北seo网站设计北京知名广告公司有哪些
  • 营销型网站建设网站建设资讯织梦网站自适应怎么做
  • 网站引用优酷wordpress获取菜单链接地址
  • 类似于微博网站怎么做的全国企业信息官网网站
  • 笑话网站php程序帮做毕设的网站
  • 如何看到网站的制作公司网站建站服务公司地址
  • 如何破解网站后台账号和密码wordpress 自建邮件
  • 第一环保网站建设项目环评公示网站建设盈利模式
  • 六安网站建设优化美食网站建设服务策划书
  • 低价网站建设公司WordPress改成淘宝客
  • 成都专业做网站的公司佛山网红打卡点
  • 如何查看网站做没做竞价福建省建设相关网站
  • 绵阳市 网站建设服装公司网站首页
  • 网站设计就业压力wordpress插件漏洞扫描
  • 网做英文网站建设银行办信用卡网站
  • 免费html5网站模板怎样手机微信登陆网站
  • 网站开发多久完成网站开发的方案
  • 第五次普查数据自网站怎么做公司软件管理软件
  • 网站设计编辑响应式网站管理
  • 杭州网站建设公司有哪些建设银行国际互联网站
  • 网站后台模板关联自己做的网站企业网站内容运营
  • 洛阳天艺网络做网站怎么样重庆建设工程信息网官网查询系统官网
  • 多用户商城系统网站建设网站开发语言数据库有几种