poj1426 Find The Multiple

Ubuntu 20.04 server 安装 Ubuntu 20.04 server 安装 前面我们介绍了 Ubuntu Desktop 版本的安装,今天我们来看看 Ubuntu server 版本的安装。Ubuntu Server 版本的安装和 Desktop 有很大的区别,并且全程不能使用鼠标,只能通过键盘。 从光盘或 U 盘启动到 Welcome 界面,选择语言,一般都是使用 English,所以保保持默认,直接按回车即可; 系统检测到了新的版本,问你是否是否更新,这里我们不需要安装新的版本,所以选项 Continue without upda 阅读详情

Find The Multiple
Time Limit: 1000MS Memory Limit: 10000K
Total Submissions: 29065 Accepted: 12059 Special Judge

Description

Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater than 200 and there is a corresponding m containing no more than 100 decimal digits.

Input

The input file may contain multiple test cases. Each line contains a value of n (1 <= n <= 200). A line containing a zero terminates the input.

Output

For each value of n in the input print a line containing the corresponding value of m. The decimal representation of m must not contain more than 100 digits. If there are multiple solutions for a given value of n, any one of them is acceptable.

Sample Input

2
6
19
0

Sample Output

10
100100100100100100
111111111111111111

Source

想过用longlong试试,wa,

看了题解用unsigned longlong可以过,较坑,但你想不到就过不了

#include<stdio.h>
int flog=0;
unsigned long long int ans[205];
int dfs(unsigned long long int m,int x,int k)
{
//	printf("%lld\n",m);
	if(flog||k>=19)
	return 0;
	if(m%x==0)
	{
		printf("%I64u\n",m);
		ans[x]=m;
		flog=1;
		return 0;
	}
	dfs(m*10,x,k+1);
	dfs(m*10+1,x,k+1);
}
int main()
{
	int n;
	while(scanf("%d",&n),n)
	{	
		flog=0;
		dfs(1,n,0);
	}
	return 0;
}




MSVS C# Matlab的混合编程系列2 - 构建一个复杂(含多个M文件)的动态库: 本节我们尝试将一个有很多函数和文件的Matlab算法文件集成到C#的项目里面。 阅读详情

相关推荐

概率论 知识图谱 + 实战案例解析

本文通过构建概率论知识图谱,系统梳理了从随机试验、概率、条件概率到随机变量与分布的核心概念及其内在联系。结合朴素贝叶斯分类器和蒙特卡洛模拟等实战案例,深入解析了条件概率、独立性及大数定律等理论如何应用于机器学习与实际问题求解,旨在帮助读者建立结构化思维,将理论有效转化为解决实际问题的能力。

weixin_29051193的博客 267

poj1426 Find The Multiple(bfs)

Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater than 200 and there

Jamence的博客 313

PyTorch模型生产部署:ONNX/Triton导出与高可用架构实战

机器学习模型部署本质是训练环境与生产环境之间的运行时契约建立过程,涉及序列化协议、推理引擎兼容性、动态批处理及资源隔离等核心问题。ONNX凭借标准化算子集和跨框架支持,成为平衡兼容性、性能与可维护性的首选导出格式;Triton Inference Server则通过原生多框架支持、动态batching和热加载能力,显著提升GPU利用率与服务SLA保障水平。在金融风控、电商推荐等高要求场景中,基于ONNX+Triton+K8s的分层架构可稳定支撑千级QPS与毫秒级P95延迟,同时满足模型热更新、可观测性与版本

weixin_33857679的博客 448

CareerCup Find out the winning probability given n, m and x

You are given n dices each with heads numbered from 1 to m. You are to throw the n dices and note down the sum of the numbers on each of the n dices. You'll be give a number x and its a win if the s

taoqick的专栏 1062

自动化专业与嵌入式

在学生时期,我是一个典型的学渣,所以只能选择电气工程、汽修、数控之类的专业。而那些高分的则可以选择计算机,电子商务,通信之类的。这些专业看起来像是蓝领和白领的分界,至今我都觉得这种制度是不人性化的。专业这块根据学生的爱好去选择是最好的,毕竟有兴趣才会”真心”去学习。谁说学渣就学不会编程、学不会金融对吧?不过也罢,在学校能学到东西的毕竟是少数,最近有些大学生发了他们的课程表给我看了下。我感觉学的太广了,什么单片机、c语言、java之类的,导致很多学生学完以后还是很迷茫,不知道自己专业到底是从事什么方向的。所以

m0_71017841的博客 3588

Unity接入Google登录:Credential Manager完整集成指南与避坑实践

在移动应用开发中,第三方登录是提升用户体验和降低注册门槛的关键技术。其核心原理是通过OAuth 2.0等授权协议,安全地获取用户在平台的身份凭证。对于面向海外市场的Unity应用,Google登录因其庞大的用户基数成为首选方案。然而,随着Android系统更新和隐私政策收紧,传统的WebView登录方式面临兼容性挑战。Credential Manager作为Google推出的现代化凭据管理API,通过系统级集成解决了这一问题,它统一了密码、通行密钥和第三方登录的调用接口,显著提升了登录成功率和原生体验。在U

weixin_28025327的博客 319

Find The Multiple

Description Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater t

木槿花非花的博客 4420

从网格划分到端口接地:一份给ADS新手的Momentum RF仿真避坑实操指南

本文为ADS新手提供Momentum RF仿真的实用指南,涵盖网格划分、端口接地、特殊结构处理等关键设置技巧。通过30-50 cells/λ原则、1/10波长限制等黄金法则,帮助用户平衡仿真精度与效率,避免常见错误,提升电磁仿真结果的准确性。

