結果
問題 | No.862 XORでX |
ユーザー |
|
提出日時 | 2019-08-24 00:13:01 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 868 bytes |
コンパイル時間 | 1,424 ms |
コンパイル使用メモリ | 171,336 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-13 14:52:34 |
合計ジャッジ時間 | 5,703 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 2 |
other | AC * 4 WA * 24 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;int main() {cin.tie(0);ios::sync_with_stdio(false);int n, x;cin >> n >> x;int m = (n-1) / 4 * 4;vector<int> ans;for (int i = 0; i < m; i++) {ans.push_back(1000000 + i);}int foo = (1 << 22);vector<int> hoge;if (n % 4 == 0) {if (x == 1) hoge = {1,2,4,6};else hoge = {foo + 1, foo + 2, foo + 3, foo + x};} else if (n % 4 == 1) {hoge = {x};} else if (n % 4 == 2) {if (x == 1) hoge = {2, 3};else hoge = {1, (x^1)};} else {if (x == 1) hoge = {2, 4, 7};else hoge = {foo + 2, foo + 3, (x^1)};}for (int x : hoge) ans.push_back(x);assert(ans.size() == n);for (int i = 0; i < n; i++) {cout << ans[i] << "\n";}return 0;}