結果

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

ソースコード

diff #

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
 
#include<bits/stdc++.h>
using namespace std;

vector<ll> divisor(ll x){
  set<ll> s;
  for(ll i=1;i*i<=x;i++){
    if(x%i==0){
      s.insert(i);
      s.insert(x/i);
    }
  }
  vector<ll> res;
  for(auto y:s) res.push_back(y);
  return res;
}
 
int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  ll n;
  cin>>n;
  vector<ll> A=divisor(n);
  cout<<n-A.size()<<endl;
  
  return 0;
}
0