結果

問題 No.1385 Simple Geometry 2
ユーザー Mitarushi
提出日時 2021-02-03 17:51:46
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 265 bytes
コンパイル時間 215 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 155,080 KB
最終ジャッジ日時 2024-07-04 13:01:10
合計ジャッジ時間 14,478 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2 RE * 1
other WA * 6 RE * 4 TLE * 55
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
from numpy.fft import rfft, irfft
from math import pi

n, l = map(int, input().split())
t = np.array(list(map(int, input().split()))) * (2*pi/l)
sin = np.sin(t)
cos = np.cos(t)

x = irfft(rfft(cos)*rfft(sin)) * np.arange(n)
print(np.sum(x)*0+0.5)
0