結果
問題 | No.287 場合の数 |
ユーザー |
|
提出日時 | 2015-10-09 23:43:46 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 57 ms / 5,000 ms |
コード長 | 496 bytes |
コンパイル時間 | 595 ms |
コンパイル使用メモリ | 61,428 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-07 23:56:45 |
合計ジャッジ時間 | 2,144 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
#include <iostream>#include <cstdio>#include <vector>#include <algorithm>#include <utility>#include <string>using namespace std;int main() {int n;cin >> n;vector<long long> sum(8*n + 1, 0);for (int a = 0; a <= n; a++) {for (int b = 0; b <= n; b++) {for (int c = 0; c <= n; c++) {for (int d = 0; d <= n; d++) {sum[a + b + c + d]++;}}}}long long ans = 0;for (int i = 0; i <= 4 * n; i++) {ans += sum[i] * sum[6 * n - i];}cout << ans << endl;return 0;}