結果
問題 |
No.1169 Row and Column and Diagonal
|
ユーザー |
|
提出日時 | 2020-08-16 20:41:00 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 26 ms / 2,000 ms |
コード長 | 359 bytes |
コンパイル時間 | 503 ms |
コンパイル使用メモリ | 67,308 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-11 10:41:33 |
合計ジャッジ時間 | 1,642 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 13 |
ソースコード
#include <iostream> #include <string> #include <algorithm> using namespace std; int get(int i, int j, int n) { int tmp = ((2*i - j) + n)%n; if(tmp == 0) return n; else return tmp; } int main() { int n; cin >> n; for(int i=1; i<=n; i++) { for(int j=1; j<=n; j++) { cout << get(i,j,n) << " "; } cout << endl; } }