結果
| 問題 | No.1169 Row and Column and Diagonal |
| コンテスト | |
| ユーザー |
onsen_manjuuu
|
| 提出日時 | 2020-08-18 08:16:34 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 12 ms / 2,000 ms |
| + 889µs | |
| コード長 | 480 bytes |
| 記録 | |
| コンパイル時間 | 925 ms |
| コンパイル使用メモリ | 183,792 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-09-14 06:32:30 |
| 合計ジャッジ時間 | 2,490 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 13 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
int n;
cin >> n;
vector<vector<int>> a(n, vector<int>(n));
vector<int> id(n);
for(int i = 0; i < n; i++)id[(i + i) % n] = i;
for(int i = 0; i < n; i++) {
for(int j = 0; j < n; j++) {
int rem = (i + j) % n;
a[i][j] = id[rem];
}
}
for(int i = 0; i < n; i++){for(int j = 0; j < n; j++)cout << a[i][j] +1 << " ";cout << endl;}
}
onsen_manjuuu