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