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 ...
随机推荐
- SpringMvc之java文件下载
首先强调,需要下载的文件只能放在项目中的webapp下 1.页面的一个超链接,链接到controller <a href="<%=path%>/download" ...
- UI-text-field
//初始化textfield并设置位置及大小 UITextField *text = [[UITextField alloc]initWithFrame:CGRectMake(20, 20, 130, ...
- How can I create an Asynchronous function in Javascript?
哈哈:)我的codepen 的代码笔记是:http://codepen.io/shinewaker/pen/eBwPxJ --------------------------------------- ...
- NodeJS 学习笔记一
他创造NodeJS的目的是为了实现高性能Web服务器,他首先看重的是事件机制和异步IO模型的优越性,而不是JS.但是他需要选择一种编程语言实现他的想法,这种编程语言不能自带IO功能,并且需要能良好支持 ...
- MVC 包命名规范
action+form = model actionservlet+struts-config.xml= controller jsp+自定义标签=veiw 备注:这里说明的非常好 m ...
- U盘启动安装Ubuntu
1.UltraISO制作USB启动盘 2.打开U盘目录下的\syslinux\syslinux.cfg, 将default vesamenu.c32注释为 # default vesamenu.c32
- MySQL忘记密码解决办法
一.windows下mysql忘记root密码的解决方法 详细出处参考:http://www.jb51.net/article/21984.htm 1,停止MYSQL服务,CMD打开DOS窗口,输入 ...
- cPanel 安装方法
. 如何安装cPanel/WHM? 答:安装过程较长,建议使用screen或nohupscreen: yum -y install screen perl screen -S cpanel cd /h ...
- mysql命令行操作 添加字段,修改字段
alter table t_apply change column remarks(原) apply_remarks(目标) varchar(100) default '' c ...
- 编写程序,从vector<char>初始化string
#include<iostream> #include<string> #include<vector> using namespace std; int main ...