結果

問題 No.1376 Simple LPS Problem
ユーザー 👑 Nachia
提出日時 2021-02-05 22:53:42
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 467 bytes
コンパイル時間 2,256 ms
コンパイル使用メモリ 194,320 KB
最終ジャッジ日時 2025-01-18 12:51:14
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 59 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using LL=long long;
using ULL=unsigned long long;
#define rep(i,n) for(int i=0; i<(n); i++)

int N,K;
string S="010011";
string ans;

int main(){
  cin>>N>>K;
  if(K>=4){
    ans=string(K,'1');
    while(ans.size()<N) ans+=S;
    ans.resize(N);
  }
  else if(K*2>=N){
    ans=string(K,'1')+string(N-K,'0');
  }
  else if(K==3 && N==8){
    ans="11101000";
  }
  else{
    ans="-1";
  }
  cout<<ans<<endl;
  return 0;
}

0