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的更多相关文章

  1. 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 ...

  2. 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 ...

  3. 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 ...

  4. 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 ...

  5. 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 ...

  6. 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 ...

  7. codeforces Good Bye 2015 B. New Year and Old Property

    题目链接:http://codeforces.com/problemset/problem/611/B 题目意思:就是在 [a, b] 这个范围内(1 ≤ a ≤ b ≤ 10^18)统计出符合二进制 ...

  8. Good Bye 2015 C. New Year and Domino 二维前缀

    C. New Year and Domino   They say "years are like dominoes, tumbling one after the other". ...

  9. 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 ...

  10. 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 ...

随机推荐

  1. sqlserver2008 如何定时清理索引碎片

    sqlserver2008 如何定时清理索引碎片 查询索引引起的表垃圾碎片sql脚本:  SELECT object_name(a.object_id) [TableName] ,a.index_id ...

  2. 关闭“编辑窗体”后, 主窗体的DatagridView刷新数据的问题

    问题:在关闭一个窗体2后,要刷新窗体1内的datagridview的数据,直接窗体1.datagridview.datasource=dt 是没用的. 解决办法如下: 在主窗体里 创建编辑窗体时 加上 ...

  3. Javasript中Date日期常用用法(正则、比较)

    Date 对象用于处理日期和时间.创建 Date 对象的语法:  代码如下 复制代码 var myDate=new Date() Date 对象会自动把当前日期和时间保存为其初始值.参数形式有以下5种 ...

  4. mongoDB知识总结

    官方说明文档:https://docs.mongodb.com/manual/mongo/ 1 NoSQL 简介 NoSQL,全称是”Not Only Sql”,指的是非关系型的数据库(相对于关系型数 ...

  5. info sed 中文不完全文档

    快速指南: sed 的一般使用方法:sed -option 'adress|command' -f scpritfiles(1)'|' 只是用来说明性的分隔 adress 和 command,实际使用 ...

  6. String的几种初始化方法的区别

    参考了: java中String的两种初始化方法   String a; String aa = ""; String aaa = "123"; String ...

  7. [zz] 使用ssh公钥密钥自动登陆linux服务器

    目录 .生成密匙对 .拷贝公匙到远程机 .启动登陆代理 这种方法处理后每次需要运行命令:ssh-add ~/.ssh/id_dsa 作为一名 linux 管理员,在多台 Linux 服务器上登陆进行远 ...

  8. java访问webservice服务(一)

    欢迎转载  http://www.cnblogs.com/shizhongtao/p/3433653.html 使用wsdl2java工具命令   一. 调出命令提示符cd到cxf的解压路径“D:\学 ...

  9. ubuntu 14.04 nagios4+ndoutils2.0+centreon2.5.4配置

    ubuntu 14.04 nagios4+ndoutils2.0+centreon2.5.4(原创) 开发应用centreon是开源的IT监控软件,由法国人于2003年开发,最初名为Oreon,并于2 ...

  10. DTCMS获取栏目子类

    <%set DataTable categoryList=get_category_child_list(channel,0)%> <%foreach(DataRow cdr in ...