結果

問題 No.1905 PURE PHRASE
ユーザー 👑 hitonanodehitonanode
提出日時 2022-02-06 22:04:39
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 869 bytes
コンパイル時間 1,168 ms
コンパイル使用メモリ 100,064 KB
実行使用メモリ 4,512 KB
最終ジャッジ日時 2023-09-04 19:41:29
合計ジャッジ時間 3,538 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
4,380 KB
testcase_01 AC 16 ms
4,384 KB
testcase_02 AC 16 ms
4,388 KB
testcase_03 AC 16 ms
4,380 KB
testcase_04 AC 16 ms
4,380 KB
testcase_05 AC 16 ms
4,384 KB
testcase_06 AC 16 ms
4,380 KB
testcase_07 AC 16 ms
4,380 KB
testcase_08 AC 16 ms
4,380 KB
testcase_09 AC 16 ms
4,380 KB
testcase_10 AC 16 ms
4,384 KB
testcase_11 AC 16 ms
4,380 KB
testcase_12 AC 16 ms
4,380 KB
testcase_13 AC 16 ms
4,380 KB
testcase_14 AC 16 ms
4,384 KB
testcase_15 AC 16 ms
4,384 KB
testcase_16 AC 16 ms
4,384 KB
testcase_17 AC 16 ms
4,380 KB
testcase_18 AC 16 ms
4,384 KB
testcase_19 AC 17 ms
4,384 KB
testcase_20 AC 16 ms
4,380 KB
testcase_21 AC 16 ms
4,384 KB
testcase_22 AC 16 ms
4,384 KB
testcase_23 AC 16 ms
4,384 KB
testcase_24 AC 16 ms
4,380 KB
testcase_25 AC 16 ms
4,380 KB
testcase_26 AC 16 ms
4,384 KB
testcase_27 AC 16 ms
4,380 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 16 ms
4,384 KB
testcase_31 AC 16 ms
4,384 KB
testcase_32 AC 16 ms
4,380 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 16 ms
4,384 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 16 ms
4,384 KB
testcase_40 AC 16 ms
4,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// cos で畳み込んでいるため WA
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;

const vector<double> freqs{261.6, 294.3, 327.0, 348.8, 392.4, 436.0, 490.5};
const vector<string> names{"C4", "D4", "E4", "F4", "G4", "A4", "B4"};

int main() {
    cin.tie(nullptr), ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<double> A(N);
    for (auto &x : A) cin >> x;

    const double PI = acos(-1);
    double high = -1;
    int arghi = -1;

    for (int d = 0; d < int(freqs.size()); ++d) {
        double v = 0;
        for (int frame = 0; frame < N; ++frame) {
            v += cos(PI * 2 * frame / N * freqs[d]) * A[frame];
        }
        if (high < abs(v)) {
            high = abs(v);
            arghi = d;
        }
    }
    cout << names.at(arghi) << '\n';
}
0