結果
| 問題 |
No.2037 NAND Pyramid
|
| コンテスト | |
| ユーザー |
yamake
|
| 提出日時 | 2022-08-12 22:35:48 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 952 bytes |
| コンパイル時間 | 2,452 ms |
| コンパイル使用メモリ | 185,236 KB |
| 実行使用メモリ | 10,624 KB |
| 最終ジャッジ日時 | 2024-09-23 03:15:10 |
| 合計ジャッジ時間 | 7,655 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 4 TLE * 1 -- * 34 |
ソースコード
#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;
}
yamake