Codeforces 760A Petr and a calendar
题目链接:http://codeforces.com/problemset/problem/760/A
题意:日历需要多少列。
#include <bits/stdc++.h>
using namespace std;
int num[] = {,,,,,,,,,,,};
int main()
{
int m,d;
scanf("%d%d",&m,&d);
int day = num[m-];
int ans = ;
day = day - (-d+);
if(day%)
ans+=(day/+);
else ans+=(day/);
printf("%d\n",ans);
return ;
}
Codeforces 760A Petr and a calendar的更多相关文章
- 【codeforces 760A】Petr and a calendar
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...
- codeforces C1. The Great Julya Calendar 解题报告
题目链接:http://codeforces.com/problemset/problem/331/C1 这是第一次参加codeforces比赛(ABBYY Cup 3.0 - Finals (onl ...
- CodeForces 113B Petr#
题目链接:http://codeforces.com/problemset/problem/113/B 题目大意: 多组数据每组给定3个字符串T,Sbeg,Sed,求字符串T中有多少子串是以Sbeg开 ...
- Codeforces 987E Petr and Permutations(数组的置换与复原 、结论)
题目连接: Petr and Permutations 题意:给出一个1到n的序列,Petr打乱了3n次,Um_nik打乱了7n+1次,现在给出被打乱后的序列,求是谁打乱的. 题解:因为给出了一个3* ...
- CodeForces - 987E Petr and Permutations (思维+逆序对)
题意:初始有一个序列[1,2,...N],一次操作可以将任意两个位置的值互换,Petr做3*n次操作:Alxe做7*n+1次操作.给出最后生成的新序列,问是由谁操作得到的. 分析:一个序列的状态可以归 ...
- Codeforces 986B. Petr and Permutations(没想到这道2250分的题这么简单,早知道就先做了)
这题真的只能靠直觉了,我没法给出详细证明. 解题思路: 1.交换3n次或者7n+1次,一定会出现一个为奇数,另一个为偶数. 2.用最朴素的方法,将n个数字归位,计算交换次数. 3.判断交换次数是否与3 ...
- 【63.63%】【codeforces 724A】Checking the Calendar
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...
- Codeforces 986B - Petr and Permutations
Description\text{Description}Description Given an array a[], swap random 2 number of them for 3n or ...
- CodeForces - 113B Petr# (后缀数组)
应该算是远古时期的一道题了吧,不过感觉挺经典的. 题意是给出三一个字符串s,a,b,求以a开头b结尾的本质不同的字符串数. 由于n不算大,用hash就可以搞,不过这道题是存在复杂度$O(nlogn)$ ...
随机推荐
- springmvc接收各种参数
转载:https://blog.csdn.net/lutinghuan/article/details/46820023
- c# yield关键字原理
https://www.cnblogs.com/blueberryzzz/p/8678700.html c# yield关键字原理详解 1.yield实现的功能yield return:先看下面的代码 ...
- vue混入(mixins)
混入(mixins)是一种分发vue组件中可复用功能的非常灵活的方式.混入对象可以包含任意组件选项. 当组件使用混入对象时,所以混入对象的选项将被混入该组件本身选项,当组件和混入对象含有同名选项时,这 ...
- ajax请求状态码为0的解决办法
原文链接:https://blog.csdn.net/changqing5818/article/details/53932463 前言 今天遇到个奇怪的问题,使用JQuery的ajax请求,后台的C ...
- 闲里偷忙的CPU-某个kwoker进程忙
https://zhuanlan.zhihu.com/p/34311472 有一类比较特殊的CPU使用率问题,这类问题的特点是,系统平均CPU使用率很低,但是个别CPU的使用率非常高.今天借助这个真实 ...
- Murano Weekly Meeting 2016.07.26
Meeting time: 2016.July.26 1:00~2:00 Chairperson: Nikolay_St, from Mirantis Meeting summary: 1.Masc ...
- script脚本中写不写$(document).ready(function() {});的区别
$(document).ready() 里的代码是在页面内容都加载完才执行的,如果把代码直接写到script标签里,当页面加载完这个script标签就会执行里边的代码了,此时如果你标签里执行的代码调用 ...
- Java工具-检验ftp服务器的指定文件是否存在
项目工作中,需要检验ftp服务器中指定文件是否存在,在网上查阅了相关资料,可以通过ftpClient类进行实现. import org.apache.commons.net.ftp.FTP; impo ...
- GCC操作
GCC编译器常用选项 生成动态链接库: gcc file.c -fPIC -o file.so, PIC表示Position-Independent Code: 独立地址代码 编译: gcc -c f ...
- Window WindowManager 和WindowManager.LayoutParams
<一> Window window是android中的窗口,表示顶级窗口的意思,也就是主窗口,它有两个实现类, PhoneWindow和MidWindow,我们一般的activity对应的 ...