結果
| 問題 |
No.1764 Square
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-11-26 22:26:48 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 944 bytes |
| コンパイル時間 | 5,000 ms |
| コンパイル使用メモリ | 314,436 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-29 18:09:53 |
| 合計ジャッジ時間 | 5,230 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 |
ソースコード
#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;
}