結果
| 問題 |
No.1376 Simple LPS Problem
|
| コンテスト | |
| ユーザー |
bachoppi
|
| 提出日時 | 2021-02-05 22:21:16 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,013 bytes |
| コンパイル時間 | 942 ms |
| コンパイル使用メモリ | 115,384 KB |
| 最終ジャッジ日時 | 2025-01-18 12:35:42 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 58 WA * 2 |
ソースコード
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=998244353;
#define pai 3.141592653589793238462643383279
int main(){
int n, k; cin >> n>> k;
if(k<=3){
if(n>2*k){
cout << -1 << endl; return 0;
}
int ans[2*k] = {};
for(int i=k; i<2*k; i++){
ans[i] = 1;
}
rep(i, n){
cout << ans[i];
}
cout << endl;
return 0;
}
int ans[k+2] = {};
rep(i, k+2){
if(i!=0 && i!=k-1 && i!=k) ans[i] = 1;
}
rep(i, n/(k+2)){
rep(j, k+2){
cout << ans[j];
}
}
rep(i, n%(k+2)){
cout << ans[i];
}
cout << endl;
}
bachoppi