結果

問題 No.2247 01 ZigZag
ユーザー kumakumakumakuma
提出日時 2023-03-13 04:13:16
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 1,664 bytes
コンパイル時間 1,990 ms
コンパイル使用メモリ 202,700 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-18 20:07:32
合計ジャッジ時間 3,406 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 3 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 2 ms
4,348 KB
testcase_16 AC 2 ms
4,348 KB
testcase_17 AC 2 ms
4,348 KB
testcase_18 AC 2 ms
4,348 KB
testcase_19 AC 2 ms
4,348 KB
testcase_20 AC 2 ms
4,348 KB
testcase_21 AC 2 ms
4,348 KB
testcase_22 AC 2 ms
4,348 KB
testcase_23 AC 2 ms
4,348 KB
testcase_24 AC 2 ms
4,348 KB
testcase_25 AC 3 ms
4,348 KB
testcase_26 AC 2 ms
4,348 KB
testcase_27 AC 2 ms
4,348 KB
testcase_28 AC 2 ms
4,348 KB
testcase_29 AC 3 ms
4,348 KB
testcase_30 AC 3 ms
4,348 KB
testcase_31 AC 2 ms
4,348 KB
testcase_32 AC 2 ms
4,348 KB
testcase_33 AC 2 ms
4,348 KB
testcase_34 AC 2 ms
4,348 KB
testcase_35 AC 2 ms
4,348 KB
testcase_36 AC 2 ms
4,348 KB
testcase_37 AC 2 ms
4,348 KB
testcase_38 AC 2 ms
4,348 KB
testcase_39 AC 2 ms
4,348 KB
testcase_40 AC 1 ms
4,348 KB
testcase_41 AC 2 ms
4,348 KB
testcase_42 AC 3 ms
4,348 KB
testcase_43 AC 2 ms
4,348 KB
testcase_44 AC 2 ms
4,348 KB
testcase_45 AC 3 ms
4,348 KB
testcase_46 AC 3 ms
4,348 KB
testcase_47 AC 2 ms
4,348 KB
testcase_48 AC 1 ms
4,348 KB
testcase_49 AC 2 ms
4,348 KB
testcase_50 AC 2 ms
4,348 KB
testcase_51 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
// #include <atcoder/modint>
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define INF 2000000000000000000
#define ll long long
#define ull unsigned long long
#define ld long double
#define pll pair<ll, ll>
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const double PI = 3.141592653589793;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll N, M, K;
  cin >> N >> M >> K;
  if (N < M && K == N * 2) {
    string ans;
    for (ll i = 0; i < N; ++i) {
      ans += '1';
      ans += '0';
    }
    while (ans.size() != N + M) {
      ans += '1';
    }
    cout << ans << "\n";
    return 0;
  }
  if (K % 2 == 1) {
    //0000 010101 111
    ll num = (K + 1) / 2;
    if (N < num || M < num) {
      cout << -1 << "\n";
    }
    else {
      string ans;
      for (ll i = 0; i < N - (num); ++i) {
        ans += '0';
      }
      for (ll i = 0; i < num; ++i) {
        ans += '0';
        ans += '1';
      }
      for (ll i = 0; i < M - num; ++i) {
        ans += '1';
      }
      cout << ans << "\n";
    }
  }
  else {
    //0000 0101 11110
    ll num = K / 2;
    if (N < num + 1 || M < num) {
      cout << -1 << "\n";
    }
    else {
      string ans;
      for (ll i = 0; i < N - (num + 1); ++i) {
        ans += '0';
      }
      for (ll i = 0; i < num; ++i) {
        ans += '0';
        ans += '1';
      }
      for (ll i = 0; i < M - num; ++i) {
        ans += '1';
      }
      ans += '0';
      cout << ans << "\n";
    }
  }
}
0