codeforces——B. Months and Years
来源:互联网 发布:ipad c语言编译器 编辑:程序博客网 时间:2024/05/18 00:27
string::find() 找到就返回第一次出现的串的第一个字符位置,找不到返回-1。
看到以后令人豁然开朗的答案,将月份的天数转换成字符串。
b+=tmp%10+48;
#include <iostream>using namespace std;int main() { string a="181010110101181010110101181010110101191010110101",b=""; a+=a+a+a; int n; cin>>n; for(int i=0;i<n;i++) { int tmp; cin>>tmp; b+=tmp%10+48; } if(a.find(b)==-1) cout<<"NO"<<endl; else cout<<"YES"<<endl; return 0;}
阅读全文
0 0
- codeforces——B. Months and Years
- Codeforces Round #452 (Div. 2) B. Months and Years
- codeforces Div.2 899B Months and Years
- B. Months and Years(暴力)
- B. Months and Years(题解)
- 7 months to 7 years
- POJ3393——Lucky and Good Months by Gregorian Calendar
- Find the difference between two days in days, months and years
- CodeForces 535B — Tavas and SaDDas
- codeforces——519B—— A and B and Compilation Errors
- codeforces——339B——Xenia and Ringroad
- codeforces——492B——Vanya and Lanterns
- codeforces—— 459B —— Pashmak and Flowers
- Codeforces —— 358B Dima and Text Messages
- CodeForces 501B——Misha and Changing Handles
- Codeforces#414B——Mashmokh and ACM
- codeforces 832B ——Petya and Exam
- Calculate years, months, days & calender days between 2 given dates
- lwj_C#_字典
- 2017年12月20日
- 数据结构之查找(二)——顺序表查找
- IDEA 中将项目与github关联
- Linux 连续执行多条命令的方法
- codeforces——B. Months and Years
- leetcode 636. Exclusive Time of Functions 函数的单独运行时间
- 数组对象根据某个值相同合并分组
- 91卫图和水经注对比
- 颜色空间RGB与HSV(HSL)的转换
- Android组件化设计
- 关于产品
- IT行业与风投
- 我的