ACM: 模拟队列判定 poj 1426
来源:互联网 发布:top k算法 java 编辑:程序博客网 时间:2024/05/12 13:11
Description
Given a positive integer n, write a program to find out anonzero multiple m of n whose decimal representation contains onlythe digits 0 and 1. You may assume that n is not greater than 200and there is a corresponding m containing no more than 100 decimaldigits.
Input
The input file may contain multiple test cases. Each linecontains 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 thecorresponding value of m. The decimal representation of m must notcontain more than 100 digits. If there are multiple solutions for agiven value of n, any one of them is acceptable.
Sample Input
2
6
19
0
Sample Output
题意: 找出十进制n 的 m倍的数,但是这个数必须有0 和 1组成.
解题思路:
代码:
#include <cstdio>
#include <iostream>
using namespace std;
#define MAX 2000005
int n;
long long a[MAX];
int main()
{
//
}
- ACM: 模拟队列判定 poj 1426
- ACM: 模拟题 poj 2996
- ACM: 直接模拟题 poj 3087
- ACM: 模拟题 poj 2993
- ACM: 模拟题 poj 2632 (开始做模拟…
- POj 2379 ACM Rank Table
- ACM: poj 1664
- ACM: poj 1050
- ACM: poj 1964
- ACM: poj 3141
- ACM: poj 1903
- ACM: 深搜 poj 2676
- ACM: 深搜题 poj 3411
- ACM: polya模拟 数论题 poj 1026
- poj 2190 isbn 模拟
- ACM: 网络流 图论 poj 1459
- ACM: 二分法 数论题 poj 1905
- ACM: 水题 分数运算 poj 3979
- ACM: 高速打素数表 TOJ 3749 (疯狂…
- ACM: 数论 台州OJ 3151 (久违的数…
- ACM: poj 1664
- linux入门
- ACM: 广搜+素数 poj 3126 (素数表…
- ACM: 模拟队列判定 poj 1426
- JavaScript跨域(1):什么是跨域,如何跨域
- ACM: 三维迷宫广搜最短路 poj 2251…
- ACM: dfs题 poj 1321 (n皇后问题)
- ACM: 模拟题 poj 2996
- ACM: hash开散列 poj 3007 (Nothin…
- ACM:着色问题 poj 1129
- Android ListFragment 中给LinearLayout添加点击事件
- ACM: 深搜 poj 2676