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

Come on , this problem is so lovely , just take it for fun .

Posted by 123454321 at 2006-07-20 09:08:22 on Problem 2860
#include<stdio.h>
#define MAX 20+1
int main()
{
	register int i;
	int N,M,K,count,a[MAX];
	scanf("%d%d%d",&N,&M,&K);
	for(i=0;i<2*K;i++)
		scanf("%d",&a[i]);
	count=0;
	for(i=0;i<K;i++)
		if(a[i]<a[i+K])
			count+=(a[i+K]-a[i]);
	printf("%d\n",count);
    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