結果
| 問題 |
No.1169 Row and Column and Diagonal
|
| コンテスト | |
| ユーザー |
沙耶花
|
| 提出日時 | 2020-08-14 21:25:11 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 24 ms / 2,000 ms |
| コード長 | 488 bytes |
| コンパイル時間 | 2,176 ms |
| コンパイル使用メモリ | 196,464 KB |
| 最終ジャッジ日時 | 2025-01-12 23:10:46 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 13 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 10000000
int main(){
int N;
cin>>N;
vector<vector<int>> ans(N,vector<int>(N,0));
if(N%2==1){
for(int i=0;i<N;i++){
for(int j=0;j<N;j++){
int pos = (i + j)%N;
ans[i][pos] = (i+N-j)%N;
}
}
}
for(int i=0;i<N;i++){
for(int j=0;j<N;j++){
if(j!=0)cout<<' ';
cout<<ans[i][j]+1;
}
cout<<endl;
}
return 0;
}
沙耶花