Problem 52

It can be seen that the number, 125874, and its double, 251748, contain exactly the same digits, but in a different order.
数字125874和125874*2(251748)一样,拥有相同的、不同序的数字。
Find the smallest positive integer, x, such that 2x, 3x, 4x, 5x, and 6x, contain the same digits.
找到最小的正整数x,使得2x, 3x, 4x, 5x, 6x拥有相同的数字。
multi = 6
for x in range(1, 999999):
nums = []
flag = True
for y in range(1, multi+1):
num = x * y
nums.append(num)
digits = sorted(str(nums[0]))
for num in nums:
if sorted(str(num)) != digits:
flag = False
if not flag:
continue
else:
print(nums, '/n', digits)
break

Problem 52的更多相关文章

  1. UOJ 52 元旦激光炮

    http://uoj.ac/problem/52 题意:每次可以得到3个序列中 思路:每次分别取出三个序列的K/3长度的位置,取最小的那个,然后每次减掉它,总复杂度是Nlog3N #include & ...

  2. #52. 【UR #4】元旦激光炮 (交互式题)

    链接:http://uoj.ac/problem/52 刚刚越过绝境长城,只见天空中出现了炫目的光芒 —— 圣诞老人出现了. 元旦三侠立刻进入战斗.生蛋侠.圆蛋侠和零蛋侠分别有 na,nb,ncna, ...

  3. CodeForces 52C Circular RMQ(间隔周期段树,间隔更新,间隔总和)

    转载请注明出处:http://blog.csdn.net/u012860063 题目链接:http://codeforces.com/problemset/problem/52/C You are g ...

  4. qsc52(三角形线性插值)

    题目链接:http://qscoj.cn/problem/52/ 题意:中文题诶- 思路:水题,只要知道三角形插值和判断点在三角形内就OK了 关于三角形插值:http://www.cnblogs.co ...

  5. 【UVa 116】Unidirectional TSP

    [Link]:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_probl ...

  6. Levmar:Levenberg-Marquardt非线性最小二乘算法

    Levmar:Levenberg-Marquardt非线性最小二乘算法 eryar@163.com Abstract. Levmar is GPL native ANSI C implementati ...

  7. 【例题5-2 UVA - 101】The Blocks Problem

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 用vector模拟就好. resize的时候,只是把多余的清理掉. 原先的不会变的. [错的次数] 在这里输入错的次数 [反思] 在 ...

  8. PHP curl报错“Problem (2) in the Chunked-Encoded data”解决方案

    $s = curl_init(); curl_setopt($s, CURLOPT_POST, true); curl_setopt($s, CURLOPT_POSTFIELDS, $queryStr ...

  9. Total Commander 8.52 Beta 1

    Total Commander 8.52 Beta 1http://www.ghisler.com/852_b1.php 10.08.15 Release Total Commander 8.52 b ...

随机推荐

  1. 数据结构(C实现)------- 顺序栈

    栈是限定仅在表的一端进行插入或删除的纯属表,通常称同意插入.删除的一端为栈顶(Top),对应在的.则称还有一端为栈底(Bottom). 不含元素的栈则称为空栈. 所设栈S={a1,a2,a3,..., ...

  2. javascript 数组,数组中加入新元素 push() ,unshift() 相当于Add()

    <1> var   a   =   [];     //建立数组 push   方法     将新元素加入到一个数组中,并返回数组的新长度值.

  3. 【POJ 2983】Is the Information Reliable?(差分约束系统)

    id=2983">[POJ 2983]Is the Information Reliable? (差分约束系统) Is the Information Reliable? Time L ...

  4. golang文件读写三种方式——bufio,ioutil和os.create

    package main import ( "bufio" "fmt" "io/ioutil" "os" ) func ...

  5. nyoj--990--蚂蚁感冒(模拟)(思维题)

    蚂蚁感冒 时间限制:1000 ms  |  内存限制:65535 KB 难度:2 描述 长100厘米的细长直杆子上有n只蚂蚁.它们的头有的朝左,有的朝右. 每只蚂蚁都只能沿着杆子向前爬,速度是1厘米/ ...

  6. 把一个文件夹下的多个csv文件合并到一个excel的多个sheet

    #!/usr/bin/env python3 # -*- coding: UTF-8 -*- import pandas as pd import os import re if __name__ = ...

  7. insufficient space

  8. Coursera Algorithms week2 栈和队列 练习测验: Queue with two stacks

    题目原文: Implement a queue with two stacks so that each queue operations takes a constant amortized num ...

  9. 微信图片不可显示java解决方法

    先看知乎:https://www.zhihu.com/question/35044484 场景: 微信上传了图片素材,返回了图片url,然后不能在img标签中正常显示. 原因是微信做了图片防盗连接. ...

  10. Redis 字符串结构和常用命令

    字符串是 Redis 最基本的数据结构,它将以一个键 和一个值 储存在 Redis 内部. 字符串的一些基本命令 命令 说明 备注 set key value 设置键值对 最常用的写入命令 get k ...