結果
問題 |
No.1764 Square
|
ユーザー |
|
提出日時 | 2022-03-02 20:25:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 425 bytes |
コンパイル時間 | 1,810 ms |
コンパイル使用メモリ | 172,504 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-16 11:07:53 |
合計ジャッジ時間 | 2,407 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 5 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ int K; cin>>K; queue<char> Q[200]; Q[0].push('A'); Q[0].push('E'); Q[1].push('B'); Q[2].push('C'); Q[3].push('D'); for(int i=1;i<=K;i++){ char T=Q[(i-1)%4].front(); Q[(i-1)%4].pop(); Q[i%4].push(T); } for(int i=0;i<=3;i++){ while(Q[i].size()>0){ cout<<Q[i].front(); Q[i].pop(); } cout<<" "<<endl; } }