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 1805180411 at 2012-10-29 21:22:04 on Problem 2860
#include<iostream>
//#include<algorithm>
using namespace std;

int n,k,m;
int a[31];
int b[31];

int main()
{
	int i;
	cin>>n>>m>>k;
    for(i = 0;i < k;i++)
		cin>>a[i];
	for(i = 0;i < k;i++)
		cin>>b[i];
	//sort(a,a+n);
	//sort(b,b+n);
	int sum = 0;
	for(i = 0;i < k;i++)
	{
		int t = (a[i]-b[i]);
		if(t < 0)
			t = -t;
		sum += t;
	}
	cout<<sum/2<<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