結果

問題 No.1905 PURE PHRASE
ユーザー tonyu0tonyu0
提出日時 2022-04-15 23:44:00
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,295 bytes
コンパイル時間 847 ms
コンパイル使用メモリ 103,288 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-26 08:53:07
合計ジャッジ時間 3,690 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <algorithm>
#include <cmath>
#include <iostream>
#include <numeric>
#include <queue>
#include <unordered_map>
#include <vector>
using namespace std;
using ll = long long;
#define rep(i, j, n) for (int i = j; i < (n); ++i)
#define rrep(i, j, n) for (int i = (n)-1; j <= i; --i)
#define all(a) a.begin(), a.end()
template <typename T>
std::ostream &operator<<(std::ostream &os, std::vector<T> &a) {
  for (size_t i = 0; i < a.size(); ++i) os << (i > 0 ? " " : "") << a[i];
  return os << '\n';
}
template <typename T>
std::istream &operator>>(std::istream &is, std::vector<T> &a) {
  for (T &x : a) { is >> x; }
  return is;
}

const double F[] = {261.6, 294.3, 327.0, 348.8, 392.4, 436.0, 490.5};
const char C[] = {'C', 'D', 'E', 'F', 'G', 'A', 'B'};
double a[44111];
int main() {
  cin.tie(0)->sync_with_stdio(0);
  int n;
  cin >> n;
  rep(i, 0, n) cin >> a[i];
  int mni = 0;
  double mn = 1e18;
  rep(j, 50, 180) {
    double s = 0;
    rep(i, 0, n) {
      double t = a[i] - a[(i + j) % n];
      s += t * t;
    }
    if (s < mn) {
      mn = s;
      mni = j;
    }
  }
  double f = (double)n / mni;
  double mf = 1e18;
  int ans = 0;
  rep(i, 0, 7) {
    if (abs(f - F[i]) < mf) {
      mf = abs(f - F[i]);
      ans = i;
    }
  }
  cout << C[ans] << '4' << '\n';
  return 0;
}
0