結果
問題 |
No.3114 0→1
|
ユーザー |
![]() |
提出日時 | 2025-04-20 19:34:37 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 8 ms / 2,000 ms |
コード長 | 511 bytes |
コンパイル時間 | 758 ms |
コンパイル使用メモリ | 68,776 KB |
実行使用メモリ | 7,844 KB |
最終ジャッジ日時 | 2025-04-20 19:34:39 |
合計ジャッジ時間 | 2,279 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
#include<iostream> int A0(const std::string&_0,int _1,int _2){ int _3=(_2+1)/2,_4=_1+_3-1,_5=0,_6=0; bool _7[_4],_8[_4]; for(int _9=0;_9<_3-1;_9++)_7[_9]=1; for(int _9=_3-1;_9<_4;_9++)_7[_9]=_0[_9-_3+1]=='1'; for(int _9=0;_9<_4;_9++)_8[_9]=_7[_9]; for(int _9=0;_9<_2;_9++)_6+=_7[_9]; if(_6<_3){_7[_2-1]=1;_6++;_5++;} for(int _9=1;_9<_4-_2+1;_9++){_6-=_7[_9-1];_6+=_7[_9+_2-1];if(_6<_3){_7[_9+_2-1]=1;_6++;_5++;}} return _5; } int main(){ int _0;std::string _1; std::cin>>_0>>_1; std::cout<<A0(_1,_0,3)<<'\n'; }