Codeforces Round #655 (Div. 2) A. Omkar and Completion

题目链接:https://codeforces.com/contest/1372/problem/A

题意

构造一个大小为 $n$ 的数组 $a$,要求满足 $1 \le a_i \le n$,且不存在 $a_x + a_y \neq a_z$ 。

题解

最好想的就是全部构造成相等的元素。

代码

#include <bits/stdc++.h>
using namespace std;

void solve() {
    int n; cin >> n;
    for (int i = 0; i < n; i++)
        cout << 1 << " \n"[i == n - 1];
}

int main() {
    int t; cin >> t;
    while (t--) solve();
}

 

posted @ 2020-07-12 20:49  Kanoon  阅读(192)  评论(0)    收藏  举报