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

Re:我的0ms

Posted by 785815369 at 2010-06-02 14:12:48 on Problem 1218
In Reply To:OMS的是怎么过的呀? Posted by:druse at 2008-05-24 21:03:52
#include<iostream>
using namespace std;
int f[102];
int num_escape(int n)
{
	memset(f,0,sizeof(f));
	int i=1;
	while(i<=n)
	{
		for(int j=1;j<=n;j++)
		{
			if(!(j%i))
			{
				f[j]++;
			}
		}
		i++;
	}
	int sum=0;
	for(int j=1;j<=n;j++)
	{
		if(f[j]&1)sum++;
	}
	return sum;
}
int main()
{
	int text,n;
	scanf("%d",&text);
	while(text--)
	{
		scanf("%d",&n);
		cout<<num_escape(n)<<endl;
	}
}

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