BZOJ 1108: [POI2007] nature of the natural gas pipeline Gaz analysis _ _ clever little conclusion

Code:

#include<bits/stdc++.h>
#define setIO(s) freopen(s".in","r",stdin)  
using namespace std;       
int main()
{
	// setIO("input"); 
	int n; 
	long long ans=0; 
	scanf("%d",&n); 
	for(int i=1;i<=n;++i)
	{
		int a,b;
		scanf("%d%d",&a,&b);    //x2 y2
		ans += b - a; 
	}
	for(int i=1;i<=n;++i)
	{
		int a,b; 
		scanf("%d%d",&a,&b);
		ans += a-b; 
	}
	printf("%lld",ans); 
	return 0;
}

  

Guess you like

Origin www.cnblogs.com/guangheli/p/10959879.html