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

这题简直就是..............

Posted by 451144426 at 2009-10-25 20:20:55 on Problem 3210
当初不理解题意,搞不懂,后来看到nr们解释,恍然大悟
就是问确定一个数n,无论哪种情况翻n次都满足正面或反面全部向上,但不能小于2次
所以如果是偶数个硬币的话就要无解xxxo
如果是偶数就是n-1
知道题意后我很无语


#include <iostream>

using namespace std;

int main()
{

	int n;

	while(cin>>n&&n)
	{
		
		if(n%2==0) { cout<<"No Solution!"<<endl; continue;}
		else
			cout<<n-1<<endl;
	}

	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