結果
問題 | No.398 ハーフパイプ(2) |
ユーザー |
![]() |
提出日時 | 2016-07-16 00:11:39 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 427 ms / 2,000 ms |
コード長 | 1,406 bytes |
コンパイル時間 | 768 ms |
コンパイル使用メモリ | 85,332 KB |
実行使用メモリ | 69,504 KB |
最終ジャッジ日時 | 2024-06-27 14:37:28 |
合計ジャッジ時間 | 8,997 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 |
ソースコード
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <algorithm> #include <utility> #include <functional> #include <cstring> #include <queue> #include <stack> #include <math.h> #include <iterator> #include <vector> #include <string> #include <set> #include <math.h> #include <iostream> #include<map> #include <stdlib.h> #include <list> #include <typeinfo> #include <list> #include <set> #include <iomanip> using namespace std; #define MAX_MOD 1000000007 #define REP(i,n) for(int i = 0;i < n;++i) long long dp[7][500][101][101] = {}; int main() { for (int i = 0;i <= 100;++i) { dp[0][0][0][i] = 1; } for (int i = 0;i <= 100;++i) { for (int q = 0;q <= i;++q) { dp[1][0][q][i] += dp[0][0][0][i]; } for (int q = i + 1;q <= 100;++q) { dp[1][0][i][q] += dp[0][0][0][i]; } } for (int i = 2;i < 6;++i) { for (int q = 0;q <= i * 100 - 200;q++) { for (int j = 0;j <= 100;++j) { for (int k = j;k <= 100;++k) { for (int h = 0;h < j;++h) { dp[i][q + j][h][k] += dp[i - 1][q][j][k]; } for (int h = j;h <= k;++h) { dp[i][q + h][j][k] += dp[i - 1][q][j][k]; } for (int h = k + 1;h <= 100;++h) { dp[i][q + k][j][h] += dp[i - 1][q][j][k]; } } } } } double x; cin >> x; int ok = x*4; long long ans = 0; for (int i = 0;i <= 100;++i) { for (int q = i;q <= 100;++q) { ans += dp[5][ok][i][q]; } } cout << ans << endl; }