結果

問題 No.2256 Step by Step
ユーザー 👑 NachiaNachia
提出日時 2023-03-23 05:44:50
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,988 bytes
コンパイル時間 938 ms
コンパイル使用メモリ 86,040 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-18 19:20:59
合計ジャッジ時間 2,977 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 2 ms
4,348 KB
testcase_16 AC 2 ms
4,348 KB
testcase_17 AC 2 ms
4,348 KB
testcase_18 AC 2 ms
4,348 KB
testcase_19 AC 2 ms
4,348 KB
testcase_20 AC 2 ms
4,348 KB
testcase_21 AC 2 ms
4,348 KB
testcase_22 AC 2 ms
4,348 KB
testcase_23 AC 2 ms
4,348 KB
testcase_24 AC 2 ms
4,348 KB
testcase_25 AC 2 ms
4,348 KB
testcase_26 AC 2 ms
4,348 KB
testcase_27 AC 2 ms
4,348 KB
testcase_28 AC 2 ms
4,348 KB
testcase_29 AC 2 ms
4,348 KB
testcase_30 AC 2 ms
4,348 KB
testcase_31 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <atcoder/modint>
using namespace std;
using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
const i64 INF = 1001001001001001001;

using Modint = atcoder::static_modint<998244353>;

vector<string> ans3 = {
    "012",
    "345",
    "345",
    "225",
    "141",
    "300"
};
vector<string> ans1 = {
    "1",
    "1",
    "0",
    "0",
    "0",
    "1"
};
vector<string> ans4 = {
    "4551",
    "3662",
    "6777",
    "3005",
    "3442",
    "0112"
};


vector<string> start1 = {
    "0",
    "1",
    "2",
    "4",
    "4",
    "4"
};
vector<string> start3 = {
    "058",
    "137",
    "237",
    "444",
    "535",
    "887"
};
vector<string> start4 = {
    "0998",
    "1886",
    "2445",
    "8884",
    "9775",
    "7665"
};
vector<string> stop4 = {
    "7801",
    "6719",
    "6549",
    "4480",
    "8579",
    "6522"
};
vector<string> stop2 = {
    "12",
    "43",
    "43",
    "00",
    "41",
    "23"
};

vector<string> mid4 = {
    "0562",
    "1713",
    "2743",
    "4400",
    "5751",
    "6623"
};

int main(){
    int N; cin >> N;
    if(N == 1){
        rep(t,6) cout << ans1[t] << '\n';
    }
    else if(N == 2){
        cout << "-1\n";
    }
    else if(N == 3){
        rep(t,6) cout << ans3[t] << '\n';
    }
    else if(N == 4){
        rep(t,6) cout << ans4[t] << '\n';
    }
    else{
        vector<string> ans(6);
        auto addExp = [&](vector<string> src){
            rep(t,6){
                ans[t] += src[t];
            }
        };
        addExp((N-5)&2 ? stop4 : stop2);
        for(int t=8; t<N; t+=4) addExp(mid4);
        addExp((N-5)&1 ? start4 : start3);
        rep(t,6) cout << ans[t] << '\n';
    }
    return 0;
}



struct ios_do_not_sync{
    ios_do_not_sync(){
        ios::sync_with_stdio(false);
        cin.tie(nullptr);
    }
} ios_do_not_sync_instance;

0