結果

問題 No.287 場合の数
ユーザー masamasa
提出日時 2015-10-09 23:43:46
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 54 ms / 5,000 ms
コード長 496 bytes
コンパイル時間 577 ms
コンパイル使用メモリ 61,524 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-25 12:29:21
合計ジャッジ時間 1,632 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 54 ms
5,376 KB
testcase_04 AC 49 ms
5,376 KB
testcase_05 AC 30 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 7 ms
5,376 KB
testcase_08 AC 12 ms
5,376 KB
testcase_09 AC 30 ms
5,376 KB
testcase_10 AC 53 ms
5,376 KB
testcase_11 AC 4 ms
5,376 KB
testcase_12 AC 42 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 8 ms
5,376 KB
testcase_15 AC 28 ms
5,376 KB
testcase_16 AC 8 ms
5,376 KB
testcase_17 AC 33 ms
5,376 KB
testcase_18 AC 6 ms
5,376 KB
testcase_19 AC 34 ms
5,376 KB
testcase_20 AC 10 ms
5,376 KB
testcase_21 AC 30 ms
5,376 KB
testcase_22 AC 28 ms
5,376 KB
testcase_23 AC 20 ms
5,376 KB
testcase_24 AC 8 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0