結果

問題 No.2247 01 ZigZag
ユーザー ransewhaleransewhale
提出日時 2023-03-20 00:28:48
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,055 bytes
コンパイル時間 2,431 ms
コンパイル使用メモリ 77,832 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-18 17:57:05
合計ジャッジ時間 4,001 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 7 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 6 ms
4,348 KB
testcase_06 AC 5 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 9 ms
4,348 KB
testcase_09 AC 7 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 5 ms
4,348 KB
testcase_12 AC 6 ms
4,348 KB
testcase_13 AC 4 ms
4,348 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 6 ms
4,348 KB
testcase_16 AC 8 ms
4,348 KB
testcase_17 AC 9 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 3 ms
4,348 KB
testcase_22 AC 10 ms
4,348 KB
testcase_23 AC 4 ms
4,348 KB
testcase_24 AC 2 ms
4,348 KB
testcase_25 AC 9 ms
4,348 KB
testcase_26 AC 8 ms
4,348 KB
testcase_27 AC 7 ms
4,348 KB
testcase_28 AC 10 ms
4,348 KB
testcase_29 AC 8 ms
4,348 KB
testcase_30 AC 11 ms
4,348 KB
testcase_31 AC 2 ms
4,348 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 3 ms
4,348 KB
testcase_38 AC 3 ms
4,348 KB
testcase_39 WA -
testcase_40 AC 2 ms
4,348 KB
testcase_41 AC 7 ms
4,348 KB
testcase_42 WA -
testcase_43 AC 2 ms
4,348 KB
testcase_44 AC 2 ms
4,348 KB
testcase_45 AC 13 ms
4,348 KB
testcase_46 AC 13 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 <stdio.h>
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>

#pragma GCC optimize("O2")

using ll = long long int;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

int z[2][100100];

int main(void){
	int n,m,k,a,b,i,j,l;
	std::cin >> n >> m >> k; ++k;
	a = (k+1)/2; b = k/2;
	if(n >= a && m >= b){
		n -= a; m -= b;
		for(i=0; i<a; ++i){
			++z[0][i];
		}
		for(i=0; i<b; ++i){
			++z[1][i];
		}
		z[0][0] += n; z[1][b-1] += m;
	}else if(n >= b && m >= a){
		n -= b; m -= a;
		for(i=1; i<=b; ++i){
			++z[0][i];
		}
		for(i=0; i<a; ++i){
			++z[1][i];
		}
		z[0][0] += n; z[1][b-1] += m;
	}else{
		std::cout << "-1" << std::endl;
		return 0;
	}
	for(i=0; i<k; ++i){
		for(j=0; j<2; ++j){
			for(l=0; l<z[j][i]; ++l){
				std::cout << j;
			}
		}
	}
	std::cout << std::endl;
	return 0;
}
0