当前位置:网站首页>[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");
}
边栏推荐
猜你喜欢

【集训Day1】Spy dispatch

Spark数据格式UnsafeRow

CCS tm4c123 new project
![[300 opencv routines] 240. Shi Tomas corner detection in opencv](/img/3a/0b81fb06e91e681ccc928e67297188.png)
[300 opencv routines] 240. Shi Tomas corner detection in opencv

Application of machine vision in service robot

【OpenCV 例程 300篇】240. OpenCV 中的 Shi-Tomas 角点检测

(24)Blender源码分析之顶层菜单显示代码分析

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

【集训Day3】Reconstruction of roads

JS function scope variables declare that the variables that promote the scope chain without VaR are global variables
随机推荐
Click hijacking attack
Coscon'22 city / school / institution producer solicitation order
Cross Site Request Forgery (CSRF)
【云原生】 iVX 低代码开发 引入腾讯地图并在线预览
Come on developer! Not only for the 200000 bonus, try the best "building blocks" for a brainstorming
CentOS installs docker and MySQL and redis environments
深度学习实验:Softmax实现手写数字识别
AI遮天传 ML-集成学习
敏捷开发与DevOps的对比
Interview with celebrities | open source is a double-edged sword for security -- Wei Jianfan, author of the Chinese translation of cathedral and market
硬件开发与市场产业
# MySQL 七种连接方式图解
2.1.2 synchronization always fails
一文详解吞吐量、QPS、TPS、并发数等高并发指标
重磅公布!ICML2022奖项:15篇杰出论文,复旦、厦大、上交大研究入选
(25) top level menu of blender source code analysis blender menu
How to set IP for layer 2 management switches
大咖访谈 | 开源对安全是双刃剑——《大教堂与集市》中文译本作者卫剑钒
Pytest (mind map)
JS 递归 斐波那契数列 深克隆