結果

問題 No.2037 NAND Pyramid
ユーザー yamakeyamake
提出日時 2022-08-12 22:35:48
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 952 bytes
コンパイル時間 2,586 ms
コンパイル使用メモリ 185,684 KB
実行使用メモリ 8,564 KB
最終ジャッジ日時 2023-10-24 10:52:43
合計ジャッジ時間 8,137 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,372 KB
testcase_01 AC 4 ms
4,372 KB
testcase_02 AC 2 ms
4,372 KB
testcase_03 AC 5 ms
4,372 KB
testcase_04 AC 4 ms
4,372 KB
testcase_05 AC 3 ms
4,372 KB
testcase_06 AC 3 ms
4,372 KB
testcase_07 AC 1,431 ms
4,372 KB
testcase_08 TLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>

using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define debug(output) if(debugFlag)cout<<#output<<"= "<<output<<"\n";
using lint = long long;
typedef pair<int,int> P;
const bool debugFlag=true;
const lint linf=1.1e18;const int inf=1.01e9;
constexpr int MOD=1000000007;
template<class T>bool chmax(T &a, const T &b) { if(a < b){ a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if(a > b){ a = b; return 1; } return 0; }

#define bitsize 400050

signed main(){
    int n,k;cin>>n>>k;
    string s;cin>>s;
    bitset<bitsize> dp;
    rep(i,n)if(s[i]=='1')dp[bitsize-1-i]=true;
    rep(_z,n-k){
        dp=~(dp&(dp<<1));
    }
    string res=dp.to_string();
    rep(i,k)cout<<res[i];
    cout<<"\n";
    return 0;
}
0