結果

問題 No.83 最大マッチング
ユーザー cleaskycleasky
提出日時 2023-07-22 17:26:10
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 4 ms / 5,000 ms
コード長 3,084 bytes
コンパイル時間 2,268 ms
コンパイル使用メモリ 201,252 KB
実行使用メモリ 4,368 KB
最終ジャッジ日時 2023-10-23 23:54:19
合計ジャッジ時間 3,330 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,368 KB
testcase_01 AC 1 ms
4,368 KB
testcase_02 AC 2 ms
4,368 KB
testcase_03 AC 2 ms
4,368 KB
testcase_04 AC 2 ms
4,368 KB
testcase_05 AC 2 ms
4,368 KB
testcase_06 AC 2 ms
4,368 KB
testcase_07 AC 2 ms
4,368 KB
testcase_08 AC 2 ms
4,368 KB
testcase_09 AC 2 ms
4,368 KB
testcase_10 AC 4 ms
4,368 KB
testcase_11 AC 4 ms
4,368 KB
testcase_12 AC 4 ms
4,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

// clang-format off
#define GET_MACRO_5(_1, _2, _3, _4, _5, NAME, ...) NAME
#define GET_MACRO_4(_1, _2, _3, _4, NAME, ...) NAME
#define rep(...) GET_MACRO_5(__VA_ARGS__, rep5, rep4, rep3, rep2, rep1)(__VA_ARGS__)
#define rrep(...) GET_MACRO_4(__VA_ARGS__, rrep4, rrep3, rrep2, rrep1)(__VA_ARGS__)
#define rep1(n) rep2(_, n)
#define rep2(i, n) rep3(i, 0, n)
#define rep3(i, a, n) rep4(i, a, n, 1)
#define rep4(i, a, n, d) rep5(i, a, n, d, <)
#define rep5(i, a, n, d, o) for (auto i = decltype(n)(a), _n = (n); i o _n; i += (d))
#define rrep1(n) rrep2(_, n)
#define rrep2(i, n) rrep3(i, n, 0)
#define rrep3(i, a, n) rrep4(i, a, n, 1)
#define rrep4(i, a, n, d) rep5(i, a - 1, n, -d, >=)
#define ALL(c) begin(c), end(c)
#define RALL(c) rbegin(c), rend(c)
#define SORT(v) sort(ALL(v))
#define REV(v) reverse(ALL(v))
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using vi = vector<int>;
using vll = vector<long long>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
template<typename T> inline bool chmax(T &a, T b) { return ((a < b) ? (a = b, true) : (false)); }
template<typename T> inline bool chmin(T &a, T b) { return ((a > b) ? (a = b, true) : (false)); }
template<class C> inline void vcin(C& c) { for (auto& a : c) { cin >> a; } }

void _cin() {} template<class Head, class... Tail> void _cin(Head&& head, Tail&&... tail) { cin >> head; _cin(std::forward<Tail>(tail)...); }
#define IN(Type, ...) Type __VA_ARGS__; _cin(__VA_ARGS__)
#define INV(Type, xs, n) vector<Type> xs(n); rep(i, n) cin >> xs[i]
#define INV2(Type, xs, ys, n) vector<Type> xs(n), ys(n); rep(i, n) cin >> xs[i] >> ys[i]
#define INV3(Type, xs, ys, zs, n) vector<Type> xs(n), ys(n), zs(n); rep(i, n) cin >> xs[i] >> ys[i] >> zs[i]
#define INVV(Type, xs, h, w) vector<vector<Type>> xs(h, vector<Type>(w)); rep(i, h) rep(j, w) cin >> xs[i][j]
void OUT() { cout << endl; }
template<class Head, class... Tail> void OUT(Head&& head, Tail&&... tail) { cout << head; if (sizeof...(tail) != 0) cout << endl; OUT(std::forward<Tail>(tail)...); }
template<class Head, class... Tail> void OUTS(Head&& head, Tail&&... tail) { cout << head; if (sizeof...(tail) != 0) cout << " "; OUT(std::forward<Tail>(tail)...); }
template<class Type> void OUT(vector<Type> &vec) { for (auto& a : vec) { cout << a; if (&a != &vec.back()) cout << endl; } }
template<class Type> void OUTS(vector<Type> &vec) { for (auto& a : vec) { cout << a; if (&a != &vec.back()) cout << " "; } cout << endl; }
template<class Type> void OUT(vector<vector<Type>> &df) { for (auto& vec : df) { OUT(vec); } }
// clang-format on

int main()
{
    cin.tie(0)->sync_with_stdio(0);

    /**
     * 0 ... 6
     * 1 ... 2
     * 2 ... 5
     * 3 ... 5
     * 4 ... 4
     * 5 ... 5
     * 6 ... 6
     * 7 ... 3
     * 8 ... 7
     * 9 ... 6
     */

    IN(int, N);
    if (N % 2 == 0) {
        rep (N / 2) {
            cout << 1;
        }
    } else {
        cout << 7;
        rep ((N - 3) / 2) {
            cout << 1;
        }
    }
    cout << endl;
    return 0;
}
0