結果
問題 | No.1169 Row and Column and Diagonal |
ユーザー | keep_OC |
提出日時 | 2020-08-14 21:43:03 |
言語 | C++14 (gcc 13.2.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 32 ms / 2,000 ms |
コード長 | 1,135 bytes |
コンパイル時間 | 1,661 ms |
コンパイル使用メモリ | 172,032 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-04-18 21:20:31 |
合計ジャッジ時間 | 2,789 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,812 KB |
testcase_01 | AC | 2 ms
6,940 KB |
testcase_02 | AC | 1 ms
6,944 KB |
testcase_03 | AC | 2 ms
6,940 KB |
testcase_04 | AC | 2 ms
6,944 KB |
testcase_05 | AC | 2 ms
6,940 KB |
testcase_06 | AC | 4 ms
6,940 KB |
testcase_07 | AC | 7 ms
6,940 KB |
testcase_08 | AC | 12 ms
6,940 KB |
testcase_09 | AC | 14 ms
6,944 KB |
testcase_10 | AC | 28 ms
6,940 KB |
testcase_11 | AC | 31 ms
6,940 KB |
testcase_12 | AC | 32 ms
6,940 KB |
testcase_13 | AC | 32 ms
6,940 KB |
testcase_14 | AC | 32 ms
6,940 KB |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef int64_t Int; #define all(x) (x).begin(), (x).end() const double EPS = 1e-10; const Int INF = 1e18; const int inf = 1e9; const Int mod = 1e9+7; bool print_space_enable = false; void print() { cout << '\n'; print_space_enable = false; } template <class Head, class... Tail> void print(Head&& head, Tail&&... tail) { if (print_space_enable) cout << " "; cout << fixed << setprecision(15) << head; print_space_enable = true; print(std::forward<Tail>(tail)...); } template<typename T> void print(vector<T> v) { for (size_t i = 0; i < v.size(); i++) { if (i > 0) std::cout << " "; std::cout << v[i]; } std::cout << std::endl; } int main() { Int n; cin >> n; vector<Int> a(n); map<Int, Int> mp; for (Int i = 0; i < n; i++) { a[i] = n - 1 - i; mp[n - 1 - i] = i; } for (Int i = 0; i < n; i++) { for (Int j = 0; j < n; j++) { Int index = (mp[i] - i + n) % n; cout << a[(index + j) % n] + 1 << " " ; } cout << endl; } return 0; }