結果
| 問題 |
No.2614 Delete ABC
|
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2024-02-04 16:26:34 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 620 bytes |
| コンパイル時間 | 387 ms |
| コンパイル使用メモリ | 41,216 KB |
| 実行使用メモリ | 6,940 KB |
| 最終ジャッジ日時 | 2024-09-28 11:19:27 |
| 合計ジャッジ時間 | 852 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 2 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 2614.cc: No.2614 Delete ABC - yukicoder
*/
#include<cstdio>
#include<algorithm>
using namespace std;
/* constant */
const int MAX_N = 100;
const int MAX_N3 = MAX_N * 3;
const char pat0[] = "ABACBC";
const char pat1[] = "ABC";
/* typedef */
/* global variables */
char s[MAX_N3 + 4];
/* subroutines */
/* main */
int main() {
int tn;
scanf("%d", &tn);
while (tn--) {
int n;
scanf("%d", &n);
copy(pat0, pat0 + 6, s);
int k = 6;
for (int i = 2; i < n; i++, k += 3)
copy(pat1, pat1 + 3, s + k);
s[k] = '\0';
puts(s);
}
return 0;
}
tnakao0123