結果
| 問題 |
No.1905 PURE PHRASE
|
| コンテスト | |
| ユーザー |
milanis48663220
|
| 提出日時 | 2022-04-15 21:48:00 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 653 ms / 2,000 ms |
| コード長 | 420 bytes |
| コンパイル時間 | 341 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 46,124 KB |
| 最終ジャッジ日時 | 2024-12-25 00:23:34 |
| 合計ジャッジ時間 | 29,362 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 38 |
ソースコード
import numpy as np
import math
sound = {261.6: "C4", 294.3: "D4", 327.0: "E4", 348.8: "F4", 392.4: "G4", 436.0: "A4", 490.5: "B4"}
n = int(input())
a = np.array(list(map(int, input().split())))
ans = ""
min_norm = math.inf
for freq, kind in sound.items():
cycle = int(n/freq)
b = a[:-cycle]-a[cycle:]
norm = np.linalg.norm(b)
if norm < min_norm:
min_norm = norm
ans = kind
print(ans)
milanis48663220