結果

問題 No.1694 ZerOne
ユーザー chocoruskchocorusk
提出日時 2021-10-04 04:15:00
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 1,119 bytes
コンパイル時間 3,433 ms
コンパイル使用メモリ 188,460 KB
実行使用メモリ 59,836 KB
最終ジャッジ日時 2023-09-29 07:36:21
合計ジャッジ時間 4,967 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
7,648 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 3 ms
7,572 KB
testcase_03 AC 13 ms
52,568 KB
testcase_04 AC 3 ms
13,804 KB
testcase_05 AC 7 ms
32,096 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 6 ms
26,064 KB
testcase_08 AC 7 ms
34,212 KB
testcase_09 AC 12 ms
50,528 KB
testcase_10 AC 7 ms
27,972 KB
testcase_11 AC 2 ms
5,540 KB
testcase_12 AC 2 ms
7,552 KB
testcase_13 AC 9 ms
38,308 KB
testcase_14 AC 12 ms
50,564 KB
testcase_15 AC 7 ms
32,072 KB
testcase_16 AC 7 ms
30,024 KB
testcase_17 AC 3 ms
13,792 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 15 ms
59,612 KB
testcase_21 AC 15 ms
59,628 KB
testcase_22 AC 14 ms
58,716 KB
testcase_23 AC 16 ms
59,836 KB
testcase_24 AC 15 ms
59,624 KB
testcase_25 AC 15 ms
59,684 KB
testcase_26 AC 15 ms
58,908 KB
testcase_27 AC 13 ms
56,724 KB
testcase_28 AC 11 ms
48,512 KB
testcase_29 AC 12 ms
50,600 KB
testcase_30 AC 12 ms
52,848 KB
testcase_31 AC 15 ms
56,644 KB
testcase_32 AC 14 ms
56,736 KB
testcase_33 AC 14 ms
56,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#include <list>
#include <atcoder/all>
#define popcount __builtin_popcount
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef pair<int, int> P;
using mint=modint998244353;
ll dp[61][61][2000];
int main()
{
    string s; cin>>s;
    int n=s.size();
    int c=0, d=0;
    for(int i=0; i<n; i++){
        if(s[i]=='1'){
            c++;
            d+=i+1;
        }
    }
    dp[0][0][0]=1;
    for(int i=0; i<n; i++){
        for(int j=0; j<=i; j++){
            for(int k=0; k<=i*(i+1)/2; k++){
                dp[i+1][j][k]+=dp[i][j][k];
                dp[i+1][j+1][k+i+1]+=dp[i][j][k];
            }
        }
    }
    cout<<dp[n][c][d]<<endl;
    return 0;
}
0