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

电子商务网站建设与管理最新试卷u钙网免费设计头像

电子商务网站建设与管理最新试卷,u钙网免费设计头像,怎么做淘宝联盟网站制作,母婴用品网站建设规划分享牛客算法基础精选题单题目打卡!!! 目录 字符串的展开 多项式输出 机器翻译 : 铺地毯 : [NOIP2016]回文日期 字符串的展开 原题链接 : 字符串的展开 思路 : 模拟 代码 : #includeiostream #includecstring #includealgorithm using na…分享牛客算法基础精选题单题目打卡!!! 目录 字符串的展开 多项式输出 机器翻译 : 铺地毯 :  [NOIP2016]回文日期 字符串的展开 原题链接 :  字符串的展开 思路 : 模拟 代码 :  #includeiostream #includecstring #includealgorithm using namespace std; int p1,p2,p3; string s; string func(char a,char b,int p1,int p2,int p3){if(b-a1) return ;if( ! ((isalpha(a) isalpha(b) ab) ||(isdigit(a) isdigit(b) ab))){return -;}string ans ;for(char c a1;cb;c){for(int i0;ip2;i){ans c;}}if(p12 isalpha(a)){for(int i0;ians.length();i){ans[i] ans[i]-aA;}}if(p13){for(int i0;ians.length();i){ans[i] *;}}if(p32){reverse(ans.begin(),ans.end());}return ans; } int main(){cinp1p2p3;cins;int n s.size();string ans ;for(int i0;in;i){if(s[i] - i0 i1n) ans func(s[i-1],s[i1],p1,p2,p3);else{ans s[i];}}coutansendl; } 多项式输出 题目链接 : 多项式输出 思路 : 模拟多项式展开的过程即可 代码 :  #includeiostream #includecstring #includealgorithm using namespace std; int n , a[110]; int main(){cinn;for(int i0;in;i) cina[i];int t n;//n1个数string ans ;for(int i0;in;i){if(i0){if(a[i]0){t--;continue;}else if(a[i]1) ans x^ to_string(t);else if(a[i]-1) ans -x^ to_string(t);else ans to_string(a[0]) x^ to_string(t);t--;}else if(in){if(a[i] 0) ans to_string(a[i]);else if(a[i]0) ans to_string(a[i]);}else if(in-1){if(a[i] 0){t--;continue;}else if(a[i] 0){if(a[i]1) ans x;else ans to_string(a[i]) x;}else {if(a[i]-1) ans -x; else ans to_string(a[i])x;}t--;}else{if(a[i] 0){t--;continue;}else if(a[i] 0){if(a[i]1) ans x^to_string(t);else ans to_string(a[i])x^to_string(t);}else {if(a[i]-1) ans -x^to_string(t); else ans to_string(a[i])x^to_string(t);}t--;}}coutansendl;return 0; } 机器翻译 : 原题链接 : 机器翻译 思路 : 模拟 #include iostream using namespace std; int vis[1010]; //记录已经在内存空间数字在内存空间的数字标记为1 int temp[1010]; //每输入一个数据则将数据放入该数组中。按顺序存放 int tempPos; //记录temp数组的位置 int m; //记录内存空间的大小 int n; //记录文章的长度int main(void) {cin m n;int count 0; //记录内存空间中的数字个数int cnt 0; //记录查找字典的次数int num; //记录输入进来的文章int i;for(i 1; i n; i){cin num;if(1 vis[num]) continue;cnt;if(count m){vis[temp[tempPos-m]] 0; vis[num] 1;temp[tempPos] num;}else{vis[num] 1;temp[tempPos] num;count;}}cout cnt endl;return 0; } 铺地毯 :  原题链接 :  铺地毯   思路 : 直接从小到大枚举每一个可能在(x,y)上面的所有地毯找到最大的一个即可 代码 :  #includeiostream using namespace std; int n,xn,yn; struct st{int a,b,x,y; }st[10100]; int main(){cinn;for(int i0;in;i){cinst[i].ast[i].bst[i].xst[i].y;}cinxnyn;int ans 0;for(int i0;in;i){if(st[i].axnst[i].byn(st[i].ast[i].x)xn(st[i].bst[i].y)yn){ansi1; }}if(ans 0) cout-1endl;else coutansendl;return 0; } [NOIP2016]回文日期 原题链接 : 登录—专业IT笔试面试备考平台_牛客网 思路 : 枚举两个日期之间的所有日期找到满足条件的日期答案加一最后返回答案即可 代码 :  #includeiostream #includebits/stdc.husing namespace std; int M[20] {0,31,0,31,30,31,30,31,31,30,31,30,31}; bool isLeapyear(int y) {if((y%40y%100!0)||y%4000){return true;}return false; } bool check(int y) {int m,d;m (y%10)*10((y/10)%10);d ((y/100)%10)*10((y/1000)%10);if(m0||d0||m12){return false;}if(m2){if(isLeapyear(y)){ M[2]29;}else if(!isLeapyear(y)){M[2]28;}}if(dM[m]){return true;}else{return false;} } int ReYear(int y) {return (y%10)*1000((y/10)%10)*100((y/100)%10)*10((y/1000)%10); } int main() {int y1,md1;int y2,md2;scanf(%4d%4d,y1,md1);scanf(%4d%4d,y2,md2);int ans 0;if(y1!y2){bool flag;for(int i y11; iy2-1 ; i)//判断两个日期之间的年份{int m,d;//取出该年份对应回文日期的月和日if(check(i)){ans;}}if(check(y1)md1ReYear(y1)){ans;}if(check(y2)ReYear(y2)md2){ans;}}else{//在同一年里int m1,d1;//取出y1年份对应回文日期的月和日m1 (y1%10)*10((y1/10)%10);d1 ((y1/100)%10)*10((y1/1000)%10);if(check(y1)ReYear(y1)md1ReYear(y1)md2){ans;}}coutansendl;return 0; }
http://www.hkea.cn/news/14523555/

相关文章:

  • 谷歌seo技巧seo营销排名
  • 商品定制平台网站WordPress怎么取消邮箱注册
  • 阜阳建设工程质量监督局网站专业做企业网站
  • python django做的网站相机拍照的图片怎么做网站呀
  • 网站群系统wordpress 小公举
  • 常州模板网站建设企业wordpress如何用API采集
  • 网站制作费用大概多少牛魔王网站建设
  • 软件开发培训学校porin深圳优化公司公认安高粱seo
  • 百度模板网站模板北京微信网站建设电话
  • 奥远网站建设流程有了自己的网站怎么赚钱
  • 有哪些营销型网站快点tv下载安装
  • 中文域名交易网站产品软文模板
  • 网页网站设计培训网站设计及内容策划
  • 婚礼策划网站黄埔区网站建设
  • 企业网站如何制作wordpress侧边栏二级菜单
  • 用vue做网站惠州app开发公司
  • 快站优惠券app网页跳转链接怎么制作
  • 如何做网站浏览pdf山东建设项目环境影响登记网站
  • 做环保是跑还是网站卖博物馆 网站 建设
  • 网站的设计思想今天的军事新闻
  • 网站建设招标提问网站建设手机端官网
  • 国外做网站推广网站二次开发的模板种类
  • 站长工具国色天香莱钢吧贴吧
  • 专门做照片书的网站门户网站cms系统
  • 商务网站建设模块手机高端设计网站建设
  • 威海网站建设地址wordpress的站点地址如何配置
  • 我想自己做网站可以赚钱租车行网站模版
  • 怎么做网站啊网站增加外链的方法有哪些
  • 网站推广策划方案大数据紫色 网站
  • 医药招商网站建设商业网站建设案例课程下载