結果
| 問題 | No.1587 012 Matrix |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-10-07 22:31:18 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.92.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 1,839 bytes |
| 記録 | |
| コンパイル時間 | 5,414 ms |
| コンパイル使用メモリ | 341,068 KB |
| 実行使用メモリ | 9,928 KB |
| 最終ジャッジ日時 | 2026-10-07 22:31:36 |
| 合計ジャッジ時間 | 9,235 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 22 |
ソースコード
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
// --------------------------- TEMPLATE/METAP ---------------------------
struct custom_hash {
static uint64_t splitmix64(uint64_t x) {
x += 0x9e3779b97f4a7c15;
x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
return x ^ (x >> 31);
}
size_t operator()(uint64_t x) const {
static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
return splitmix64(x + FIXED_RANDOM);
}
};
// --------------------------- MACROS & CONSTANTS ---------------------------
#define ll long long
#define endl '\n'
const ll MOD = 1e9+7;
// --------------------------- FUNCTIONS ---------------------------
bool isPrime(ll n) {
if (n <= 1) return false;
for (ll i = 2; i * i <= n; ++i)
if (n % i == 0) return false;
return true;
}
// --------------------------- OBSERVATIONS ---------------------------
/* OB1:
*/
/* OB2:
*/
/* Final:
*/
// --------------------------- MAIN ---------------------------
int main(){
ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
ll n; cin >> n;
if (n % 2) {cout << "NO" << endl; return 0;}
vector<vector<ll>> mat(n, vector<ll> (n, 0));
for (int i = 0; i < n; ++i) {
if (i < n / 2) {
for (int j = 0; j < i; ++j) {
mat[i][j] = 2;
}
mat[i][i] = 1;
}
else {
for (int j = 0; j <= i; ++j) {
mat[i][j] = 2;
}
}
}
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
cout << mat[i][j] << " ";
}
cout << endl;
}
return 0;
}