結果

問題 No.1694 ZerOne
ユーザー tko919tko919
提出日時 2021-10-02 01:40:18
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 748 bytes
コンパイル時間 2,026 ms
コンパイル使用メモリ 199,488 KB
実行使用メモリ 131,512 KB
最終ジャッジ日時 2023-09-27 01:54:11
合計ジャッジ時間 5,184 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
15,708 KB
testcase_01 AC 2 ms
7,428 KB
testcase_02 AC 4 ms
15,704 KB
testcase_03 AC 35 ms
113,928 KB
testcase_04 AC 6 ms
25,960 KB
testcase_05 AC 16 ms
66,824 KB
testcase_06 AC 3 ms
7,440 KB
testcase_07 AC 13 ms
56,592 KB
testcase_08 AC 17 ms
75,076 KB
testcase_09 AC 33 ms
111,928 KB
testcase_10 AC 14 ms
58,636 KB
testcase_11 AC 3 ms
9,520 KB
testcase_12 AC 4 ms
15,608 KB
testcase_13 AC 21 ms
81,232 KB
testcase_14 AC 33 ms
111,960 KB
testcase_15 AC 16 ms
68,920 KB
testcase_16 AC 14 ms
62,844 KB
testcase_17 AC 6 ms
28,124 KB
testcase_18 AC 2 ms
5,460 KB
testcase_19 AC 2 ms
5,376 KB
testcase_20 AC 51 ms
131,504 KB
testcase_21 AC 50 ms
131,204 KB
testcase_22 AC 47 ms
128,808 KB
testcase_23 AC 49 ms
131,512 KB
testcase_24 AC 50 ms
131,268 KB
testcase_25 AC 48 ms
131,428 KB
testcase_26 AC 44 ms
126,740 KB
testcase_27 AC 43 ms
124,572 KB
testcase_28 AC 30 ms
105,720 KB
testcase_29 AC 32 ms
109,980 KB
testcase_30 AC 35 ms
116,020 KB
testcase_31 AC 42 ms
124,816 KB
testcase_32 AC 39 ms
121,080 KB
testcase_33 AC 43 ms
124,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define rep(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define ALL(v) (v).begin(),(v).end()
using ll=long long int;
const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; const double eps=1e-12;
template<typename T>inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<typename T>inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}

ll dp[65][65][65*65];

int main(){
   string s;
   cin>>s;
   int n=s.size();
   int cnt=0,sum=0;
   rep(i,0,n)if(s[i]=='1'){
      cnt++;
      sum+=i;
   }
   dp[0][0][0]=1;
   rep(i,0,n)rep(j,0,n)rep(s,0,n*n){
      dp[i+1][j][s]+=dp[i][j][s];
      dp[i+1][j+1][s+i]+=dp[i][j][s];
   }
   cout<<dp[n][cnt][sum]<<'\n';
   return 0;
}
0