結果
問題 |
No.2256 Step by Step
|
ユーザー |
![]() |
提出日時 | 2023-01-27 02:19:20 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,883 bytes |
コンパイル時間 | 2,655 ms |
コンパイル使用メモリ | 198,492 KB |
最終ジャッジ日時 | 2025-02-10 07:18:06 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 32 |
ソースコード
#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; }