Codeforces 1183A Nearest Interesting Number
题目链接:http://codeforces.com/problemset/problem/1183/A

题意:求不小于 a 且每位数和能被 4 整除的 最小 n
思路:暴力模拟就好。
AC代码:
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a;
cin >> a;
bool flag = true;
int ans = ;
while(flag)
{
int t = a;
ans = ;
while(t)
{
ans += t%;
t/=;
}
if(ans % == ) flag = false;
else a++;
}
cout << a ;
return ;
}
Codeforces 1183A Nearest Interesting Number的更多相关文章
- Nearest Interesting Number
Polycarp knows that if the sum of the digits of a number is divisible by 33, then the number itself ...
- Codeforces1183A(A题)Nearest Interesting Number
Polycarp knows that if the sum of the digits of a number is divisible by 3, then the number itself i ...
- CodeForces - 598C Nearest vectors(高精度几何 排序然后枚举)
传送门: http://codeforces.com/problemset/problem/598/C Nearest vectors time limit per test 2 seconds me ...
- dp --- Codeforces 245H :Queries for Number of Palindromes
Queries for Number of Palindromes Problem's Link: http://codeforces.com/problemset/problem/245/H M ...
- Educational Codeforces Round 11 D. Number of Parallelograms 暴力
D. Number of Parallelograms 题目连接: http://www.codeforces.com/contest/660/problem/D Description You ar ...
- Codeforces 980 E. The Number Games
\(>Codeforces \space 980 E. The Number Games<\) 题目大意 : 有一棵点数为 \(n\) 的数,第 \(i\) 个点的点权是 \(2^i\) ...
- Codeforces 724 G Xor-matic Number of the Graph 线性基+DFS
G. Xor-matic Number of the Graph http://codeforces.com/problemset/problem/724/G 题意:给你一张无向图.定义一个无序三元组 ...
- 【codeforces 805D】Minimum number of steps
[题目链接]:http://codeforces.com/contest/805/problem/D [题意] 给你一个字符串; 里面只包括a和b; 让你把里面的"ab"子串全都去 ...
- Codeforces J. Soldier and Number Game(素数筛)
题目描述: Soldier and Number Game time limit per test 3 seconds memory limit per test 256 megabytes inpu ...
随机推荐
- windows下Docker安装MySQL
# docker 中下载 mysql docker pull mysql #启动 docker run --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD ...
- activiti7组任务测试
package com.zcc.activiti05; import org.activiti.engine.*;import org.activiti.engine.repository.Deplo ...
- Java对象相等比较(Equals)
以下代码显示如何实现equals()和hashCode()方法 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 ...
- Android组件内核之Service内核原理(三)
阿里P7Android高级架构进阶视频免费学习请点击:https://space.bilibili.com/474380680本篇文章将先从以下三个内容来介绍Service内核原理: [startSe ...
- Linux/x86-64 - setuid(0) & chmod ("/etc/passwd", 0777) & exit(0) - 63 byes
/* Title: Linux/x86-64 - setuid(0) & chmod ("/etc/passwd", 0777) & exit(0) - 63 by ...
- Day1 - 认识大数据& 企业需求分析 & 北风网简介
上午: 介绍: 海量的乱七八糟的数据中快速的计算出某些有用的信息 刑侦视频追踪 云栖大会 大数据分析/挖掘 ==> python <== 重点关注 大数据运维 ==> 运服务 ...
- go之linux安装
下载地址:https://golang.org/dl/ ubuntu16.04安装过程 官方安装文档:https://golang.org/doc/install?download=go1.11.4. ...
- 7、服务发现&服务消费者Ribbon
公众号: java乐园 在<服务注册&服务提供者>这一篇可能学习了这么开发一个服务提供者,在生成上服务提供者通常是部署在内网上,即是服务提供者所在的服务器是与互联网完全隔离的.这篇 ...
- Java的枚举类型使用方法详解
1.背景在java语言中还没有引入枚举类型之前,表示枚举类型的常用模式是声明一组具有int常量.之前我们通常利用public final static 方法定义的代码如下,分别用1 表示春天,2表示夏 ...
- 2019-9-2-C#委托
title author date CreateTime categories C#委托 lindexi 2019-09-02 12:57:37 +0800 2018-2-13 17:23:3 +08 ...