algo — C++23 日本語リファレンス GitHub

test/yosupo/number_theory/sum_of_totient_function.test.cpp

AC · 最終更新 2026-09-07 · GitHub

問題: https://judge.yosupo.jp/problem/sum_of_totient_function

依存するヘッダ(4)
実装
// competitive-verifier: PROBLEM https://judge.yosupo.jp/problem/sum_of_totient_function
#include <iostream>
#include "number_theory/modint.hpp"
#include "number_theory/multiplicative_function.hpp"

using Mint = modint998;

int main() {
    long long n;
    std::cin >> n;
    std::cout << totient_sum<Mint>(n) << '\n';
    return 0;
}