Educational Codeforces Round 14
来源:互联网 发布:剑灵捏脸数据怎么下载 编辑:程序博客网 时间:2024/06/15 21:42
#include <bits/stdc++.h>using namespace std;int main(){ int n,a[1005]; scanf("%d",&n); int ans=0; for(int i=0;i<n;i++) { scanf("%d",&a[i]); if(a[i]==1) ans++; } if(n==1) { if(ans==1) printf("YES\n"); else printf("NO\n"); } else if(ans!=n-1) printf("NO\n"); else printf("YES\n"); return 0;}
#include <bits/stdc++.h>using namespace std;int main(){ string s; cin>>s; int len=s.size(); char c[19][2]={'A','A','b','d','d','b','H','H','I','I','M','M','O','O','o', 'o','p','q','q','p','U','U','V','V','v','v','W','W','w','w','X','X','x','x','Y','Y','T','T'}; int flag=0; for(int i=0;i<=len/2;i++) { int fg=0; for(int j=0;j<19;j++) { if(s[i]==c[j][0]&&s[len-i-1]==c[j][1]) { fg=1; break; } } if(fg==0) { puts("NIE"); flag=1; break; } } if(flag==0) puts("TAK"); return 0;}
A,B题感觉纯粹考你能不能读懂题,C题稍微有点意思,让我认识到了我好像真的没有学过C++,下面这个是我的代码
#include<bits/stdc++.h>using namespace std;const int M=1e6+6;char a[M];int main(){ string s; cin>>s; queue<char>q; int x=0; for(int i=0;i<s.size();i++) { if(s[i]!='0') { x=i; break; } } for(int i=x;i<s.size();i++) { q.push(s[i]); } int cnt=0,b=0; if(q.front()=='.') { q.pop(); while(q.front()=='0') { q.pop(); b--; } a[cnt++]=q.front(); q.pop(); a[cnt++]='.'; b--; while(!q.empty()) { a[cnt++]=q.front(); q.pop(); } } else { a[cnt++]=q.front(); q.pop(); a[cnt++]='.'; while(q.front()!='.'&&!q.empty()) { a[cnt++]=q.front(); q.pop(); b++; } if(q.front()=='.') q.pop(); while(!q.empty()) { a[cnt++]=q.front(); q.pop(); } } int len=strlen(a); while(a[len-1]=='0'||a[len-1]=='.') len--; for(int i=0;i<len;i++) printf("%c",a[i]); if(b!=0) printf("E%d\n",b); return 0;}
int main(){ string s; cin >> s; int pos = s.find('.'); if (pos != -1) { s.erase(pos, 1); } else { pos = s.size(); } int pos2 = 0; for (int i=0; i<s.size(); i++) { if (s[i] > '0') { pos2 = i; break; } } int e = pos - pos2 - 1; s.erase(0, pos2); while (s.size() > 1 && s.back() == '0') { s.pop_back(); } if (s.size() >= 2) { s.insert(1, "."); } if (e == 0) { cout << s << endl; } else { cout << s << "E" << e << endl; }}
0 0
- Educational Codeforces Round 14
- Educational Codeforces Round 14
- Educational Codeforces Round 14
- Educational Codeforces Round 14
- Educational Codeforces Round 14 题解
- Educational Codeforces Round 14 E.Xor-sequences
- 【解题报告】Educational Codeforces Round 14
- Educational Codeforces Round 1
- Educational Codeforces Round 2
- Educational Codeforces Round 2
- Educational Codeforces Round 2
- Educational Codeforces Round 3
- Codeforces Educational Round 3
- Codeforces Educational Round 5
- Codeforces Educational round 5
- Educational Codeforces Round 5
- Educational Codeforces Round 6
- Educational Codeforces Round 6
- 洛谷 P1969 [NOIP2013 D2T1] 积木大赛
- android studio for android learning (十七) Toast使用详解
- Android学习路线总结,绝对干货
- hdu 2044
- PKI证书签发系统(web版)
- Educational Codeforces Round 14
- malloc/free new/delete
- Broadcasting
- C++ 模板类的实现为何放在.h中
- spring IOC容器接口体系简介
- 【一天一道LeetCode】#326. Power of Three
- Spring学习笔记四: 从Spring容器中获取Bean
- 【一天一道LeetCode】#231. Power of Two
- 根据表结构自动生成JavaBean,史上最强最专业的表结构转JavaBean的工具(第4版)