Educational Codeforces Round 21 808A Lucky Year
来源:互联网 发布:cad2014软件多少钱 编辑:程序博客网 时间:2024/06/07 20:20
Educational Codeforces Round 21 808A Lucky Year
A. Lucky Year
time limit per test
1 secondmemory limit per test
256 megabytesinput
standard inputoutput
standard outputApart from having lots of holidays throughout the year, residents of Berland also have whole lucky years. Year is considered lucky if it has no more than 1 non-zero digit in its number. So years 100, 40000, 5 are lucky and 12, 3001 and 12345 are not.
You are given current year in Berland. Your task is to find how long will residents of Berland wait till the next lucky year.
Input
The first line contains integer number n (1 ≤ n ≤ 109) — current year in Berland.
Output
Output amount of years from the current year to the next lucky one.
Examples
input
4
output
1
#include <stdio.h>#include <bits/stdc++.h>#define mod 1000000007typedef long long ll;using namespace std;ll n;int main(){ cin>>n;ll a=n,b=1;while(a){if(a<10){b*=a+1;break;} b=b*10;a/=10;}cout<<b-n; return 0;}
阅读全文
1 0
- Educational Codeforces Round 21 A. Lucky Year
- Educational Codeforces Round 21 A. Lucky Year
- Educational Codeforces Round 21 A. Lucky Year
- Educational Codeforces Round 21 808A Lucky Year
- codeforces 808A Lucky Year
- 【Codeforces 808 A. Lucky Year】
- Codeforces 808A Lucky Year 题解
- 【Codeforces 808A】【模拟】Lucky Year 题解
- CodeForces 808A Lucky Year(思维)
- Educational Codeforces Round 21 A
- 808A Lucky Year
- codeforces Educational Codeforces Round 21 A
- codeforces——808A——Lucky Year
- Codeforces Educational Codeforces Round 21 [5.30] Tea Party&Array Division&Average Sleep Time&Lucky
- Educational Codeforces Round 5 A
- Educational Codeforces Round 20 A
- Educational Codeforces Round 23 A
- Educational Codeforces Round 21
- Video Introduction to Bayesian Data Analysis, Part 1: What is Bayes?
- codeforcodeforces 808E——Selling Souvenirs(动态规划)官方题解详解
- 【ssm个人博客项目实战08】博客的分页显示以及模糊查询,删除。
- 如何传输文件到Linux服务器上
- 字符串中单词的逆转
- Educational Codeforces Round 21 808A Lucky Year
- hook钩子的使用
- install pstricks into texlive
- 剑指offer 8. 旋转数组的最小数字
- 21.输入一个复杂链表(每个节点中有节点值,以及两个指针,一个指向下一个节点,另一个特殊指针指向任意一个节点),返回结果为复制后复杂链表的head。(注意,输出结果中请不要返回参数中的节点引用,否则判
- 打造高质效的技术团队 —— 混乱篇
- I2S音频总线(一)————数字音频技术
- Machine Learning Pipelines for R
- CentOS7 安装Maven