結果

問題 No.2480 Sequence Sum
ユーザー srjywrdnprkt
提出日時 2023-12-21 08:22:37
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 500 ms
コード長 471 bytes
コンパイル時間 2,368 ms
コンパイル使用メモリ 194,340 KB
最終ジャッジ日時 2025-02-18 13:00:27
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

vector<ll> factor;

void all_factor(ll n){
    factor.clear();
    for (ll i = 1; i*i <= n; i++){
        if (n % i == 0){
            factor.push_back(i);
            if (i*i != n) factor.push_back(n / i);
        }
    }
}

int main(){
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    
    int N;
    cin >> N;

    all_factor(N);
    cout << N-factor.size() << endl;

    return 0;
}
0