結果
問題 |
No.1905 PURE PHRASE
|
ユーザー |
|
提出日時 | 2022-04-15 23:33:13 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 14 ms / 2,000 ms |
コード長 | 618 bytes |
コンパイル時間 | 2,029 ms |
コンパイル使用メモリ | 173,268 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-25 02:46:03 |
合計ジャッジ時間 | 3,221 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 38 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll = long long; int main(){ int n; cin >> n; vector<int> hz={2616, 2943, 3270, 3488, 3924, 4360, 4905}; vector<ll> a(n); vector<string> ans={"C4", "D4", "E4", "F4", "G4", "A4", "B4"}; for(auto &&v:a)cin >> v; ll score = 0, pos = 0; for(int i = 0; i < hz.size(); i++){ int priod = 10 * n / hz[i]; ll sumv = 0; for(int j = 0; 2*j < n; j++){ sumv += a[j] * a[j + priod]; } if(sumv > score){ score = sumv; pos = i; } } cout << ans[pos] << endl; }