結果
問題 | No.2247 01 ZigZag |
ユーザー | Pres1dent |
提出日時 | 2023-03-17 22:19:54 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 3,473 bytes |
コンパイル時間 | 4,209 ms |
コンパイル使用メモリ | 262,608 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-18 11:27:03 |
合計ジャッジ時間 | 5,629 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
6,812 KB |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | WA | - |
testcase_37 | WA | - |
testcase_38 | WA | - |
testcase_39 | WA | - |
testcase_40 | WA | - |
testcase_41 | AC | 3 ms
6,940 KB |
testcase_42 | AC | 3 ms
6,940 KB |
testcase_43 | WA | - |
testcase_44 | WA | - |
testcase_45 | WA | - |
testcase_46 | WA | - |
testcase_47 | AC | 2 ms
6,940 KB |
testcase_48 | AC | 2 ms
6,940 KB |
testcase_49 | WA | - |
testcase_50 | WA | - |
testcase_51 | WA | - |
ソースコード
#include "bits/stdc++.h" #include <unistd.h> using namespace std; #include "atcoder/all" using namespace atcoder; using i64 = long long; using i128 = __int128_t; using u64 = unsigned long long; using ld = long double; using i_i = pair<int, int>; using l_l = pair<i64, i64>; using d_d = pair<double, double>; using s_s = pair<string, string>; using i_i_i = tuple<int, int, int>; using i_i_i_i = tuple<int, int, int, int>; using l_l_l = tuple<i64, i64, i64>; using l_l_l_l = tuple<i64, i64, i64, i64>; using _bool = int; #define rep(i, n) for(int i = 0; i < n; i++) #define ifbit(n,k) ((n>>k)&1) //if kth bit of n is on then true (sitakara, 0-indexed) #define zpad(i) cout << setfill('0') << setw(i) #define dout cout << fixed << setprecision(10) #define douts(i) cout << fixed << setprecision(i) << scientific #define pcnt __builtin_popcount constexpr int INF = 2147483647; constexpr i64 I64F = 9223372036854775807; template <class T> bool chmax(T &l, const T &r) { if (l < r) { l = r; return true; } return false; } template <class T> bool chmin(T &l, const T &r) { if (l > r) { l = r; return true; } return false; } template <class T> pair<int, bool> ub(const vector<T> &v, const T &key) { int ind = upper_bound(v.begin(), v.end(), key) - v.begin(); if (ind == (int)v.size()) return make_pair(0, false); return make_pair(ind, true); } template <class T> pair<int, bool> rub(const vector<T> &v, const T &key) { int ind = upper_bound(v.rbegin(), v.rend(), key, [](const T &l, const T &r) { return l > r; }) - v.rbegin(); if (ind == (int)v.size()) return make_pair(0, false); return make_pair((int)v.size() - 1 - ind, true); } template <class T> pair<int, bool> lb(const vector<T> &v, const T &key) { int ind = lower_bound(v.begin(), v.end(), key) - v.begin(); if (ind == (int)v.size()) return make_pair(0, false); return make_pair(ind, true); } template <class T> pair<int, bool> rlb(const vector<T> &v, const T &key) { int ind = lower_bound(v.rbegin(), v.rend(), key, [](const T &l, const T &r) { return l > r; }) - v.rbegin(); if (ind == (int)v.size()) return make_pair(0, false); return make_pair((int)v.size() - 1 - ind, true); } std::ostream &operator<<(std::ostream &dest, __int128_t value) { std::ostream::sentry s(dest); if (s) { __uint128_t tmp = value < 0 ? -value : value; char buffer[128]; char *d = std::end(buffer); do { --d; *d = "0123456789"[tmp % 10]; tmp /= 10; } while (tmp != 0); if (value < 0) { --d; *d = '-'; } int len = std::end(buffer) - d; if (dest.rdbuf()->sputn(d, len) != len) { dest.setstate(std::ios_base::badbit); } } return dest; } int main() { int n, m, k; cin >> n >> m >> k; int ma = min(n, m) * 2 - (n == m); if (k > ma) { cout << -1 << endl; } if (ma == k) { if (n > m) { rep(i, n - m) { cout << '0'; } rep(i, m) { cout << "01"; } cout << endl; return 0; } else if (n < m || n == m) { rep(i, n) { cout << "01"; } rep(i, m - n) { cout << '1'; } cout << endl; } } else { rep(i, n - min(n, m)) { cout << '0'; } rep(i, min(n, m)) { cout << "01"; } rep(i, m - min(n, m)) { cout << '1'; } cout << endl; } }