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

_int64 加多个下划线变 __int64就过了....

Posted by csjxl at 2008-09-29 01:25:09 on Problem 3253
#include<iostream>
#include<map>
#include<set>
#include<list>
#include<vector>
#include<string>

using namespace std;

multiset<__int64> ms;
multiset<__int64>::iterator p1,p2;

int main()
{
		
	//cout<<sizeof(_int64)<<endl;
	int i,N,k;
	__int64 count,cou;
	cin>>N;
	for(i=0;i<N;i++)
	{
		cin>>k;
		ms.insert(k);
	}

	count=0;
	while(ms.size() > 1)
	{
		p1 = p2 = ms.begin();
		p2++;

		cou = *p1 + *p2;
		ms.erase(p1);
		ms.erase(p2);
		ms.insert(cou);
		count+=cou;
	}

	printf("%I64d\n",count);

return 1;}

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