結果

問題 No.1732 ~サンプルはちゃんと見て!~ 16進数と8進数(2)
ユーザー SSRSSSRS
提出日時 2021-11-05 21:45:47
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 502 bytes
コンパイル時間 1,570 ms
コンパイル使用メモリ 162,816 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 05:31:53
合計ジャッジ時間 2,246 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 3 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
  int T;
  cin >> T;
  for (int i = 0; i < T; i++){
    int N;
    cin >> N;
    int D = (N * 4 + 2) / 3;
    if (D % 7 != 0){
      cout << -1 << endl;
    } else {
      D /= 7;
      if (D % 4 == 1 || D % 4 == 3){
        cout << "ABDCC";
      }
      if (D % 4 == 2 || D % 4 == 3){
        cout << "BBCCCFACAC";
      }
      for (int j = 0; j < D / 4; j++){
        cout << "ACCACCCCCCCCABACAAFFE";
      }
      cout << endl;
    }
  }
}
0