結果

問題 No.2247 01 ZigZag
ユーザー 👑 CleyL
提出日時 2023-03-24 10:52:06
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 797 bytes
コンパイル時間 437 ms
コンパイル使用メモリ 67,308 KB
最終ジャッジ日時 2025-02-11 16:43:47
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 43 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #
プレゼンテーションモードにする

#include <iostream>
using namespace std;
int main(){
int a,b,c;cin>>a>>b>>c;
int mx = min(a,b)*2;
if(mx < c || (mx == c && a == b)){
cout << -1 << endl;
}else if(mx == 0){
for(int i = 0; a > i; i++)cout << "0";
for(int i = 0; b > i; i++)cout << "1";
cout << endl;
}else if(mx == c){
if(b > a){
//10101
for(int i = 1; c+2 > i; i++){
cout << (i%2);
}
cout << endl;
}else{
//01010
for(int i = 0; c+1 > i; i++){
cout << (i%2);
}
cout << endl;
}
}else{
int resta = a-c/2;
int restb = b-(c+2)/2;
for(int i = 0; resta > i; i++)cout << "0";
for(int i = 1; c > i; i++)cout << (i%2);
for(int i = 0; restb >= i; i++)cout << "1";
if(c%2 == 0)cout << "0";
cout << endl;
}
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0