| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
怎么用__int64就能过呢?#include<iostream>
using namespace std;
int n;
__int64 q[9999999];
void BFS()
{
int front,rear;
front=rear=0;
q[rear]=1;
rear++;
__int64 top;
while(rear>front)
{
top = q[front];
if(top%n==0){
break;
}
top *= 10;
q[rear++]=top;
q[rear++]=top+1;
front++;
}
printf("%I64d\n",top);
}
int main()
{
while(scanf("%d",&n)&&n){
BFS();
}
return 0;
}
不是说100个数字吗?__int64 岂不是不够用?
5406217 halfsix 1426 Accepted 8352K 125MS C++ 491B 2009-07-16 15:05:22
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator