Codeforces Round #451 (Div. 2)-898A. Rounding 898B.Proper Nutrition 898C.Phone Numbers(大佬容器套容器) 898D.Alarm Clock(超时了,待补坑)(贪心的思想)

时间:2022-11-10 08:31:16
 
A. Rounding
 
time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

Vasya has a non-negative integer n. He wants to round it to nearest integer, which ends up with 0. If n already ends up with 0, Vasya considers it already rounded.

For example, if n = 4722 answer is 4720. If n = 5 Vasya can round it to 0 or to 10. Both ways are correct.

For given n find out to which integer will Vasya round it.

Input

The first line contains single integer n (0 ≤ n ≤ 109) — number that Vasya has.

Output

Print result of rounding n. Pay attention that in some cases answer isn't unique. In that case print any correct answer.

Examples
input
5
output
0
input
113
output
110
input
1000000000
output
1000000000
input
5432359
output
5432360
Note

In the first example n = 5. Nearest integers, that ends up with zero are 0 and 10. Any of these answers is correct, so you can print 0 or 10.

代码:

 #include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long ll;
int main(){
ll n;
while(~scanf("%lld",&n)){
ll temp=n%;
if(temp>)n=n-temp+;
else n=n-temp;
printf("%lld\n",n);
}
return ;
 
 
 

Codeforces Round #451 (Div. 2)-898A. Rounding 898B.Proper Nutrition 898C.Phone Numbers(大佬容器套容器) 898D.Alarm Clock(超时了,待补坑)(贪心的思想)的更多相关文章

  1. Codeforces Round &num;451 &lpar;Div&period; 2&rpar; A&period; Rounding【分类讨论&sol;易错】

    A. Rounding time limit per test 1 second memory limit per test 256 megabytes input standard input ou ...

  2. Codeforces Round &num;451 &lpar;Div&period; 2&rpar; A B C D E

    Codeforces Round #451 (Div. 2) A Rounding 题目链接: http://codeforces.com/contest/898/problem/A 思路: 小于等于 ...

  3. Codeforces Round &num;451 &lpar;Div&period; 2&rpar; &lbrack; D&period; Alarm Clock &rsqb; &lbrack; E&period; Squares and not squares &rsqb; &lbrack; F&period; Restoring the Expression &rsqb;

    PROBLEM D. Alarm Clock 题 OvO http://codeforces.com/contest/898/problem/D codeforces 898d 解 从前往后枚举,放进 ...

  4. 【Codeforces Round &num;451 &lpar;Div&period; 2&rpar; A】Rounding

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 模拟 [代码] /* 1.Shoud it use long long ? 2.Have you ever test several ...

  5. Codeforces Round &num;451 &lpar;Div&period; 2&rpar;

    水题场.... 结果因为D题看错题意,B题手贱写残了...现场只出了A,C,E A:水题.. #include<bits/stdc++.h> #define fi first #defin ...

  6. Codeforces Round &num;451 &lpar;Div&period; 2&rpar; B&period; Proper Nutrition【枚举&sol;扩展欧几里得&sol;给你n问有没有两个非负整数x&comma;y满足x&&num;183&semi;a&ThinSpace;&plus;&ThinSpace;y&&num;183&semi;b&ThinSpace;&equals;&ThinSpace;n】

    B. Proper Nutrition time limit per test 1 second memory limit per test 256 megabytes input standard ...

  7. 【Codeforces Round &num;451 &lpar;Div&period; 2&rpar; B】Proper Nutrition

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 可以直接一层循环枚举. 也可以像我这样用一个数组来存y*b有哪些. 当然.感觉这样做写麻烦了.. [代码] /* 1.Shoud i ...

  8. 【Codeforces Round &num;451 &lpar;Div&period; 2&rpar; C】Phone Numbers

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 用map<string,vector > dic;模拟就好. 后缀.翻转一下就变成前缀了. 两重循环剔除这种情况不输出就 ...

  9. 【Codeforces Round &num;451 &lpar;Div&period; 2&rpar; D】Alarm Clock

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 尺取法+二分. 类似滑动窗口. 即左端点为l,右端点为r. 维护a[r]-a[l]+1总是小于等于m的就好. (大于m就右移左端点) ...

随机推荐

  1. Flexible 弹性盒子模型之CSS flex-basis 属性

    实例 设置第二个弹性盒元素的初始长度为 80 像素: div:nth-of-type(2){flex-basis:80px;}   效果预览 浏览器支持 表格中的数字表示支持该属性的第一个浏览器的版本 ...

  2. LOB字段存放在指定表空间 清理CLOB字段及压缩CLOB空间

     LOB字段存放在指定表空间 清理CLOB字段及压缩CLOB空间    把LOB字段的SEGMENT 存放在指定表空间.清理CLOB字段及压缩CLOB空间 1.创建LOB字段存放表空间:create ...

  3. 苹果所有常用证书,appID&comma;Provisioning Profiles配置说明及制作图文教程(精)

    holydancer原创,如需转载,请在显要位置注明: 转自holydancer的CSDN专栏,原文地址:http://blog.csdn.net/holydancer/article/details ...

  4. tungsten

    ./tools/tungsten-installer --master-slave -a --datasource-type=mysql --master-host=master.puppet.org ...

  5. 17-UIKit(UIView的动画)

    2. UIView的动画 UIView类本身具有动画的功能 2.1 概念 由UI对底层Core Animation框架的封装 可以轻松简单的实现动画效果 2.2 两种使用方式 1> Block ...

  6. git报错You are not allowed to force push code to a protected branch on this project

    当我们有时候回滚了代码,想强制push到远程仓库的时候, git push origin --force 会报如下错误: You are not allowed to force push code ...

  7. c&plus;&plus;11并发之std&colon;&colon;thread

    知识链接: https://www.cnblogs.com/lidabo/p/7852033.html 构造函数如下: ) thread() noexcept; initialization() te ...

  8. 机器学习编程语言之争,Python夺魁

    机器学习编程语言之争,Python夺魁 随着科技的发展,拥有高容量.高速度和多样性的大数据已经成为当今时代的主题词.数据科学领域中所采用的机器学习编程语言大相径庭.究竟哪种语言最适合机器学习成为争论不 ...

  9. python爬虫的页面数据解析和提取&sol;xpath&sol;bs4&sol;jsonpath&sol;正则&lpar;2&rpar;

    上半部分内容链接 : https://www.cnblogs.com/lowmanisbusy/p/9069330.html 四.json和jsonpath的使用 JSON(JavaScript Ob ...

  10. Join to domain powershell script

    Join to domain powershell script $username = "domain\admin" $Password = "xxxxxxxx&quo ...