結果
問題 |
No.1169 Row and Column and Diagonal
|
ユーザー |
👑 |
提出日時 | 2022-04-14 14:46:43 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 22 ms / 2,000 ms |
コード長 | 363 bytes |
コンパイル時間 | 628 ms |
コンパイル使用メモリ | 71,652 KB |
最終ジャッジ日時 | 2025-01-28 17:38:30 |
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 13 |
ソースコード
#include <iostream> #include <vector> using namespace std; int main(){ int n;cin>>n; vector<int> A(n); int nw = 0; for(int i = 0; n > i; i+=2){ A[i] = nw; nw++; } for(int i = 1; n > i; i += 2){ A[i] = nw; nw++; } for(int i = 0; n > i; i++){ for(int j = 0; n > j; j++){ cout << A[(i+j)%n]+1 << " \n"[j+1 == n]; } } }