思路:

2的最近可以整除的数是10

所以,很关键的一点,只要是偶数,例如:

6:2*3,可以拆分为能够被2整除和能够被3整除的乘积,所以,10*111=1110

144:72*2,8*9*2,2*2*2*2*3*3,能够整除9的后面加4个0,1111111110000

java至于素数,java暴力打表

#include<stdio.h>
#include <iostream>
#include <string.h>
#include <stdlib.h>
#include <algorithm>
using namespace std;
string arr[]={
"","","","","","","","","","","","","","",
"","","","","","","","","",""
,"","","","","","","","",""
,"","","","","","","","","",
"","","","","","","","",
"","","","","","","","","",
"","","","","","","","",
"","","","","","","","","",
"","","","","","","","",
"","","","","","","","",
"","","","","","","","","",
"","","","","","","","","","","","","","","","",
"","","","","","","","",
"","","","","","","","","","","","","","",
"","","","","","","","","","","","","","","","","","",
"","","","","",
"","","","","","","","","","","","","","","","",
"","","","","","","","","","","","","","","","","",
"","","","","",""
};
//189没有暴力出来,然而,测试数据没有189
int main()
{
int n;
while (scanf("%d", &n)!=EOF && n) {
cout<<arr[n]<<endl;
}
return ;
}

poj-1426-Find The Multiple(打表水过)的更多相关文章

  1. 广搜+打表 POJ 1426 Find The Multiple

    POJ 1426   Find The Multiple Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 25734   Ac ...

  2. DFS/BFS(同余模) POJ 1426 Find The Multiple

    题目传送门 /* 题意:找出一个0和1组成的数字能整除n DFS:200的范围内不会爆long long,DFS水过~ */ /************************************ ...

  3. POJ 1426 Find The Multiple --- BFS || DFS

    POJ 1426 Find The Multiple 题意:给定一个整数n,求n的一个倍数,要求这个倍数只含0和1 参考博客:点我 解法一:普通的BFS(用G++能过但C++会超时) 从小到大搜索直至 ...

  4. POJ 1426 Find The Multiple(寻找倍数)

    POJ 1426 Find The Multiple(寻找倍数) Time Limit: 1000MS    Memory Limit: 65536K Description - 题目描述 Given ...

  5. POJ.1426 Find The Multiple (BFS)

    POJ.1426 Find The Multiple (BFS) 题意分析 给出一个数字n,求出一个由01组成的十进制数,并且是n的倍数. 思路就是从1开始,枚举下一位,因为下一位只能是0或1,故这个 ...

  6. POJ 1426 Find The Multiple (DFS / BFS)

    题目链接:id=1426">Find The Multiple 解析:直接从前往后搜.设当前数为k用long long保存,则下一个数不是k*10就是k*10+1 AC代码: /* D ...

  7. POJ 1426 Find The Multiple(数论——中国同余定理)

    题目链接: http://poj.org/problem?id=1426 Description Given a positive integer n, write a program to find ...

  8. POJ 1426 - Find The Multiple - [DP][BFS]

    题目链接:http://poj.org/problem?id=1426 Given a positive integer n, write a program to find out a nonzer ...

  9. POJ - 1426 Find The Multiple(搜索+数论)

    转载自:優YoU  http://user.qzone.qq.com/289065406/blog/1303946967 以下内容属于以上这位dalao http://poj.org/problem? ...

  10. poj 1426 Find The Multiple (bfs 搜索)

    Find The Multiple Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 18012   Accepted: 729 ...

随机推荐

  1. 一步步讲解如何开源自己的项目到GitHub上,Mac机示例

    如果你有自己的优秀项目,想要分享给大家,那GitHub会是你正确的选择.如何才能将自己的项目上传到GitHub上呢?接下来请一步一步跟着走. 需要准备的资源: 1.一台Mac机 2.安装git客户端( ...

  2. Android Opencv NativeCameraView error in 5.0 lollipop versions (Bug #4185)

    https://github.com/opencv/opencv/wiki http://code.opencv.org/issues/4185 Hello, I finally get a ride ...

  3. FAT和EXFAT文件系统

    文件系统 文件系统是操作系统用于明确磁盘或分区上的文件的方法和数据结构:即在磁盘上组织文件的方法.在移动存储设备上比较常用的有FAT文件系统和ExFAT文件系统. FAT分区依据FAT表中每个簇链的所 ...

  4. 正则表达式 获取字符串内提取图片URL字符串

    #region 获取字符串内提取图片URL字符串 /// <summary> /// 获取字符串内提取图片URL字符串 /// </summary> /// <param ...

  5. 跨平台移动开发_PhoneGap 使用Accelerometer 加速器

    使用Accelerometer 加速器效果图 示例代码 <!DOCTYPE html> <html> <head> <title> Cude Phone ...

  6. OC中NSSet去重细节

    我们都知道,NSSet在存储数据时,不允许存储相同数据?那么,这里的相同该如何理解呢? 很多人都简单的理解为按照其存储对象的内存地址进行评判.其实不然.经过个人实验证明:当类型为NSString,NS ...

  7. Swift中的? ! as as? as!

    ?: 代表这是个可选类型(optional)的.如下,如果num有就为Int类型的,如果没有值那么就是nil. let num:Int? 当我对number进行显示赋值时那么number就是Int类型 ...

  8. Java Comparator方法 和 Comparable接口

    默认的排序方法: 让类继承Comparable接口,重写compareTo方法. 示例代码: package com.imooc.collection; import java.util.HashSe ...

  9. springmvc时间类型值传输映射

    背景:springmvc4.3.2+spring4.3.2+mybatis3.4.1 当前台传递的参数有时间类型时,封装的vo对象也有对应的时间类型与之对象, 但是如果此时用对象去接收后台会报错,类型 ...

  10. EntityFramework 学习 一 Multiple Diagrams in Entity Framework 5.0

    Visual Studio 2012 provides a facility to split the design time visual representation of the Entity ...