[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 ...
随机推荐
- DDD实践:实现基于快照机制的变更追踪
王有志,一个分享硬核Java技术的互金摸鱼侠 加入Java人的提桶跑路群:共同富裕的Java人 去年我们在重构项目中落地了DDD,当时花了点时间研究了下阿里巴巴大淘宝技术发布的<阿里技术专家详解 ...
- Dubbo3应用开发——架构的演变过程
Dubbo3应用开发--架构的演变过程 什么是Dubbo 早期Dubbo的定位: 基于Java的高性能,轻量级的RPC框架:SOA[Service-Oriented Architecture ⾯向服务 ...
- Github的一个奇技淫巧
背景 前段时间给 VictoriaLogs 提交了一个 PR: https://github.com/VictoriaMetrics/VictoriaMetrics/pull/4934 本来一切都很顺 ...
- Redis持久化 (RDB和AOF) 梳理
Redis有两种持久化方案: RDB持久化 AOF持久化 RDB持久化 RDB全称Redis Database Backup file(Redis数据备份文件),也被叫做Redis数据快照.简单来说就 ...
- Nacos启动报错:Please set the JAVA_HOME variable in your environment, We need java(x64) jdk8 or later
可能原因: 1.JDK版本过低(应不低于1.8) 2.未设置jdk环境变量(可能性低) 3.jdk环境变量设置不适配nacos(博主就是这个原因) 解决方案: 1.直接在startup.cmd文件中设 ...
- Vue2系列(lqz)——slot插槽 (内容分发)、2 transition过渡、3 生命周期、4 swiper学习、5 自定义组件的封装、6 自定义指令、7 过滤器
文章目录 1 slot插槽 (内容分发) 1.1 基本使用 1.2 插槽应用场景1 1.3 插槽应用场景2 1.4 具名插槽 2 transition过渡 3 生命周期 4 swiper学习 5 自定 ...
- 原创基于Scrum框架产研团队运作20问
学习完了 Scrum,实际使用中,是否遇到/思考过下面的问题? Product Owner的老板是谁.谁来给 Product Owner打绩效.考核的标准是啥? Scrum Master 的老板是谁. ...
- 解决 Steam 无法自动登录的问题
前言 劳动节假期闲的没事,重装一下电脑,结果电脑的 Steam 不会自动登录了,每次重启电脑就要重新输入密码和令牌.查了一下居然是 Windows 凭据管理器默认不会自动启动的问题. 解决方法 打开计 ...
- oracle命令2 和一致性关闭、非一致性关闭
启动SQL*Plus语法sqlplus [username/password][@server] [as sysdba|sysoper] ,其中username/password如果不输人,SQL*P ...
- 我试图扯掉这条 SQL 的底裤。
你好呀,我是歪歪. 这次带大家盘一个我觉得有点意思的东西,也是之前写<一个烂分页,踩了三个坑!>这篇文章时,遇到的一个神奇的现象,但是当时忙着做文章搞定这个主线任务,就没有去深究这个支线任 ...