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

1922

Posted by wanghao2979 at 2007-07-26 15:17:32
我的1922总是超时,谁帮我看看`
#include <iostream>
#include <ctime>
#define N 18
using namespace std;
int main()
{
for(;;)
{
	double _array[N][2],t_temp[N],temp = 1000;
	int n,k,flag;
	do
	cin >> n;
	while(n == 0);
	register int i;
	for(i = 0;i < n;i++)
	{
	for(k = 0;k != 2;k++)
	{
		cin >> _array[i][k];
		if(_array[i][1] < 0 && _array[i][1] > -60000)
		{
			n -= 1;
			k = -1;
			_array[i][1] = 0;
		}
		
	}
	_array[i][0] /= 3600;
		t_temp[i] = 4.5 / _array[i][0] + _array[i][1];
		 if(t_temp[i] < temp)
	   {
           flag = i;
		   temp = t_temp[i];
	   }

	}//输入  VI TI



	

/*~~~~~~~~~~~~~对double TI 处理~~~~~~~~*/
	 if((t_temp[flag] - (int)t_temp[flag]) != 0)
		 t_temp[flag] = (int)t_temp[flag] + 1;
	
	

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
	cout << t_temp[flag] << endl;
}
	system("pause");
	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