結果
問題 | No.1376 Simple LPS Problem |
ユーザー |
|
提出日時 | 2021-02-05 22:02:57 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 7 ms / 2,000 ms |
コード長 | 485 bytes |
コンパイル時間 | 510 ms |
コンパイル使用メモリ | 65,432 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-02 12:31:31 |
合計ジャッジ時間 | 2,956 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 60 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main() | ^~~~
ソースコード
#include<iostream>using namespace std;int N,K;main(){cin>>N>>K;if(K>=4){for(int i=0;i<K;i++)cout<<0;for(int i=0;i<N-K;i++)cout<<(i%6==0||i%6==1||i%6==3?1:0);cout<<endl;}else if(K*2>=N){for(int i=0;i<K;i++)cout<<0;for(int i=0;i<N-K;i++)cout<<1;cout<<endl;}else{if(K==1)cout<<-1<<endl;else if(K==2)cout<<-1<<endl;else if(K==3){if(N==7)cout<<"0001011"<<endl;else if(N==8)cout<<"00010111"<<endl;else cout<<-1<<endl;}}}