当前位置:网站首页>[training Day2] torchbearer
[training Day2] torchbearer
2022-07-26 17:50:00 【SSL_ GYX】
Torchbearer

Their thinking
Direct violence enumeration 01 01 01 Digital string , Violent judgment is enough .( Non positive solution , But I can pass )
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");
}
边栏推荐
- 【集训Day2】Sculpture
- Use replace regexp to add a sequence number at the beginning of a line
- CCS TM4C123新建工程
- URL跳转漏洞
- 【OpenCV 例程 300篇】240. OpenCV 中的 Shi-Tomas 角点检测
- 【集训Day3】Reconstruction of roads
- API analysis of Taobao / tmall shipping address list and express delivery fees
- 【元宇宙欧米说】剖析 Web3 风险挑战,构筑 Web3 生态安全
- ACL experiment demonstration (Huawei router device configuration)
- [cloud native] IVX low code development was introduced into Tencent map and previewed online
猜你喜欢
2.1.2 同步始终失败

即刻报名|飞桨黑客马拉松第三期盛夏登场,等你挑战

硬件开发与市场产业

hosts该文件已设置为只读的解决方法

Ascend目标检测与识别-定制自己的AI应用

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

Machine learning - what are machine learning, supervised learning, and unsupervised learning

树形dp问题

GAN (Generative Adversarial Network,GAN)生成式对抗网络

How to set IP for layer 2 management switches
随机推荐
图解用户登录验证流程,写得太好了!
[cloud native kubernetes actual combat] kubeopertor installation tutorial
uni-app
2.1.2 同步始终失败
Spark统一内存划分
Sign up now | oar hacker marathon phase III midsummer debut, waiting for you to challenge
How to use align regexp to align userscript meta information
Definition of graph traversal and depth first search and breadth first search (I)
[300 opencv routines] 240. Shi Tomas corner detection in opencv
2.1.2 synchronization always fails
CCS tm4c123 new project
SQL injection (mind map)
COSCon'22城市/学校/机构出品人征集令
Hosts this file has been set to read-only solution
JS 递归 斐波那契数列 深克隆
Leetcode:1206. design jump table [jump table board]
【集训Day1】Spy dispatch
6-19漏洞利用-nsf获取目标密码文件
Tupu 3D visual national style design | collision between technology and culture "cool" spark“
AI遮天传 DL-多层感知机