結果

問題 No.2339 Factorial Paths
ユーザー rniyarniya
提出日時 2023-06-05 16:29:17
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 36 ms / 2,000 ms
コード長 1,799 bytes
コンパイル時間 2,120 ms
コンパイル使用メモリ 203,132 KB
実行使用メモリ 12,196 KB
最終ジャッジ日時 2023-08-28 09:38:02
合計ジャッジ時間 8,495 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
12,048 KB
testcase_01 AC 7 ms
11,976 KB
testcase_02 AC 8 ms
11,992 KB
testcase_03 AC 8 ms
12,024 KB
testcase_04 AC 8 ms
11,976 KB
testcase_05 AC 8 ms
11,992 KB
testcase_06 AC 9 ms
12,156 KB
testcase_07 AC 8 ms
11,984 KB
testcase_08 AC 8 ms
12,196 KB
testcase_09 AC 8 ms
12,000 KB
testcase_10 AC 9 ms
11,976 KB
testcase_11 AC 9 ms
12,024 KB
testcase_12 AC 9 ms
12,048 KB
testcase_13 AC 11 ms
12,032 KB
testcase_14 AC 13 ms
11,972 KB
testcase_15 AC 19 ms
11,972 KB
testcase_16 AC 27 ms
12,000 KB
testcase_17 AC 33 ms
12,044 KB
testcase_18 AC 35 ms
12,044 KB
testcase_19 AC 36 ms
12,036 KB
testcase_20 AC 36 ms
11,980 KB
testcase_21 AC 35 ms
12,000 KB
testcase_22 AC 36 ms
12,028 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#ifdef LOCAL
#include <debug.hpp>
#else
#define debug(...) void(0)
#endif

using namespace std;

typedef long long ll;
#define all(x) begin(x), end(x)
constexpr int INF = (1 << 30) - 1;
constexpr long long IINF = (1LL << 60) - 1;
constexpr int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

template <class T> istream& operator>>(istream& is, vector<T>& v) {
    for (auto& x : v) is >> x;
    return is;
}

template <class T> ostream& operator<<(ostream& os, const vector<T>& v) {
    auto sep = "";
    for (const auto& x : v) os << exchange(sep, " ") << x;
    return os;
}

template <class T, class U = T> bool chmin(T& x, U&& y) { return y < x and (x = forward<U>(y), true); }

template <class T, class U = T> bool chmax(T& x, U&& y) { return x < y and (x = forward<U>(y), true); }

template <class T> void mkuni(vector<T>& v) {
    sort(begin(v), end(v));
    v.erase(unique(begin(v), end(v)), end(v));
}

template <class T> int lwb(const vector<T>& v, const T& x) { return lower_bound(begin(v), end(v), x) - begin(v); }

const int MAX = 3000;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int N;
    cin >> N;

    vector<string> ans(MAX, string(MAX, '#'));
    ans[0][0] = '.';
    int x = 0, y = 0;
    auto make = [&](auto self, int n) -> void {
        if (n == 1) return;
        int a = n / 2, b = n - a;
        for (int i = x; i <= x + a; i++) {
            for (int j = y; j <= y + b; j++) {
                ans[i][j] = '.';
            }
        }
        x += a;
        y += b;
        self(self, a);
        self(self, b);
    };
    make(make, N);

    cout << x + 1 << ' ' << y + 1 << '\n';
    for (int i = 0; i <= x; i++) {
        for (int j = 0; j <= y; j++) cout << ans[i][j];
        cout << '\n';
    }
    return 0;
}
0