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 eagledoit at 2014-06-13 20:33:40 on Problem 3045
#include <iostream>
#include <cstdio>

using namespace std;
typedef long long ll;

struct MM
{
    ll x;
    ll y;
}s[50050];

int main()
{
    int _;
    ll sum=0;
    cin>>_;
    for(int i=0;i<_;i++)
    {
        scanf("%lld %lld",&s[i].x,&s[i].y);
        sum+=s[i].x;
    }
    ll ans=sum;
    for(int i=0;i<_;i++)
    {
        ans=min(ans,sum-s[i].x-s[i].y);
    }
    cout<<ans<<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