結果
問題 | No.1169 Row and Column and Diagonal |
ユーザー | drken1215 |
提出日時 | 2020-08-14 21:28:42 |
言語 | C++14 (gcc 13.2.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 25 ms / 2,000 ms |
コード長 | 1,267 bytes |
コンパイル時間 | 1,558 ms |
コンパイル使用メモリ | 161,644 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-04-18 20:40:40 |
合計ジャッジ時間 | 2,716 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 2 ms
5,376 KB |
testcase_02 | AC | 2 ms
5,376 KB |
testcase_03 | AC | 2 ms
5,376 KB |
testcase_04 | AC | 2 ms
5,376 KB |
testcase_05 | AC | 2 ms
5,376 KB |
testcase_06 | AC | 3 ms
5,376 KB |
testcase_07 | AC | 6 ms
5,376 KB |
testcase_08 | AC | 8 ms
5,376 KB |
testcase_09 | AC | 11 ms
5,376 KB |
testcase_10 | AC | 21 ms
5,376 KB |
testcase_11 | AC | 21 ms
5,376 KB |
testcase_12 | AC | 23 ms
5,376 KB |
testcase_13 | AC | 25 ms
5,376 KB |
testcase_14 | AC | 23 ms
5,376 KB |
ソースコード
#include <bits/stdc++.h> using namespace std; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } #define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P) { return s << '<' << P.first << ", " << P.second << '>'; } template<class T> ostream& operator << (ostream &s, vector<T> P) { for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; } template<class T> ostream& operator << (ostream &s, vector<vector<T> > P) { for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; } template<class T> ostream& operator << (ostream &s, set<T> P) { for(auto it : P) { s << "<" << it << "> "; } return s << endl; } template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P) { for(auto it : P) { s << "<" << it.first << "->" << it.second << "> "; } return s << endl; } int main() { int N; cin >> N; int start = 0; for (int i = 0; i < N; ++i) { for (int j = 0; j < N; ++j) { cout << (start - j + N) % N + 1 << " "; } cout << endl; start += 2; } }