• <input id="auww4"></input>
  • <input id="auww4"><acronym id="auww4"></acronym></input>
  • <input id="auww4"><u id="auww4"></u></input>
    <object id="auww4"><acronym id="auww4"></acronym></object>
    <menu id="auww4"></menu><input id="auww4"><u id="auww4"></u></input>
    <input id="auww4"><u id="auww4"></u></input>
  • F.A.Q
    Hand In Hand
    Online Acmers
    Forum | Discuss
    Statistical Charts
    Problem Archive
    Realtime Judge Status
    Authors Ranklist
     
         C/C++/Java Exams     
    ACM Steps
    Go to Job
    Contest LiveCast
    ICPC@China
    Best Coder beta
    VIP | STD Contests
    Virtual Contests
        DIY | Web-DIY beta
    Recent Contests
    Author ID 
    Password 
     Register new ID

    Re:AC附上一組新的測試數組

    Posted by llwu at 2014-04-18 16:04:33 on Problem 1003
    (616)  


    求神人指點哪  我的測試數據是一模一樣的哈  為什么就是WA哈~~
    #include <iostream>
    using namespace std;
    int main()
    {
    	int T, N ,inter;
    	cin >> T;
    	for (int i = 0; i < T; i++)
    	{
    		int sum;
    		int max = -10000000000;
    		int Arry[10000];
    		int start ;
    		int end ;
    		int MaxInter = 0;
    		cin >> N;
    		for (int j = 0; j < N; j++)
    		{
    			cin >> Arry[j];
    		}
    		
    		for (int k = 0; k < N; k++)
    		{
    			sum = 0;
    			for (int  m = k; m < N; m++)
    			{
    				sum = sum + Arry[m];
    				if (max<sum)
    				{
    					max = sum;
    					start = k+1;
    					end = m+1;
    				}
    			}
    		}
    		cout << "Case " << i+1 << ":" << endl;
    		cout << max << " " << start << " " << end << endl;
    		if (i<T-1)
    		{
    			cout << endl;
    		}
    	}
    	system("pause");
    	return 0;
    }

    Followed by:


    Post your reply here:

    Author ID
    Password
    Title
    Content  
     
    Hangzhou Dianzi University Online Judge 3.0
    Copyright © 2005-2020 HDU ACM Team. All Rights Reserved.
    Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
    Total 0.000000(s) query 4, Server time : 2020-11-09 02:30:47, Gzip enabled
    棋牌