結果

問題 No.1376 Simple LPS Problem
ユーザー 👑 Nachia
提出日時 2021-02-05 22:40:31
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 296 bytes
コンパイル時間 1,932 ms
コンパイル使用メモリ 189,556 KB
最終ジャッジ日時 2025-01-18 12:45:14
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 48 WA * 12
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:11:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |   scanf("%d%d",&N,&K);
      |   ~~~~~^~~~~~~~~~~~~~

ソースコード

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;

int main(){
  scanf("%d%d",&N,&K);
  if(K*2<N) printf("-1");
  else{ rep(i,K) printf("1"); rep(i,N-K) printf("0"); } printf("\n");
  return 0;
}

0