結果
| 問題 | No.1764 Square |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-01-15 10:44:09 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 603 bytes |
| 記録 | |
| コンパイル時間 | 577 ms |
| コンパイル使用メモリ | 72,132 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2025-01-15 10:44:10 |
| 合計ジャッジ時間 | 1,271 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:13:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
13 | scanf("%d",&k);
| ~~~~~^~~~~~~~~
ソースコード
#include<iostream>
#include<queue>
#define rep(i,n) for(i=0;i<(int)(n);i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int k;
int main(){
int i;
vector<queue<char> > ques(4);
scanf("%d",&k);
ques[0].push('A');ques[0].push('E');
ques[1].push('B');
ques[2].push('C');
ques[3].push('D');
rep(i,k){
ques[(i+1)%4].push(ques[i%4].front());
ques[i%4].pop();
}
rep(i,4){
while(ques[i].size()){
putchar(ques[i].front());
ques[i].pop();
}
putchar('\n');
}
return 0;
}