結果
問題 | No.1905 PURE PHRASE |
ユーザー |
![]() |
提出日時 | 2022-04-15 22:49:49 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 20 ms / 2,000 ms |
コード長 | 424 bytes |
コンパイル時間 | 2,731 ms |
コンパイル使用メモリ | 246,676 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-25 01:57:42 |
合計ジャッジ時間 | 4,584 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 38 |
ソースコード
#include<bits/stdc++.h> using namespace std; int N; constexpr long double hz[]={436.0,490.5,261.6,294.3,327.0,348.8,392.4}; int main(){ cin>>N; vector<long double> v(N); for(auto& x:v)cin>>x; long double sa[7]={}; for(int i=0;i<7;++i){ int j=round(44100/hz[i]); for(int k=0;k+j<N;++k){ sa[i]+=(v[k]-v[k+j])*(v[k]-v[k+j]); } } auto id=min_element(sa,sa+7)-sa; putchar('A'+id); puts("4"); }