結果
| 問題 | No.287 場合の数 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-10-09 23:43:46 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 33 ms / 5,000 ms |
| コード長 | 496 bytes |
| 記録 | |
| コンパイル時間 | 515 ms |
| コンパイル使用メモリ | 78,848 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-08 07:17:24 |
| 合計ジャッジ時間 | 1,818 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}