結果
問題 | No.1169 Row and Column and Diagonal |
ユーザー |
|
提出日時 | 2023-03-27 08:26:07 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 26 ms / 2,000 ms |
コード長 | 672 bytes |
コンパイル時間 | 1,052 ms |
コンパイル使用メモリ | 90,092 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-19 10:07:00 |
合計ジャッジ時間 | 2,590 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 13 |
ソースコード
#include <iostream> #include <vector> using namespace std; int main(){ int N; cin >> N; vector<vector<int> > data(N, vector<int>(N)); for(int i = 0 ; i < N ; ++i){ int y = i; int x = i; for(int j = 0 ; j < N ; ++j){ data[x][y] = i+1; y--; if(y < 0)y = N - 1; x++; if(x >= N) x = 0; } } for(int i = 0 ; i < N ; ++i){ for(int j = 0 ; j < N ; ++j){ if(j == N - 1){ cout << data[i][j] << endl; }else{ cout << data[i][j] << " " ; } } } }