Codeforces Global Round 1-E. Magic Stones

Codeforces Global Round 1-E. Magic Stones_第1张图片

地址:https://codeforces.com/contest/1110/problem/E

思路:这题太强了,想不到想不到orz  大佬博客https://blog.csdn.net/PinappleMi/article/details/86775268

Code:

#include
#include
using namespace std;
typedef long long LL;

const int MAX_N=1e5+5;
int n,m;
int a[MAX_N],b[MAX_N];

int main()
{
	ios::sync_with_stdio(false);
	cin>>n;
	int r0,r1,x;
	for(int i=0;i>x;
		a[i]=x-a[n];
		a[n]=x;
	}
	for(int i=0;i>x;
		b[i]=x-b[n];
		b[n]=x;
	}
	sort(a+1,a+n);
	sort(b+1,b+n);
	string res="Yes";
	for(int i=0;i<=n;++i)
		if(a[i]!=b[i]){
			res="No";	break;
		}
	cout<

 

你可能感兴趣的:(Codeforces,思维)