結果

問題 No.1764 Square
ユーザー srjywrdnprkt
提出日時 2023-05-28 20:32:08
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 747 bytes
コンパイル時間 910 ms
コンパイル使用メモリ 111,716 KB
最終ジャッジ日時 2025-02-13 15:54:54
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <set>
#include <iomanip>
#include <queue>
#include <algorithm>
#include <numeric>
#include <deque>
#include <complex>
#include <cassert>

using namespace std;
using ll = long long;

int main(){

    vector<queue<char>> v(4);
    v[0].push('A');
    v[1].push('B');
    v[2].push('C');
    v[3].push('D');
    v[0].push('E');

    int K;
    char c;
    cin >> K;
    for (int i=0; i<K; i++){
        c = v[i%4].front();
        v[i%4].pop();
        v[(i+1)%4].push(c);
    }

    for (int i=0; i<4; i++){
        while(!v[i].empty()){
            c = v[i].front();
            cout << c;
            v[i].pop();
        }
        cout << endl;
    }

    return 0;
}
0