結果

問題 No.1905 PURE PHRASE
ユーザー SSRSSSRS
提出日時 2022-04-15 21:28:08
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 13 ms / 2,000 ms
コード長 563 bytes
コンパイル時間 2,142 ms
コンパイル使用メモリ 205,044 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-26 07:30:59
合計ジャッジ時間 3,962 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
4,380 KB
testcase_01 AC 12 ms
4,376 KB
testcase_02 AC 13 ms
4,376 KB
testcase_03 AC 12 ms
4,380 KB
testcase_04 AC 12 ms
4,376 KB
testcase_05 AC 11 ms
4,376 KB
testcase_06 AC 12 ms
4,380 KB
testcase_07 AC 12 ms
4,376 KB
testcase_08 AC 11 ms
4,376 KB
testcase_09 AC 11 ms
4,380 KB
testcase_10 AC 11 ms
4,380 KB
testcase_11 AC 12 ms
4,376 KB
testcase_12 AC 11 ms
4,376 KB
testcase_13 AC 11 ms
4,380 KB
testcase_14 AC 11 ms
4,376 KB
testcase_15 AC 11 ms
4,376 KB
testcase_16 AC 11 ms
4,384 KB
testcase_17 AC 11 ms
4,376 KB
testcase_18 AC 12 ms
4,380 KB
testcase_19 AC 12 ms
4,380 KB
testcase_20 AC 10 ms
4,380 KB
testcase_21 AC 11 ms
4,376 KB
testcase_22 AC 11 ms
4,380 KB
testcase_23 AC 11 ms
4,380 KB
testcase_24 AC 11 ms
4,380 KB
testcase_25 AC 11 ms
4,376 KB
testcase_26 AC 11 ms
4,376 KB
testcase_27 AC 11 ms
4,376 KB
testcase_28 AC 11 ms
4,376 KB
testcase_29 AC 11 ms
4,384 KB
testcase_30 AC 10 ms
4,376 KB
testcase_31 AC 11 ms
4,376 KB
testcase_32 AC 11 ms
4,376 KB
testcase_33 AC 12 ms
4,376 KB
testcase_34 AC 11 ms
4,376 KB
testcase_35 AC 12 ms
4,376 KB
testcase_36 AC 11 ms
4,376 KB
testcase_37 AC 12 ms
4,376 KB
testcase_38 AC 11 ms
4,376 KB
testcase_39 AC 11 ms
4,380 KB
testcase_40 AC 11 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
vector<double> f = {261.6, 294.3, 327.0, 348.8, 392.4, 436.0, 490.5};
vector<string> r = {"C4", "D4", "E4", "F4", "G4", "A4", "B4"};
int main(){
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++){
    cin >> A[i];
  }
  vector<long long> S(7, 0);
  for (int i = 0; i < 7; i++){
    int c = N / f[i];
    for (int j = 0; j < N - c; j++){
      S[i] += abs(A[j] - A[j + c]);
    }
  }
  int p = 0;
  for (int i = 0; i < 7; i++){
    if (S[i] < S[p]){
      p = i;
    }
  }
  cout << r[p] << endl;
}
0