Nearest Interesting Number
https://codeforces.com/contest/1183/problem/A
题解:朴素
/*
*@Author: STZG
*@Language: C++
*/
#include <bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<string>
#include<vector>
#include<bitset>
#include<queue>
#include<deque>
#include<stack>
#include<cmath>
#include<list>
#include<map>
#include<set>
//#define DEBUG
#define RI register int
#define endl "\n"
using namespace std;
typedef long long ll;
//typedef __int128 lll;
const int N=100000+10;
const int M=100000+10;
const int MOD=1e9+7;
const double PI = acos(-1.0);
const double EXP = 1E-8;
const int INF = 0x3f3f3f3f;
int t,n,m,k,p,l,r,u,v;
int ans,cnt,flag,temp,sum;
bool check(int n){int res=0;while(n){res+=n%10;n/=10;}return res%4!=0;
}
int main()
{
#ifdef DEBUGfreopen("input.in", "r", stdin);//freopen("output.out", "w", stdout);
#endif//ios::sync_with_stdio(false);//cin.tie(0);//cout.tie(0);//scanf("%d",&t);//while(t--){scanf("%d",&n);while(check(n))n++;cout<<n<<endl;//}#ifdef DEBUGprintf("Time cost : %lf s\n",(double)clock()/CLOCKS_PER_SEC);
#endif//cout << "Hello world!" << endl;return 0;
}
Nearest Interesting Number相关推荐
- CodeForces - 1560F2 Nearest Beautiful Number (hard version)(二分+数位dp)
题目链接:点击查看 题目大意:给出一个十进制数字 nnn 和一个约束 kkk,问大于等于 nnn 且满足不同的数位个数小于等于 kkk 的最小的数字是多少 题目分析:自己写的贪心太丑了,就不放上来丢人 ...
- 1560F1. Nearest Beautiful Number (easy version)
F1. Nearest Beautiful Number (easy version) 预处理加二分 #include <bits/stdc++.h> using namespace st ...
- number precious解决精度问题
问题描述 安装 npm install number-precision --save 主要方法 可以计算加减乘除(plus,minus,times, divides)以及求相近值(strip, ro ...
- AI:Algorithmia《2020 state of enterprise machine learning—2020年企业机器学习状况》翻译与解读
AI:Algorithmia<2020 state of enterprise machine learning-2020年企业机器学习状况>翻译与解读 目录 <2020 state ...
- 如何在Python中四舍五入数字
It's the era of big data, and every day more and more business are trying to leverage their data to ...
- Forward vs Deferred vs Forward+ Rendering with DirectX 11
原文:http://www.3dgep.com/forward-plus/ Introduction Forward rendering works by rasterizing each geome ...
- iPhone应用程序图标 - 精确半径?
本文翻译自:iPhone App Icons - Exact Radius? I'm trying to create the icon for my iPhone app, but don't kn ...
- mysql to double_MySQL令人咋舌的隐式转换 - 惊觉...
导读 作者徐晨亮, MySQL DBA,知数堂学员.热衷于数据库优化,自动化运维及数据库周边工具开发,对 MySQL源码有一定的兴趣 本文建议横屏观看,效果更佳 一.问题描述 [email prote ...
- Numpy数组常用函数汇总(数学运算、三角函数、位运算、比较运算及其它)
一.数学运算 函数名 description 说明 add(x1, x2, [, out, where, casting, order, -]) Add arguments element-wise. ...
最新文章
- Cannot initialize a parameter of type ‘NSArray<id<RCTBridgeModule>> *‘ with an rvalue of type ‘NSArr
- 用g.raphael.js高速绘制饼图、柱状图、点状图、折线图(下)
- 电子科大计算机学院硕士培养方案,电子科技大学制订全日制硕士专业学位研究生培养方案基本要求.doc...
- inode directory
- C++11并发编程:多线程std::thread
- 书籍推荐-记这几年看的书
- node中间件KOA函数
- 2020年天猫双11:11日0点30分 实时成交额突破3723亿
- 案例:规则引擎Drools解决汽水问题
- 【项目实施随笔】改造一下Dialog
- 比较默认对象和默认约束的异同_UE4对象类类型引用和类默认对象(Class Default Object,简称CDO)...
- AtCoder Beginner Contest 137 解题报告(A ~ E)
- 1、CSS Float(浮动),2、CSS 布局 - 水平 垂直对齐,3、CSS 伪类(Pseudo-classes),4、导航栏
- 2021年山东大学考研数字电路906真题
- Pixhawk之启动代码和入口函数(.mk、rcS、__start、hrt)
- AM335x片上ecap驱动移植
- c8051f020 I/O配置小结
- tif文件转为shp文件_ArcGIS栅格数据与矢量数据的转换
- 设置页面高度为浏览器可视窗口大小
- 代理模式——游戏代练
热门文章
- 软件压力测试linux服务器,使用http_load来给Linux系统的服务器做压力测试
- zookeeper版本更新_ZooKeeper入门,看这篇就够了!
- hj212协议如何和php通讯,HJ212数据传输标准报文解析
- php日期差数,php如何计算日期差几天
- mysql.net开发驱动_mysql数据库.net开发驱动(mysql connector net )
- linux ps1 目录颜色,Linux下PS1终端下的颜色设置
- c语言多关卡推箱子程序,多关卡地图推箱子游戏
- 面具卡米怎么删模块_魔兽8.3咋肥事——面具带几个收益高?对小怪宝箱水晶有加成吗?...
- 四十六、深入Java的网络编程(下篇)
- redis 启动无输出_深入剖析Redis系列: Redis入门简介与主从搭建