Good Bye 2015 A
Problem A:http://codeforces.com/problemset/problem/611/A
A. New Year and Days
题意:某人要在2016年收集糖果,有两种不同的收集方式,按week或month。x表示week的周x或月的x号,只有到每周或每月的x时才会收集一颗糖果,问:在给定的月或周条件内,2016年能收集多少颗糖果。
思路:我是用数组存好,其实也可以更简洁,周的话除了5,6,7是53个,其他都是52个;月的话1-29都是12(闰年),30是11,31是7;
#include <cstdio>
#include <iostream>
#include <string>
using namespace std;
int main(){
int a[]={,,,,,,,};
int n,l;
string s1,s2;
cin>>n>>s1>>s2;
l=s2.length() ;
if(l==)
printf("%d\n",a[n]);
else if(l==){
if(n<=)
printf("12\n");
if(n==)
printf("11\n");
if(n==)
printf("7\n");
}
return ;
}
Good Bye 2015 A的更多相关文章
- Good Bye 2015 D. New Year and Ancient Prophecy
D. New Year and Ancient Prophecy time limit per test 2.5 seconds memory limit per test 512 megabytes ...
- Good Bye 2015 B. New Year and Old Property 计数问题
B. New Year and Old Property The year 2015 is almost over. Limak is a little polar bear. He has re ...
- Good Bye 2015 A. New Year and Days 签到
A. New Year and Days Today is Wednesday, the third day of the week. What's more interesting is tha ...
- Codeforces Good bye 2015 B. New Year and Old Property dfs 数位DP
B. New Year and Old Property 题目连接: http://www.codeforces.com/contest/611/problem/B Description The y ...
- Codeforces Good Bye 2015 A. New Year and Days 水题
A. New Year and Days 题目连接: http://www.codeforces.com/contest/611/problem/A Description Today is Wedn ...
- Good Bye 2015 B. New Year and Old Property —— dfs 数学
题目链接:http://codeforces.com/problemset/problem/611/B B. New Year and Old Property time limit per test ...
- codeforces Good Bye 2015 B. New Year and Old Property
题目链接:http://codeforces.com/problemset/problem/611/B 题目意思:就是在 [a, b] 这个范围内(1 ≤ a ≤ b ≤ 10^18)统计出符合二进制 ...
- Good Bye 2015 C. New Year and Domino 二维前缀
C. New Year and Domino They say "years are like dominoes, tumbling one after the other". ...
- Codeforces Good Bye 2015 D. New Year and Ancient Prophecy 后缀数组 树状数组 dp
D. New Year and Ancient Prophecy 题目连接: http://www.codeforces.com/contest/611/problem/C Description L ...
- Codeforces Good Bye 2015 C. New Year and Domino 前缀和
C. New Year and Domino 题目连接: http://www.codeforces.com/contest/611/problem/C Description They say &q ...
随机推荐
- Xcode6:The file couldn’t be opened because you don’t have permission to view it
最近为了兼容iOS8升级到Xcode6.0编译之前的工程,结果App无法在真机上运行.报错如下: The file “xxxx.app” couldn’t be opened because you ...
- .Net 微信开发与微信支付
.NET https://github.com/JeffreySu/WeiXinMPSDK JAVA http://git.oschina.net/pyinjava/fastweixin ...
- Xcode6模拟器时BUG导致键盘无法弹出
Xcode 6.X版本可能会出现虚拟键盘无法调出,并在控制台出现如下提示:Can't find keyplane that supports type 5 for keyboard iPhone-Po ...
- MyBatis参数传入集合之foreach动态sql
foreach的主要用在构建in条件中,它可以在SQL语句中进行迭代一个集合.foreach元素的属性主要有item,index,collection,open,separator,close.ite ...
- Linux小白最佳实践:《超容易的Linux系统管理入门书》(连载五)Linux系统的对话方式
本篇是Linux小白最佳实践第5篇,目的就是让白菜们了解Linux进程之间是如何对话的.之前连载的几篇,在微信上引起了很多的反响,有人也反映图多文字少,感觉没有干货.本篇选了大部分是实战讲解的&quo ...
- maven中scope参数说明
官方说明文档地址https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Depen ...
- 考虑virtual函数以外的其它选择
详情见<Effective C++>item35 1.使用non-virtual interface(NVI)手法,这是Template Method设计模式的一种特殊形式. 它以publ ...
- Source Insight 技巧总结
以下文章转载自网络:http://blog.csdn.net/junjie319/article/details/6910992 http://www.cnblogs.com/bluestorm/ar ...
- xposed系列教程
转载说明 本篇文章可能已经更新,最新文章请转:http://www.sollyu.com/xposed-series/ 说明 这是一篇XPOSED开发系列教程, 个人开发者,开发不容易.QQ群: 73 ...
- Adobe Dreamweaver CS6 序列号 注册码(转自91zcm)
Adobe Dreamweaver CS6 序列号 注册码: 1192-1632-4987-2281-1039-4334 1192-1697-0848-9963-2161-72481192-1871 ...