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

刚才跑zoj交了个小题目,一看运行内存,吓死了 800多K,程序只定义了两个变量,怎么回事[程序见内]

Posted by queyue2004 at 2005-10-04 16:06:27
#include <iostream>
#include <fstream>

using namespace std;

int main (void)
{
#ifndef ONLINE_JUDGE
	freopen ("Lowest Bit.txt","r",stdin);
#endif
	int input;
	int output;

	while (cin >> input && input != 0)
	{
		output = 1;
		while ((input & 1) == 0)
		{
			input >>= 1;
			output <<= 1;
		}
		cout << output << 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