結果

問題 No.1694 ZerOne
ユーザー yakkiyakki
提出日時 2021-10-01 22:26:30
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,211 bytes
コンパイル時間 1,344 ms
コンパイル使用メモリ 118,252 KB
実行使用メモリ 15,356 KB
最終ジャッジ日時 2023-09-26 18:16:20
合計ジャッジ時間 2,946 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 13 ms
11,836 KB
testcase_04 AC 3 ms
4,376 KB
testcase_05 AC 6 ms
6,388 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 5 ms
5,492 KB
testcase_08 AC 7 ms
7,060 KB
testcase_09 AC 13 ms
11,708 KB
testcase_10 AC 5 ms
5,844 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 8 ms
7,848 KB
testcase_14 AC 13 ms
11,568 KB
testcase_15 AC 6 ms
6,588 KB
testcase_16 AC 6 ms
6,052 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 17 ms
15,024 KB
testcase_21 AC 17 ms
15,080 KB
testcase_22 AC 17 ms
14,684 KB
testcase_23 AC 18 ms
15,356 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 16 ms
14,472 KB
testcase_27 AC 16 ms
13,904 KB
testcase_28 AC 12 ms
10,772 KB
testcase_29 WA -
testcase_30 AC 14 ms
12,224 KB
testcase_31 AC 16 ms
13,944 KB
testcase_32 AC 15 ms
13,248 KB
testcase_33 AC 16 ms
13,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<functional>
#include<cstdio>
#include<cstdlib>
#include<numeric>
#include<ctime>
//#include<atcoder/all>
using namespace std;
//using namespace atcoder;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
#define MOD 1000000007
//#define MOD 998244353
#define LINF (long long)4e18
#define jck 3.141592
#define PI acos(-1.0)

const double EPS = 1e-18;

using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;
//using mint = modint998244353;

int dh[] = {-1,1,0,0};
int dw[] = {0,0,1,-1};

ll dp[66][66][400];

int main(){
    string s; cin >> s;
    int n = (int)s.size();
    int rev = 0;
    int cnt1 = 0;
    rep(i,n){
        if(s[i] == '0') rev += cnt1;
        else cnt1++;
    }
    dp[0][0][0] = 1;
    rep(i,n)rep(j,n+1)rep(k,400){
        if(k-j >= 0) dp[i+1][j][k] += dp[i][j][k-j];
        if(j-1 >= 0) dp[i+1][j][k] += dp[i][j-1][k];
    }
    cout << dp[n][cnt1][rev] << endl;
}
0