CodeForces 678B The Same Calendar
暴力。一年一年判断过去。如果某一年与输入的年份闰年性质相同,并且1月1日是星期几相同,那么输出。
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<stack>
using namespace std; bool f(int x)
{
if(x%==) return ;
if(x%==&&x%!=) return ;
return ;
} int main()
{
int n; scanf("%d",&n);
int s=f(n);
int x=;
int now=n+;
int sum=;
while()
{
int t=f(now);
if(t==) sum=sum+;
else sum=sum+;
int g=(x+sum)%; if(t==s&&g==x)
{
printf("%d\n",now);
break;
}
now++;
}
return ;
}
CodeForces 678B The Same Calendar的更多相关文章
- Educational Codeforces Round 13 B. The Same Calendar 水题
B. The Same Calendar 题目连接: http://www.codeforces.com/contest/678/problem/B Description The girl Tayl ...
- 【codeforces 760A】Petr and a calendar
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...
- Codeforces Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined) A. Checking the Calendar(水题)
传送门 Description You are given names of two days of the week. Please, determine whether it is possibl ...
- codeforces C1. The Great Julya Calendar 解题报告
题目链接:http://codeforces.com/problemset/problem/331/C1 这是第一次参加codeforces比赛(ABBYY Cup 3.0 - Finals (onl ...
- Codeforces 760A Petr and a calendar
题目链接:http://codeforces.com/problemset/problem/760/A 题意:日历需要多少列. #include <bits/stdc++.h> using ...
- codeforces B. Calendar 解题报告
题目链接:http://codeforces.com/problemset/problem/304/B 题目意思:给出两个日期,需要算出这两个日期之间有多少日. 细心模拟就可以了.特别要注意的是,两个 ...
- 【63.63%】【codeforces 724A】Checking the Calendar
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...
- Codeforces Round #654 (Div. 2) B. Magical Calendar (结论)
题意:你需要在长度从\(1\)~\(k\),宽度无限的网格图中造图形(每个点四周必须连通),问最多能造出多少种不同的图形. 题解:感觉没什么好说的,就是画图找规律,如果\(r\ge n\)的话(即没有 ...
- codeforces 724
题目链接: http://codeforces.com/contest/724 A. Checking the Calendar time limit per test 1 second memory ...
随机推荐
- 单例:用AFNetworking封装举例
创建单例的方式 import AFNetworking class NetworkTools: AFHTTPSessionManager { //let是线程安全的 //使用单例实例只需要拿到Netw ...
- 【linux shell系列--1】crontab命令
摘自:http://www.cnblogs.com/peida/archive/2013/01/08/2850483.html 一.crond简介 crond是linux下用来周期性的执行某种任务或等 ...
- Mac 必备软件 Quicksilver
http://www.xdanger.com/2007/03/30/000067.html
- CVE-2014-4113 Win8.1 64位利用(2014.11)
CVE-2014-4113 Win8.1 64位利用 关于漏洞成因的分析已经很多了,但是样本针对的是win8之前的利用,国外研究员Moritz Jodeit对Win8.1上的利用做了研究,并给出了思路 ...
- C语言中结构体定义实际上相当于变量入栈
struct context { int edi; int esi; int ebx; int ebp; int eip;}; 对应的入栈顺序是 pushl %esp pushl %eip pushl ...
- pur-ftpd在ubuntu上的安装2(数据库管理)
1.安装mysql数据库支持的pure-ftpd apt-get install pure-ftpd-mysql 2.添加分组"ftpgroup",并且添加分组虚拟用户" ...
- test错误记录
1.Caused by: java.io.FileNotFoundException: D:\Program%20Files\Apache%20Software%20Foundation\Tomcat ...
- 外部VBS的调用
一.QTP调用外部VBS的方法 加到QTP的Resource中 在QTP菜单中设置, 菜单FileàSettingsàResource,将要加载的VB脚本添加进来. 举例: 步骤1:在D盘下新建一个V ...
- 新随笔ps泡泡制作
http://jingyan.baidu.com/article/4d58d5413568a79dd4e9c016.html
- LeetCode OJ 297. Serialize and Deserialize Binary Tree
Serialization is the process of converting a data structure or object into a sequence of bits so tha ...