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)$ ...
随机推荐
- Linux系统调用接口添加简单示例
1. Linux体系结构 Linux系统的地址空间分为用户空间和内核空间,通过系统调用和硬件中断能够完成从用户空间到内核空间的转移. 2. 系统调用接口 ① 一般情况下,用户进程不能访问内核空间.Li ...
- Linux 网络配置及常用服务配置(Redhat 6)
一.网络配置 1. VMWare 提供了三种网络工作模式供用户选择,他们分别是, ①Bridged(桥接模式): 如果网络中能提供多个IP地址,则使用桥接方式 ②NAT(网络地址转换模式): 如果网络 ...
- spark on yarn,cluster模式时,执行spark-submit命令后命令行日志和YARN AM日志
[root@linux-node1 bin]# ./spark-submit \> --class com.kou.List2Hive \> --master yarn \> --d ...
- python 使用csv.reader和csv.writer读写文件并转换成dataframe格式
import csv import pandas as pd ###csv.reader用法 ''' f=open(r"C:\Users\admin\pycdtest\wanyue\yuee ...
- 多个ajax请求时控制执行顺序或全部执行后的操作
1.当确保执行顺序时 (1)请求加async: false,,这样所有的ajax就会同步执行,请求顺序就是代码顺序: (2)$.when 确保所有异步的ajax请求完毕时 $.when($.aja ...
- 连接MySql的时候报1130的错误解决办法
部署了一个 数据库采用Mysql的程序,sqlyog连接非本地的Mysql服务器的数据库,居然无法连接很奇怪,报1130错误,ERROR 1130: Host 192.168.3.100 is not ...
- Redis学习1
Redis 学习记录 简介 redis是一个key-value存储系统.和Memcached类似,它支持存储的value类型相对更多,包括string(字符串).list(链表).set(集合).zs ...
- webConfig中<customErrors>节点配置
发布在远程计算机上的网站调试问题: 通常情况下我们会设置错误页,不让用户看到错误信息 这种WebConfig的配置方法是: <configuration> <system.web&g ...
- JS判断web网站访问端是PC电脑还是手机
通过JS语句判断WEB网站的访问端是电脑还是手机,以显示不同的页面! <script type="text/javascript"> <!-- //平台.设备和操 ...
- MySQL连接服务端的几种方式
一.MySQL 连接本地数据库,用户名为“root”,密码“123456”: D:\>mysql -h localhost -u root -p123456 注意:“-p”和“123456” 之 ...