結果

問題 No.1905 PURE PHRASE
ユーザー monnumonnu
提出日時 2022-04-15 22:02:24
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 13 ms / 2,000 ms
コード長 815 bytes
コンパイル時間 3,692 ms
コンパイル使用メモリ 230,620 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-26 07:57:03
合計ジャッジ時間 5,680 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll=long long;
using Graph=vector<vector<int>>;
#define INF 1000000000
#define MOD 998244353
#define MAX 1000

int main(){
  int N;
  cin>>N;
  vector<int> A(N);
  for(int i=0;i<N;i++){
    cin>>A[i];
  }
  vector<double> f(7);
  f[0]=261.6;
  f[1]=294.3;
  f[2]=327.0;
  f[3]=348.8;
  f[4]=392.4;
  f[5]=436.0;
  f[6]=490.5;
  vector<string> ans(7);
  ans[0]="C4";
  ans[1]="D4";
  ans[2]="E4";
  ans[3]="F4";
  ans[4]="G4";
  ans[5]="A4";
  ans[6]="B4";

  vector<double> chi(7,0.0);
  for(int i=0;i<7;i++){
    int w=(double)N/f[i];
    for(int j=0;j<40000;j++){
      chi[i]+=pow(A[j+w]-A[j],2.0);
    }
  }

  int k=0;
  for(int i=0;i<7;i++){
    if(chi[k]>chi[i]){
      k=i;
    }
  }
  cout<<ans[k]<<'\n';
}
0