結果

問題 No.1764 Square
ユーザー yasuwoyasuwo
提出日時 2021-11-26 22:26:48
言語 C++23(draft)
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 944 bytes
コンパイル時間 5,793 ms
コンパイル使用メモリ 310,576 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-12 05:08:26
合計ジャッジ時間 6,336 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#line 1 "main.cpp"
#include <bits/stdc++.h>
#include <atcoder/all>
// #include "library/templates/template.cpp"
using namespace atcoder;
using namespace std;
using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

void solve(int K)
{
    vector<queue<char>> qs(4);
    qs[0].push('A');
    qs[0].push('E');
    qs[1].push('B');
    qs[2].push('C');
    qs[3].push('D');
    for (int i = 0; i < K; i++)
    {
        char x = qs[i % 4].front();
        qs[i % 4].pop();
        qs[(i + 1) % 4].push(x);
    }
    for (int i = 0; i < 4; i++)
    {
        while (!qs[i].empty())
        {
            cout << qs[i].front();
            qs[i].pop();
        }
        cout << endl;
    }
}

int main()
{
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    int K;
    std::cin >> K;
    solve(K);
    return 0;
}
0