| ||||||||||
| 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 | |||||||||
c++ 16MS,g++ 0Ms//1316
#include <cstdio>
#include <iostream>
#include<string>
#include<cmath>
#include<vector>
#include<algorithm>
#include<deque>
#include<bitset>
using namespace std;
int gen()
{
static int i = 1;
return i++;
}
int main(int argc, char* argv[])
{
bitset<10036> b;
int max = 9999;
int num,tmp,t;
for(int i = 1; i <= 9999; ++i)
{
num = t= i;
while(t > 0)
{
tmp = t%10;
num += tmp;
t /= 10;
}
b.set(num);
}
for(int i = 1; i < 10000; ++i)
{
if(!b.test(i))
printf("%d\n",i);
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator