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

来吧开发者!不只为了 20 万奖金,试试用最好的“积木”来一场头脑风暴吧!...

敏捷开发与DevOps的对比

Application of machine vision in service robot

Diagram of seven connection modes of MySQL

Heavy announcement! Icml2022 Awards: 15 outstanding papers, selected by Fudan University, Xiamen University and Shanghai Jiaotong University

URL跳转漏洞
2.1.2 synchronization always fails

【云原生】 iVX 低代码开发 引入腾讯地图并在线预览

图解用户登录验证流程,写得太好了!

leetcode:1206. 设计跳表【跳表板子】
随机推荐
深度学习实验:Softmax实现手写数字识别
徽商期货网上开户安全吗?开户办理流程是怎样的?
# MySQL 七种连接方式图解
Come on developer! Not only for the 200000 bonus, try the best "building blocks" for a brainstorming!
来吧开发者!不只为了 20 万奖金,试试用最好的“积木”来一场头脑风暴吧!
Asemi rectifier bridge kbpc2510, kbpc2510 parameters, kbpc2510 specifications
SQL中去去重的三种方式
On the growth of data technicians
Coscon'22 city / school / institution producer solicitation order
(25)Blender源码分析之顶层菜单Blender菜单
JS recursive Fibonacci sequence deep cloning
【集训Day1】 Dwarves line up
如何通过学会提问,成为更加优秀的数据科学家
Use dired to move files quickly
线性表的顺序存储结构——顺序表
Open source kaggle cat and dog data set -- used in classic CNN classification practice
Asemi rectifier bridge kbpc3510, kbpc3510 package, kbpc3510 application
Tianyi cloud web application firewall (edge cloud version) supports the detection and interception of Apache spark shell command injection vulnerabilities
Spark unified memory partition
[cloud native] IVX low code development was introduced into Tencent map and previewed online