結果

問題 No.1905 PURE PHRASE
ユーザー Tomo MTomo M
提出日時 2022-04-15 21:42:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 28 ms / 2,000 ms
コード長 402 bytes
コンパイル時間 110 ms
コンパイル使用メモリ 10,740 KB
実行使用メモリ 13,456 KB
最終ジャッジ日時 2023-08-26 07:42:33
合計ジャッジ時間 2,754 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
12,688 KB
testcase_01 AC 26 ms
13,256 KB
testcase_02 AC 27 ms
13,288 KB
testcase_03 AC 27 ms
13,288 KB
testcase_04 AC 26 ms
13,196 KB
testcase_05 AC 25 ms
13,164 KB
testcase_06 AC 25 ms
13,068 KB
testcase_07 AC 26 ms
13,140 KB
testcase_08 AC 26 ms
13,276 KB
testcase_09 AC 26 ms
13,164 KB
testcase_10 AC 26 ms
13,104 KB
testcase_11 AC 25 ms
13,160 KB
testcase_12 AC 27 ms
13,456 KB
testcase_13 AC 28 ms
13,176 KB
testcase_14 AC 28 ms
13,140 KB
testcase_15 AC 28 ms
13,132 KB
testcase_16 AC 28 ms
13,172 KB
testcase_17 AC 28 ms
13,108 KB
testcase_18 AC 27 ms
13,380 KB
testcase_19 AC 28 ms
13,136 KB
testcase_20 AC 27 ms
13,216 KB
testcase_21 AC 28 ms
13,248 KB
testcase_22 AC 28 ms
13,336 KB
testcase_23 AC 26 ms
13,244 KB
testcase_24 AC 28 ms
13,184 KB
testcase_25 AC 28 ms
13,116 KB
testcase_26 AC 28 ms
13,292 KB
testcase_27 AC 27 ms
13,248 KB
testcase_28 AC 27 ms
13,108 KB
testcase_29 AC 28 ms
13,164 KB
testcase_30 AC 26 ms
13,276 KB
testcase_31 AC 28 ms
13,100 KB
testcase_32 AC 27 ms
13,384 KB
testcase_33 AC 28 ms
13,192 KB
testcase_34 AC 28 ms
13,228 KB
testcase_35 AC 27 ms
13,096 KB
testcase_36 AC 27 ms
13,404 KB
testcase_37 AC 26 ms
13,228 KB
testcase_38 AC 26 ms
13,080 KB
testcase_39 AC 27 ms
13,120 KB
testcase_40 AC 26 ms
13,192 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int, input().split()))

freq={'C4':261.6,
      'D4':294.3,
      'E4':327.0,
      'F4':348.8,
      'G4':392.4,
      'A4':436.0,
      'B4':490.5}

min_diff = 10000000000
for k,v in freq.items():
  n = int(44100/v)
  #print(k,v)
  #print(n)
  diff = sum([abs(A[i]-A[i+n]) for i in range(n)])/n
  #print(diff)
  if diff < min_diff:
    min_diff = diff
    ans = k
print(ans)
0