結果

問題 No.398 ハーフパイプ(2)
ユーザー chakkuchakku
提出日時 2016-09-29 09:59:02
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 432 ms / 2,000 ms
コード長 1,526 bytes
コンパイル時間 2,491 ms
コンパイル使用メモリ 144,240 KB
実行使用メモリ 104,924 KB
最終ジャッジ日時 2023-09-09 23:09:49
合計ジャッジ時間 10,411 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 431 ms
104,708 KB
testcase_01 AC 427 ms
104,820 KB
testcase_02 AC 429 ms
104,924 KB
testcase_03 AC 425 ms
104,728 KB
testcase_04 AC 424 ms
104,708 KB
testcase_05 AC 426 ms
104,640 KB
testcase_06 AC 426 ms
104,660 KB
testcase_07 AC 432 ms
104,872 KB
testcase_08 AC 430 ms
104,720 KB
testcase_09 AC 427 ms
104,708 KB
testcase_10 AC 428 ms
104,636 KB
testcase_11 AC 422 ms
104,784 KB
testcase_12 AC 428 ms
104,868 KB
testcase_13 AC 429 ms
104,784 KB
testcase_14 AC 432 ms
104,784 KB
testcase_15 AC 427 ms
104,636 KB
testcase_16 AC 429 ms
104,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
 
#define REP(i,n) for(int i=0;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<29
#define LINF LLONG_MAX/3
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define ALL(v) (v).begin(),(v).end()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }
const long long mod = 1e9+7;
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;

ll dp[10][1000][110][110];

int main(){
    double s;cin>>s;
    int t=s*4+0.1;

    // dp[i][sum][min][max] := i番目までで合計がsum,最小値がmin,最大値がmaxとなるような場合の数
    dp[0][0][0][0] = 1;

    rep(i,101) dp[1][i][i][i]=1;

    for(int i=1;i<6;i++){
        for(int mi=0;mi<=100;mi++){
            for(int mx=mi;mx<=100;mx++){
                for(int su=0;su<=700;su++){
                    if(dp[i][su][mi][mx]==0) continue;
                    for(int score=0;score<=100;score++){
                        dp[i+1][su+score][min(mi,score)][max(mx,score)] += dp[i][su][mi][mx];
                    }
                }
            }
        }
    }


    ll ans=0;
    rep(i,101) for(int j=i;j<=100;j++) ans+=dp[6][t+i+j][i][j];
    cout << ans << endl;
}
0