题解 CF 1372A

题目

传送门

题意

构造一个长度为n的数组,对于数组中的元素a,b,c,满足\(a+b\neq c\)

思路

直接让数组中的数全部变成1就可以了(其他数也行)。

代码

/* 
	* Author :Werner_Yin 
	* Time: 2020-07-11 23:13:36
	* I believe I can AC !
*/ 
#include <bits/stdc++.h>
#define lol long long
#define GDB(x) cout<<"DATA "<<#x<<" :"<<x<<endl; 
#define mes(x) memset(x,0,sizeof(x))
using namespace std;
template <typename T>
void re(T &x){
	#define ge getchar() 
	x = 0;int sgn = 1;char ch = ge;
	for(;!isdigit(ch);ch = ge) if(ch == '-') sgn = -1;
	for(;isdigit(ch);ch = ge) x = (x<<1)+(x<<3)+(ch^48);
	x *= sgn;
}
template <typename T>
void write(T x){
	if(x == 0) putchar(48);
	else if(x < 0) putchar('-');
	int k = 0,que[20];
	while(x > 0){
		que[++k]=x % 10;
		x /= 10;
	}
	for(int i = k;i > 0;i--) putchar(que[i] + 48);
	return;
}
int main (){
	int T;
	re(T);
	while(T--){
		int n;
		re(n);
		for(int i = 0;i < n;i++) cout<<1<<" ";
		cout<<endl; 
	}
	return 0;
}
posted @ 2020-07-12 06:51  Werner_Yin  阅读(95)  评论(0编辑  收藏  举报