結果

問題 No.2256 Step by Step
ユーザー noya2noya2
提出日時 2023-01-27 02:19:20
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,883 bytes
コンパイル時間 2,320 ms
コンパイル使用メモリ 207,900 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-09 23:30:18
合計ジャッジ時間 4,714 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

vector<string> ans1 =
{

"1",
"1",
"0",
"0",
"0",
"1"

};

vector<string> ans3 = 
{

"012",
"345",
"345",
"225",
"141",
"300"

};

vector<string> ans4 =
{

"4551",
"3662",
"6777",
"3005",
"3442",
"0112"

};

vector<string> core = 
{

 "3017",
 "4525",
 "4621",
"6677",
"3435",
"0012"

};

vector<string> left0 = 
{

"512",
"075",
"071",
"22",
"05",
"17"

};

vector<string> right0 =
{

 "66812",
 "00508",
 "33608",
"399155",
"444901",
"088228"

};

vector<string> right1 =
{

 "03",
 "61",
 "61",
"444",
"331",
"060"

};

vector<string> right2 =
{

 "336",
 "669",
 "881",
"4448",
"3001",
"0991"

};

vector<string> right3 =
{

 "3021",
 "9564",
 "9264",
"44455",
"39362",
"00114"

};

int main(){
    int n; cin >> n;
    if (n == 1){
        for (int i = 0; i < 6; i++){
            cout << ans1[i] << endl;
        }
        return 0;
    }
    if (n == 2){
        cout << -1 << endl;
        return 0;
    }
    if (n == 3){
        for (int i = 0; i < 6; i++){
            cout << ans3[i] << endl;
        }
        return 0;
    }
    if (n == 4){
        for (int i = 0; i < 6; i++){
            cout << ans4[i] << endl;
        }
        return 0;
    }
    vector<string> ans = left0;
    for (int t = 0; t < (n - 5) / 4; t++){
        for (int i = 0; i < 6; i++){
            ans[i] += core[i];
        }
    }
    if (n % 4 == 0){
        for (int i = 0; i < 6; i++){
            ans[i] += right0[i];
        }
    }
    if (n % 4 == 1){
        for (int i = 0; i < 6; i++){
            ans[i] += right1[i];
        }
    }
    if (n % 4 == 2){
        for (int i = 0; i < 6; i++){
            ans[i] += right2[i];
        }
    }
    if (n % 4 == 3){
        for (int i = 0; i < 6; i++){
            ans[i] += right3[i];
        }
    }
    for (int i = 0; i < 6; i++){
        cout << ans[i] << endl;
    }
    return 0;
}
0