BUPT OJ210 Rist-Number
来源:互联网 发布:淘宝卖家批量发货 编辑:程序博客网 时间:2024/05/18 02:05
题目描述
Rist-Number is a kind of integers that should satisfy some restrictions. Define
1∈S 3×S∈S 7×S∈S 15×S∈S 31×S∈S
Obviously,
输入格式
The input contains multiple test cases.
The first line of input contains an integer
The following
输出格式
For each test case, output True
if the statement is true, otherwise output False
.
输入样例
212
输出样例
TrueFalse
不知为何用除法判断是否只含有3,7,15,31的素因数会WA, 可能是OJ数据有问题吧.
/*USER_ID: test#birdstormPROBLEM: 210SUBMISSION_TIME: 2014-04-01 12:35:16*/#include <stdio.h>#include <stdlib.h>#define For(i,m,n) for(i=(m);i<(n);i++)#define MAXN 100005 int a[MAXN]; main(){ int t, n; scanf("%d",&t); a[1]=1; For(n,1,3000) if(a[n]) a[n*3]=a[n*7]=a[n*15]=a[n*31]=1; while(t--){ scanf("%d",&n); if(a[n]==1) puts("True"); else puts("False"); } return 0;}
0 0
- BUPT OJ210 Rist-Number
- BUPT OJ178 lili‘s number
- BUPT final B题: add number
- 好题 BUPT OJ84 SINGLE NUMBER
- bupt 84 Single Number(水题)
- bupt
- bupt(topsort)
- BUPT 257
- BUPT Strings calculate
- Bupt ACM题解 NO1
- Bupt ACM题解 NO2
- bupt 201 树状数组
- BUPT 201 Glorious Array
- BUPT 202 Chocolate Machine
- BUPT 203 Palindrome
- bupt 204 Palindrome
- BUPT 202 chocolate mashine
- BUPT 199 Beat it!
- iOS应用程序生命周期(前后台切换,应用的各种状态)详解-转载
- 技术管理
- 在VMware Workstation 10.0.1 build-1379776上安装ORACLE 11G双节点 RAC(二)
- C# []、List、Array、ArrayList 区别及应用
- 雕虫小技
- BUPT OJ210 Rist-Number
- 为什么要使用面向接口编程
- Oracle之sqlplus输出到html
- IEEE地址和网络地址
- 翻转字符串的解法
- Ubuntu 网络配置
- android Activity的Task Affinity lanchMode
- Android视频录制命令screenrecord
- 银行排队模拟