Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Come on , this problem is so lovely , just take it for fun .#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator