题目链接:http://codeforces.com/problemset/problem/760/A

题意:日历需要多少列。

  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int num[] = {,,,,,,,,,,,};
  6.  
  7. int main()
  8. {
  9. int m,d;
  10. scanf("%d%d",&m,&d);
  11.  
  12. int day = num[m-];
  13.  
  14. int ans = ;
  15. day = day - (-d+);
  16.  
  17. if(day%)
  18. ans+=(day/+);
  19. else ans+=(day/);
  20. printf("%d\n",ans);
  21.  
  22. return ;
  23. }

Codeforces 760A Petr and a calendar的更多相关文章

  1. 【codeforces 760A】Petr and a calendar

    time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...

  2. codeforces C1. The Great Julya Calendar 解题报告

    题目链接:http://codeforces.com/problemset/problem/331/C1 这是第一次参加codeforces比赛(ABBYY Cup 3.0 - Finals (onl ...

  3. CodeForces 113B Petr#

    题目链接:http://codeforces.com/problemset/problem/113/B 题目大意: 多组数据每组给定3个字符串T,Sbeg,Sed,求字符串T中有多少子串是以Sbeg开 ...

  4. Codeforces 987E Petr and Permutations(数组的置换与复原 、结论)

    题目连接: Petr and Permutations 题意:给出一个1到n的序列,Petr打乱了3n次,Um_nik打乱了7n+1次,现在给出被打乱后的序列,求是谁打乱的. 题解:因为给出了一个3* ...

  5. CodeForces - 987E Petr and Permutations (思维+逆序对)

    题意:初始有一个序列[1,2,...N],一次操作可以将任意两个位置的值互换,Petr做3*n次操作:Alxe做7*n+1次操作.给出最后生成的新序列,问是由谁操作得到的. 分析:一个序列的状态可以归 ...

  6. Codeforces 986B. Petr and Permutations(没想到这道2250分的题这么简单,早知道就先做了)

    这题真的只能靠直觉了,我没法给出详细证明. 解题思路: 1.交换3n次或者7n+1次,一定会出现一个为奇数,另一个为偶数. 2.用最朴素的方法,将n个数字归位,计算交换次数. 3.判断交换次数是否与3 ...

  7. 【63.63%】【codeforces 724A】Checking the Calendar

    time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...

  8. Codeforces 986B - Petr and Permutations

    Description\text{Description}Description Given an array a[], swap random 2 number of them for 3n or  ...

  9. CodeForces - 113B Petr# (后缀数组)

    应该算是远古时期的一道题了吧,不过感觉挺经典的. 题意是给出三一个字符串s,a,b,求以a开头b结尾的本质不同的字符串数. 由于n不算大,用hash就可以搞,不过这道题是存在复杂度$O(nlogn)$ ...

随机推荐

  1. 锁、CAS操作和无锁队列的实现

    https://blog.csdn.net/yishizuofei/article/details/78353722 锁的机制 锁和人很像,有的人乐观,总会想到好的一方面,所以只要越努力,就会越幸运: ...

  2. mgo03_linux7上安装mongo4.0

    下载地址https://www.mongodb.com/download-center#community tar -xvf mongodb-linux-x86_64-rhel70-4.0.0.tgz ...

  3. php数组·的方法3-数组和变量之间的转换

    /* * 数组和变量之间的转换 * */ //extract() 使用数组定义一组变量 // 键名为变量名 键值为变量值(类似于js的解构赋值) // 返回值是数组的长度 echo '<hr&g ...

  4. python -- Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

    用python读取hive数据,引用下面包. #!/usr/bin/env python import pyhs2 as hive 先按照它 pip install pyhs2 出现错误 Collec ...

  5. 转 [Error]EOL while scanning string literal

    https://blog.csdn.net/orangleliu/article/details/38943749 项目中有个定时任务,每天取到一些表数据传到一个外部接口,但是最近总是有异常,今天查了 ...

  6. 单片机的图形UI

    https://www.st.com/content/st_com/en/stm32-graphic-user-interface.html TouchGFX Designer:如今免费,资源占用10 ...

  7. vs2012配置使用entity framework 6

    项目中使用mysql作为数据库,想快速地实现一些数据服务,为了节省开发时间,提升开发效率,性能不是考虑的重点,所以选择了使用ORM框架:Entity Framework.指定了DB的table des ...

  8. ArrayList代码分析

    集合算是java中最常用的部分了,阅读该部分jdk代码可以让我们更加清楚的了解其实现原理,在使用时也能心中有数,有利于写出高质量的代码. ArrayList 底层数组实现,初始长度10,超过长度后的自 ...

  9. empty,isset,is_null比较(差异与异同)

    做php开发时候,想必在使用:empty,isset,is_null  这几个函数时候,遇到一些问题.甚至给自己的程序带来一些安全隐患的bug.很多时候,对于isset,empty都认为差不多.因此开 ...

  10. 认识web

    URL详解: URL是Uniform Resource Locator 的简写,统一资源定位符. 一个URL由以下几部分组成: scheme:代表的是访问的协议,一般为http或者https以及ftp ...