当前位置:网站首页>【集训Day2】Torchbearer
【集训Day2】Torchbearer
2022-07-26 16:55:00 【SSL_GYX】
Torchbearer

解题思路
直接暴力枚举 01 01 01 数字串,暴力判断即可。(非正解,但能过)
code
#include<iostream>
#include<cstring>
#include<cstdio>
#define int long long
using namespace std;
int n;
int d[20],tot;
int add(int i)
{
tot=0,i++;
memset(d,0,sizeof(d));
int t=0;
while(i)
{
d[++tot]+=i%10;
if(d[tot]==2)
d[tot+1]=1,d[tot]=0;
i/=10;
}
if(d[tot+1]) tot++;
for(;tot;tot--) i=i*10+d[tot];
return i;
}
signed main()
{
cin>>n;
for(int i=1;i<=1e18;)
{
if(i%n==0&&i>n)
return printf("%lld\n",i/n),0;
i=add(i);
}
printf("no solution\n");
}
边栏推荐
- Good afternoon, everyone. Please ask a question: how to start a job submitted in SQL from the savepoint? Problem Description: using SQL in Cl
- JS 函数作用域 变量声明提升 作用域链 不加var的变量,是全局变量
- E-week finance | postal Huiwanjia bank opened; Wechat public call to stop four types of financial marketing publicity
- 浅谈数据技术人员的成长之路
- Basic select statement
- CCS tm4c123 new project
- Eureka Registry - from entry to application
- kaggle猫狗数据集开源——用于经典CNN分类实战
- Is the rolling update of pod similar to Canary deployment or blue-green deployment?
- ASEMI整流桥KBPC2510,KBPC2510参数,KBPC2510规格书
猜你喜欢

树形dp问题

ASEMI整流桥KBPC3510,KBPC3510封装,KBPC3510应用
![[300 opencv routines] 240. Shi Tomas corner detection in opencv](/img/3a/0b81fb06e91e681ccc928e67297188.png)
[300 opencv routines] 240. Shi Tomas corner detection in opencv

二层管理型交换机如何设置IP

重磅公布!ICML2022奖项:15篇杰出论文,复旦、厦大、上交大研究入选

Spark统一内存划分

kudu设计-tablet

(25) top level menu of blender source code analysis blender menu

Hardware development and market industry

Come on developer! Not only for the 200000 bonus, try the best "building blocks" for a brainstorming
随机推荐
机器学习-什么是机器学习、监督学习和无监督学习
What are the popular technologies in 2022?
Advantages of time series database and traditional database
SQL中去去重的三种方式
# MySQL 七种连接方式图解
JS 闭包 模拟私有变量 面试题 立即执行函数IIFE
二层管理型交换机如何设置IP
Kudu design tablet
In depth exploration of ribbon load balancing
即刻报名|飞桨黑客马拉松第三期盛夏登场,等你挑战
OpenWrt之feeds.conf.default详解
Is it really safe and reliable to exempt five in case of opening an account in a stock company
Application of machine vision in service robot
Asemi rectifier bridge kbpc3510, kbpc3510 package, kbpc3510 application
PIP installation module, error
Summer Challenge openharmony greedy snake based on JS
【机器学习】Mean Shift原理及代码
Tensor operation in pytoch
Mondriaans‘s Dream(状态压缩DP)
(24)Blender源码分析之顶层菜单显示代码分析