标签:+= ems body 问题 content names 输入 内存 tchar
【样例1】
8
1 10
3 6
6 8
6 2
3 -4
1 0
-2 -2
-2 4
【样例2】
8
1 100
3 6
6 8
6 2
3 -4
1 0
-2 -2
-2 4
【样例1】
2 3
【样例2】
There is not a place like that.
#pragma GCC optimize(2) #include<cstdio> #include<iostream> #include<algorithm> #include<map> #include<string> #include <math.h> #include<memory.h> #include<cstring> using namespace std; typedef long long ll; inline int read() { int x=0,f=1;char ch=getchar(); while(ch<‘0‘||ch>‘9‘){if(ch==‘-‘)f=-1;ch=getchar();} while(ch>=‘0‘&&ch<=‘9‘){x=x*10+ch-‘0‘;ch=getchar();} return x*f; } const int maxn=1e5+100; int main(){ ll n,x,y; cin>>n; double sumx=0,sumy=0; for(int i=1;i<=n;i++){ x=read(),y=read(); sumx+=x; sumy+=y; } double xx=(1.0)*(sumx/n); double yy=(1.0)*(sumy/n); if(int(xx)==xx&&int(yy)==yy){ cout<<xx<<" "<<yy<<endl; } else{ printf("There is not a place like that.\n"); } }
标签:+= ems body 问题 content names 输入 内存 tchar
原文地址:https://www.cnblogs.com/lipu123/p/13515068.html