构造 EricWan · 2024-10-03 23:16:41 · 题解 使用瞪眼法发现序列可以长成这样子: [x,1,x,1,x,1,x,1,\dots] 或者: [1,x,1,x,1,x,1,x,\dots] 判断 n 的奇偶性选择一种方案输出即可。 code cin >> n >> a; if ((n & 1) == 0) cout << "1 " << a << endl; else cout << a << " 1" << endl;