結果
| 問題 |
No.2247 01 ZigZag
|
| コンテスト | |
| ユーザー |
沙耶花
|
| 提出日時 | 2023-03-17 21:30:32 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 761 bytes |
| コンパイル時間 | 3,523 ms |
| コンパイル使用メモリ | 253,080 KB |
| 最終ジャッジ日時 | 2025-02-11 12:36:17 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 41 WA * 9 |
ソースコード
#include <stdio.h>
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using mint = modint998244353;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf32 1000000001
#define Inf64 1000000000000000001
int main(){
int n,m,k;
cin>>n>>m>>k;
string s = "";
s += '0';
rep(i,k){
if(s.back()=='1')s += '0';
else s += '1';
}
rep(i,s.size()){
if(s[i]=='0')n--;
else m--;
}
if(n<0||m<0){
cout<<-1<<endl;
return 0;
}
s = string(n,'0') + s;
if(m>0){
bool f = false;
for(int i=s.size()-1;i>=0;i--){
if(s[i]=='1'){
rep(j,m){
s.insert(s.begin()+i,'1');
}
f = true;
break;
}
}
if(!f){
cout<<-1<<endl;
return 0;
}
}
cout<<s<<endl;
return 0;
}
沙耶花