結果
| 問題 |
No.1169 Row and Column and Diagonal
|
| コンテスト | |
| ユーザー |
startcpp
|
| 提出日時 | 2020-08-14 21:29:29 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 27 ms / 2,000 ms |
| コード長 | 373 bytes |
| コンパイル時間 | 557 ms |
| コンパイル使用メモリ | 63,616 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-10 14:09:34 |
| 合計ジャッジ時間 | 1,678 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 13 |
ソースコード
#include <iostream>
#define rep(i, n) for(i = 0; i < n; i++)
using namespace std;
int n;
int a[500][500];
int to[500];
int main() {
int i, j;
cin >> n;
rep(i, n) {
rep(j, n) {
a[i][j] = (i + j) % n;
}
}
rep(i, n) to[a[i][i]] = i + 1;
rep(i, n) {
rep(j, n) {
cout << to[a[i][j]];
if (j + 1 < n) cout << " ";
}
cout << endl;
}
return 0;
}
startcpp