From 07a2ad947021eca175ec94ee6d8c2c0d809ceadf Mon Sep 17 00:00:00 2001 From: Kirito <1362050620@qq.com> Date: Sat, 7 May 2016 21:01:13 +0800 Subject: [PATCH] Create 1595_Richr_Wong.cpp From http://blog.csdn.net/richr_wong/article/details/50193321 --- UVA/1595_Richr_Wong.cpp | 51 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 UVA/1595_Richr_Wong.cpp diff --git a/UVA/1595_Richr_Wong.cpp b/UVA/1595_Richr_Wong.cpp new file mode 100644 index 0000000..0e4e748 --- /dev/null +++ b/UVA/1595_Richr_Wong.cpp @@ -0,0 +1,51 @@ +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + + +typedef pair point; + +int main() +{ + int T; + cin>>T; + for(int i=0;i data; + cin>>n; + int sum = 0; + for(int j=0;j>x>>y; + sum+=x; + data.insert(point(x*n,y)); + } + bool flag = true; + for(set::iterator i=data.begin();i!=data.end();i++) + { + point p = *i; + if(data.find(point(2*sum-p.first,p.second))==data.end()) + { + flag = false; + break; + } + } + if(flag==true) + { + cout<<"YES"<