weixin_33692284的博客 505

poj1426——Find The Multiple

擦,有点纸老虎的味道!滚动数组实现:#include #include __int64 queue[10000000],n; void solve() { int i,front=0,rear=0; queue[++rear]=1; __int64 t; while(front!=rear) { front=(front+1)%10000000; t=queue[front]; if(t%n==0) { printf("%I64d/n",t);

r_ax的专栏 487

百度智能云训练图像分割模型+python调用模型并分割图像

目录 训练模型阶段 发布图像分割API 调用图像分割API 创建应用后显示以下两个代码 在pycharm中可以调用API mask解码 依赖库pycocotools安装步骤: 依赖库urllib2的安装 源码下载: 最近上课听老师介绍了一个训练图像分割模型的网站,把数据集上传之后做图像标注,然后进行训练就能得到准确率等指标。 训练模型阶段 图像分割:https://ai.baidu.com/easydl/vision/ 图像分割-->创建模型-->上传数据--&gt

icecreamdinner的博客 1388

2025年7月12日全国青少年信息素养大赛图形化(Scratch)编程小学低年级组复赛真题+答案解析

2025年7月12日全国青少年信息素养大赛图形化(Scratch)编程小学低年级组复赛真题+答案解析

伶俐角少儿编程 710

POJ 1426 Find The Multiple 简单dfs构造

POJ 1426 Find The Multiple 简单dfs构造题意大概意思题解 链接: 原题网站. 题意 Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater than 200 and there

zkpj12的博客 262

【实战圣经】YOLOv8-pose姿态估计模型从训练到RK3588部署:让边缘端骨骼识别速度突破60FPS

本教程从“模型训练-转换-边缘部署”全链路拆解了YOLOv8-pose姿态估计方案在RK3588上的落地过程,每一步都经过实战验证。无论是智能健身的动作实时纠正,还是工业设备的关键部件姿态检测,这套流程都能让你以最低成本实现高精度、高实时性的姿态估计应用。如果你在实践中遇到模型转换报错、部署性能不达标等问题,可聚焦某一环节深入优化——毕竟,让AI在边缘端“精准捕捉每一个关键点”,才是技术驱动场景创新的核心。

m0_71589036的博客 251

POJ1426 Find The Multiple

POJ1426 Find The Multiple题目描述 Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is

退役的铜牌狗 368

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

POJ 1426 Find The Multiple

POJ 1426 Find The Multiple 题目链接http://poj.org/problem?id=1426 Description Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only ...

weixin_30352191的博客 87

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

POJ.1426 Find The Multiple (BFS)

POJ.1426 Find The Multiple (BFS)题意分析给出一个数字n,求出一个由01组成的十进制数,并且是n的倍数。思路就是从1开始,枚举下一位,因为下一位只能是0或1,故这个数字只能是1 * 10或者1 * 10 + 1。就按照这种方式枚举,依次放入队列,如果是其的倍数,就输出。一开始没理解题意,以为是找一个能整除的二进制数,错了半天。代码总览#include <cstdio>

Pengwill's Blog 354

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

POJ1426--Find The Multiple

POJ1426–Find The Multiple 目录POJ1426--Find The Multiple一、题目链接二、题目内容三、题意拆解四、解题思路五、参考代码 一、题目链接 POJ1426 二、题目内容 Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You

Verber的博客 792

【POJ】1426 Find The Multiple

题目链接:http://poj.org/problem?id=1426 题意:给定一个正整数n,找一个比n大且能只由01构成的且能够被n整除的数。 题解:这个就是在后面添0和添1小心试探。一定要是添0不成功再去添1。 代码: 1 #include<iostream> 2 #include<cstdio> 3 using na...

deze1991的专栏 170

POJ-1426 Find The Multiple

POJ-1426 Find The Multiple 题目链接:POJ-1426 题目大意:找到一个数 这个数只由1或0组成 且是给定数的整倍数 解题思路:只由1或者0组成 那么就从1为起点 每次乘10 或者乘10+1 就能覆盖到所有的数 BFS搜索即可 注意示例给定的不是最小解 不要被误导 代码块: #include<iostream> #include<queue> ...

鱼头的水题之路 215

poj 1426 Find The Multiple (bfs 搜索)

Find The Multiple Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 18012   Accepted: 7297   Special Judge Description Given a positive integer n, write a pr

Just do it ! 1788

POJ-1426 Find The Multiple

状压

Brust Link 930

E - Find The Multiple POJ - 1426

E - Find The MultiplePOJ - 1426 Find The Multiple Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. ...

qq_31267769的博客 283

Poj 1426 Find The Multiple

Poj 1426 Find The Multiple 题意 给一个数n(1 <= n <= 200),求它的非零倍数m, m 是一个仅含有1或0的十进制数,m不超过100位(十进制),求一个m值即可。 解题思路 这道题我读了几遍,竟然没读懂。知道题意就很简单了,BFS,从1开始暴力搜索。 代码 #include <stdio.h> #includ...

qq_33005379的博客 194

poj 1426 Find The Multiple

poj 1426 Find The Multiple http://poj.org/problem?id=1426 题意:Given a positive integer n, write a program to find out a nonzero multiple(倍数) m of n whose decimal(十进制) representation contains o...

aidibi1469的博客 127
上一篇: HDU-3555Bomb 数位dp
下一篇: poj 3279 Fliptile
jerans
博客等级 码龄10年 54粉丝 255原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值