結果
| 問題 |
No.2212 One XOR Matrix
|
| コンテスト | |
| ユーザー |
emthrm
|
| 提出日時 | 2023-02-11 00:23:10 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,576 bytes |
| コンパイル時間 | 2,939 ms |
| コンパイル使用メモリ | 252,468 KB |
| 実行使用メモリ | 8,320 KB |
| 最終ジャッジ日時 | 2024-07-07 17:53:06 |
| 合計ジャッジ時間 | 4,700 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | WA * 8 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
using ll = long long;
constexpr int INF = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr double EPS = 1e-8;
constexpr int MOD = 998244353;
// constexpr int MOD = 1000000007;
constexpr int DY4[]{1, 0, -1, 0}, DX4[]{0, -1, 0, 1};
constexpr int DY8[]{1, 1, 0, -1, -1, -1, 0, 1};
constexpr int DX8[]{0, -1, -1, -1, 0, 1, 1, 1};
template <typename T, typename U>
inline bool chmax(T& a, U b) { return a < b ? (a = b, true) : false; }
template <typename T, typename U>
inline bool chmin(T& a, U b) { return a > b ? (a = b, true) : false; }
struct IOSetup {
IOSetup() {
std::cin.tie(nullptr);
std::ios_base::sync_with_stdio(false);
std::cout << fixed << setprecision(20);
}
} iosetup;
int main() {
int n; cin >> n;
if (n == 1) {
cout << "-1\n";
return 0;
}
vector<vector<int>> a{
{7, 14, 0, 8},
{4, 12, 2, 11},
{15, 9, 6, 1},
{13, 10, 5, 3}
};
FOR(m, 2, n) {
vector b(2 << m, vector(2 << m, 0));
REP(i, 1 << m) copy(ALL(a[i]), b[i].begin());
REP(i, 1 << m) REP(j, 1 << m) b[(1 << m) + i][(1 << m) + j] = a[i][j] + (4 << m);
REP(i, 1 << m) iota(next(b[i].begin(), 1 << m), b[i].end(), (8 << m) + (1 << m) * i);
REP(i, 1 << m) iota(b[(1 << m) + i].begin(), next(b[(1 << m) + i].begin(), 1 << m), (16 << m) + (1 << m) * i);
a.swap(b);
}
REP(i, 1 << n) REP(j, 1 << n) cout << a[i][j] << " \n"[j + 1 == (1 << n)];
return 0;
}
emthrm