結果
問題 | No.287 場合の数 |
ユーザー | xuzijian629 |
提出日時 | 2018-11-04 19:19:02 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 594 bytes |
コンパイル時間 | 1,998 ms |
コンパイル使用メモリ | 206,732 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-04-30 21:52:35 |
合計ジャッジ時間 | 15,181 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 618 ms
6,812 KB |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | AC | 601 ms
6,940 KB |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | AC | 295 ms
6,944 KB |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | AC | 21 ms
6,944 KB |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | AC | 736 ms
6,940 KB |
testcase_20 | AC | 240 ms
6,940 KB |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | AC | 414 ms
6,944 KB |
testcase_24 | WA | - |
ソースコード
#include <bits/stdc++.h> using namespace std; using i64 = int64_t; using vi = vector<i64>; using vvi = vector<vi>; int main() { int n; cin >> n; unordered_map<i64, i64> cnt; for (int i = 0; i <= n; i++) { for (int j = 0; j <= n; j++) { for (int k = 0; k <= n; k++) { for (int l = 0; l <= n; l++) { cnt[6 * n - i - j - k - l]++; } } } } i64 ans = 0; for (auto& p: cnt) { ans += p.second * cnt[(6 * n - p.first)]; } cout << (n % 2 ? ans / 2 : ans) << endl; }