結果
問題 |
No.3223 K-XOR Increasing Sequence
|
ユーザー |
|
提出日時 | 2025-08-01 22:54:16 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 547 bytes |
コンパイル時間 | 1,981 ms |
コンパイル使用メモリ | 196,152 KB |
実行使用メモリ | 7,720 KB |
最終ジャッジ日時 | 2025-08-01 22:54:35 |
合計ジャッジ時間 | 18,534 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 39 WA * 31 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int N, K, X, Y; cin >> N >> K >> X >> Y; if (Y == 0) { puts("No"); return 0; } if (K == 1) { int lst = X + (N - 1); if (Y < lst) { puts("No"); } else { puts("Yes"); for (int i = 0; i < N-1; i ++) { cout << X + i << " "; } cout << Y << endl; } return 0; } puts("Yes"); std::vector<int> ans(N, 1); ans[0] = ans[1] = X; ans.back() = Y; for (int i = K; i < N-1; i ++) { ans[i] = ans[i-K]; } for (int& a : ans) cout << a << " "; cout << endl; }