結果

問題 No.1732 ~サンプルはちゃんと見て!~ 16進数と8進数(2)
ユーザー SSRS
提出日時 2021-11-05 21:45:47
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 502 bytes
コンパイル時間 1,744 ms
コンパイル使用メモリ 168,080 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-06 12:31:34
合計ジャッジ時間 2,347 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 3
権限があれば一括ダウンロードができます

ソースコード

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