結果
問題 |
No.3223 K-XOR Increasing Sequence
|
ユーザー |
![]() |
提出日時 | 2025-07-10 21:07:40 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 986 bytes |
コンパイル時間 | 1,992 ms |
コンパイル使用メモリ | 197,548 KB |
実行使用メモリ | 10,220 KB |
最終ジャッジ日時 | 2025-07-10 21:08:03 |
合計ジャッジ時間 | 21,201 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 3 |
other | AC * 6 RE * 63 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; template <class _ForwardIterator> void print(_ForwardIterator first, _ForwardIterator last) { bool f = true; for (auto it = first; it != last; ++it) { if (!f) { cout << " "; } cout << *it; f = false; } cout << endl; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int N, K; cin >> N >> K; ll X, Y; cin >> X >> Y; if (X == 0 && K >= 2 && K % 2 == 1) { vector<ll> A(N); A[1] = 1; for (int i = 2; i < N - 1; i++) { int pos = (i - 2) % K; if (pos >= K - 2) { A[i] = pos - (K - 4); } else { A[i] = 1; } } A[N - 1] = Y; cout << "Yes" << endl; print(A.begin(), A.end()); } else { assert(X < 0); } }