結果

問題 No.1905 PURE PHRASE
ユーザー NyaanNyaanNyaanNyaan
提出日時 2022-04-15 22:33:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 156 ms / 2,000 ms
コード長 540 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 10,968 KB
実行使用メモリ 35,500 KB
最終ジャッジ日時 2023-08-26 08:17:43
合計ジャッジ時間 8,062 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 156 ms
34,432 KB
testcase_01 AC 150 ms
35,200 KB
testcase_02 AC 149 ms
35,048 KB
testcase_03 AC 150 ms
34,864 KB
testcase_04 AC 151 ms
35,216 KB
testcase_05 AC 153 ms
35,196 KB
testcase_06 AC 155 ms
35,144 KB
testcase_07 AC 152 ms
35,300 KB
testcase_08 AC 154 ms
35,176 KB
testcase_09 AC 153 ms
35,388 KB
testcase_10 AC 152 ms
35,356 KB
testcase_11 AC 151 ms
35,036 KB
testcase_12 AC 150 ms
35,208 KB
testcase_13 AC 155 ms
35,500 KB
testcase_14 AC 150 ms
35,016 KB
testcase_15 AC 150 ms
35,160 KB
testcase_16 AC 153 ms
35,312 KB
testcase_17 AC 151 ms
34,992 KB
testcase_18 AC 151 ms
35,372 KB
testcase_19 AC 150 ms
35,228 KB
testcase_20 AC 151 ms
35,416 KB
testcase_21 AC 151 ms
35,392 KB
testcase_22 AC 151 ms
35,404 KB
testcase_23 AC 151 ms
35,072 KB
testcase_24 AC 151 ms
35,296 KB
testcase_25 AC 152 ms
35,360 KB
testcase_26 AC 153 ms
35,260 KB
testcase_27 AC 154 ms
35,304 KB
testcase_28 AC 153 ms
35,016 KB
testcase_29 AC 153 ms
35,080 KB
testcase_30 AC 152 ms
35,132 KB
testcase_31 AC 151 ms
34,780 KB
testcase_32 AC 150 ms
35,428 KB
testcase_33 AC 152 ms
35,204 KB
testcase_34 AC 152 ms
35,428 KB
testcase_35 AC 152 ms
35,280 KB
testcase_36 AC 152 ms
35,360 KB
testcase_37 AC 151 ms
34,844 KB
testcase_38 AC 151 ms
35,284 KB
testcase_39 AC 151 ms
35,364 KB
testcase_40 AC 150 ms
35,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# https://qiita.com/kaityo256/items/64a54bb2e2c477cc6fa1

import numpy as np

N = int(input())
y = list(map(int, input().split()))
fk = np.fft.fft(y)
fk2 = [abs(x) for x in fk]
fk2 = fk2[:1000]

"""
plt.plot(y)
plt.show()
"""

#plt.plot(fk2)
#plt.show()

i = fk2.index(max(fk2))
#print(i)

hz = 44100 / i
l = [261.6, 294.3, 327.0, 348.8, 392.4, 436.0, 490.5]
l2 = ["C4", "D4", "E4", "F4", "G4", "A4", "B4"]
l3 = []
for i in range(len(l)):
  shuki = int(l[i] + 0.5)
  l3.append(fk2[shuki])

#print(l3)
ans = l3.index(max(l3))
print(l2[ans])
0