Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

c++ 16MS,g++ 0Ms

Posted by wyylling at 2009-09-28 16:26:21 on Problem 1316
//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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator