結果

問題 No.2247 01 ZigZag
ユーザー otoshigootoshigo
提出日時 2023-03-17 21:35:30
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 1,204 bytes
コンパイル時間 1,202 ms
コンパイル使用メモリ 72,888 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-18 20:08:15
合計ジャッジ時間 4,651 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 16 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 29 ms
4,348 KB
testcase_06 AC 18 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 13 ms
4,348 KB
testcase_09 AC 93 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 16 ms
4,348 KB
testcase_12 AC 98 ms
4,348 KB
testcase_13 AC 19 ms
4,348 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 91 ms
4,348 KB
testcase_16 AC 257 ms
4,348 KB
testcase_17 AC 169 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 11 ms
4,348 KB
testcase_22 AC 79 ms
4,348 KB
testcase_23 AC 8 ms
4,348 KB
testcase_24 AC 2 ms
4,348 KB
testcase_25 AC 256 ms
4,348 KB
testcase_26 AC 141 ms
4,348 KB
testcase_27 AC 3 ms
4,348 KB
testcase_28 AC 5 ms
4,348 KB
testcase_29 AC 29 ms
4,348 KB
testcase_30 AC 100 ms
4,348 KB
testcase_31 AC 2 ms
4,348 KB
testcase_32 AC 7 ms
4,348 KB
testcase_33 AC 5 ms
4,348 KB
testcase_34 AC 6 ms
4,348 KB
testcase_35 AC 5 ms
4,348 KB
testcase_36 AC 5 ms
4,348 KB
testcase_37 AC 2 ms
4,348 KB
testcase_38 AC 3 ms
4,348 KB
testcase_39 AC 4 ms
4,348 KB
testcase_40 AC 2 ms
4,348 KB
testcase_41 AC 213 ms
4,348 KB
testcase_42 AC 6 ms
4,348 KB
testcase_43 AC 2 ms
4,348 KB
testcase_44 AC 2 ms
4,348 KB
testcase_45 AC 401 ms
4,348 KB
testcase_46 AC 401 ms
4,348 KB
testcase_47 AC 2 ms
4,348 KB
testcase_48 AC 2 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<iostream>
#include<vector>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
template<class T> bool chmax(T &a, T b){if (a < b){a = b;return true;} else return false;}
template<class T> bool chmin(T &a, T b){if (a > b){a = b;return true;} else return false;}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n,m,k;
    cin>>n>>m>>k;
    if(n>=k/2+1&&m>=(k+1)/2){
        string s="";
        rep(i,k+1){
            if(i%2==0){
                s+='0';
                n--;
            }else{
                s+='1';
                m--;
            }
        }
        rep(i,n)s='0'+s;
        if(s.back()=='0'){
            s.pop_back();
            rep(i,m)s+='1';
            s+='0';
        }else{
            rep(i,m)s+='1';
        }
        cout<<s<<"\n";
    }else if(n>=(k+1)/2&&m>=k/2+1){
        rep(i,k+1){
            if(i%2==0){
                cout<<1;
                m--;
            }
            else cout<<0;
        }
        rep(i,m)cout<<1;
        cout<<"\n";
    }else{
        cout<<-1<<"\n";
    }
}
0