[ABC262A] World Cup
Problem Statement
A sport event is held in June of every year whose remainder when divided by $4$ is $2$.
Suppose that it is now January of the year $Y$. In what year will this sport event be held next time?
Constraints
- $2000 \leq Y \leq 3000$
- $Y$ is an integer.
Input
Input is given from Standard Input in the following format:
$Y$
Output
Print the answer.
Sample Input 1
2022
Sample Output 1
2022
The remainder when $2022$ is divided by $4$ is $2$, so if it is now January of $2022$, the next games will be held in June of the same year.
Sample Input 2
2023
Sample Output 2
2026
Sample Input 3
3000
Sample Output 3
3002
模拟即可。
#include<cstdio>
int y;
int main()
{
scanf("%d",&y);
if(y%4==3)
printf("%d",y+3);
else
printf("%d",y+(2-y%4));
}
[ABC262A] World Cup的更多相关文章
- java高cup占用解决方案
项目中发现java cpu占用高达百分之四百,查看代码发现有一个线程在空转,拉高了cup while(true){ } 解决方案,循环中加入延迟:Thread.sleep(Time): 总结下排查CP ...
- UVALive 7147 World Cup(数学+贪心)(2014 Asia Shanghai Regional Contest)
题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&category=6 ...
- uva 6757 Cup of Cowards(中途相遇法,貌似)
uva 6757 Cup of CowardsCup of Cowards (CoC) is a role playing game that has 5 different characters (M ...
- 【转】关于KDD Cup '99 数据集的警告,希望从事相关工作的伙伴注意
Features From: Terry Brugger Date: 15 Sep 2007 Subject: KDD Cup '99 dataset (Network Intrusion) cons ...
- Facebook Hacker Cup 2014 Qualification Round 竞赛试题 Square Detector 解题报告
Facebook Hacker Cup 2014 Qualification Round比赛Square Detector题的解题报告.单击这里打开题目链接(国内访问需要那个,你懂的). 原题如下: ...
- DP VK Cup 2012 Qualification Round D. Palindrome pairs
题目地址:http://blog.csdn.net/shiyuankongbu/article/details/10004443 /* 题意:在i前面找回文子串,在i后面找回文子串相互配对,问有几对 ...
- [BZOJ 3145][Feyat cup 1.5]Str 解题报告
[Feyat cup 1.5]Str DescriptionArcueid,白姬,真祖的公主.在和推倒贵看电影时突然对一个问题产生了兴趣:我们都知道真祖和死徒是有类似的地方.那么从现代科学的角度如何解 ...
- HDU 2289 CUP 二分
Cup Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submiss ...
- VK Cup 2012 Round 3 (Unofficial Div. 2 Edition)
VK Cup 2012 Round 3 (Unofficial Div. 2 Edition) 代码 VK Cup 2012 Round 3 (Unofficial Div. 2 Edition) A ...
- UVALive 7275 Dice Cup (水题)
Dice Cup 题目链接: http://acm.hust.edu.cn/vjudge/contest/127406#problem/D Description In many table-top ...
随机推荐
- SimpleDateFormat 线程安全问题修复方案
问题介绍 在日常的开发过程中,我们不可避免地会使用到 JDK8 之前的 Date 类,在格式化日期或解析日期时就需要用到 SimpleDateFormat 类,但由于该类并不是线程安全的,所以我们常发 ...
- 使用PySpark计算AUC,KS与PSI
当特征数量或者模型数量很多的时候,使用PySpark去计算相关指标会节省很多的时间.网上关于使用PySpark计算相关指标的资料较少,这里抛砖引玉,写了三个风控常用的指标AUC,KS和PSI相关的计算 ...
- vlak
2023-7-14 题目 luogu题目传送门 题目描述 Nina 和 Emilija 正在玩一个特殊的游戏.这个游戏是在一张最开始为空白的纸上进行的.在每一个人的行动回合内,这个人会在这张纸上当前的 ...
- React仿大众点评外卖app
主要使用技术: react react-router4 redux: action.reducer.store管理数据 fetch: 进行数据交互 prismjs : 页面嵌入代码,高亮显示插件 bu ...
- SpringBoot打成jar运行后无法读取resources里的文件
开发一个word替换功能时,因替换其中的内容功能需要 word 模版,就把 word_replace_tpl.docx 模版文件放到 resources 下 在开发环境中通过下面方法能读取word_r ...
- 国庆微信头像DIY:轻松打造个性化头像
前言 国庆节马上要到了,今天就教你如何从0到1使用canvas生成国庆风微信头像. 本文包含以下内容: vue3项目搭建,需求分析 canvas合成图片原理 github自动化部署 开发过程遇到的问题 ...
- nacos2.X版本无法注册的几个原因以及解决方案(踩坑避雷!)
在使用nacos+dubbo 注册服务的时候 遇到了无法注册的问题 记录一下踩的坑以及解决方案 com.alibaba.nacos.api.exception.NacosException: Requ ...
- 【Azure Function App】Python Function调用Powershell脚本在Azure上执行失败的案例
问题描述 编写Python Function,并且在Function中通过 subprocess 调用powershell.exe 执行 powershell脚本. import azure.fun ...
- 数据结构与算法 | 链表(Linked List)
链表(Linked List)是一种线性数据结构,它由一系列节点(Node)组成,每个节点包含两部分:数据和指向下(上)一个节点的引用(或指针).链表中的节点按照线性顺序连接在一起(相邻节点不需要存储 ...
- DASCTF X CBCTF 2023|无畏者先行(Misc WP)
justpaint 1.题目信息 FLAG被我弄丢了>_<不过,JBN应该记得,或许你能从他那得到一些线索. 附件是压缩包有密码.. 2.解题方法 暴力破解压缩包,测试长度为6,选择所有数 ...