結果

問題 No.83 最大マッチング
ユーザー あおこうあおこう
提出日時 2023-08-27 15:28:31
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,142 bytes
コンパイル時間 2,228 ms
コンパイル使用メモリ 198,112 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-27 15:28:34
合計ジャッジ時間 2,997 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ld = long double;

#define rep(i, r) for(int i = 0; i < (r); ++i)
#define reps(i, s, r) for(int i = (s); i < (r); ++i)
#define rrep(i, a, b) for(int i = a; i >= b; i--)
#define fore(i, m2) for(auto &i : m2)
#define vi vector<int>
#define vl vector<ll>
#define pl pair<ll, ll>
#define all(i) (i).begin(), (i).end()
#define fs first
#define sc second

template <class T> bool chmin(T &i, T b) {
    if(i > b) {
        i = b;
        return true;
    }
    return false;
}
template <class T> bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

const ll INF = LONG_LONG_MAX / 3;
const ll MOD = 1'000'000'007;
const ll MAX = 1e5 + 5;

#define EPS 0.000000001
using namespace std;

ll addOne(ll num, ll cnt) {

    for(int i = 0; i < cnt; i++) {
        num *= 10;
        num += 1;
    }
    return num;
}

int main() {

    ll n;
    cin >> n;

    ll ans = 0;
    if(n % 2 == 1) {
        ans = 7;
        ans = addOne(ans, (n - 3) / 2);
    } else {
        ans = addOne(ans, n / 2);
    }

    cout << ans << endl;
}
0