結果

問題 No.1532 Different Products
ユーザー chineristAC
提出日時 2021-05-02 19:49:10
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,522 bytes
コンパイル時間 728 ms
コンパイル使用メモリ 44,648 KB
最終ジャッジ日時 2025-01-21 05:58:24
ジャッジサーバーID
(参考情報)
judge5 / judge5
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.cpp:13:10: fatal error: testlib.h: No such file or directory
   13 | #include "testlib.h"
      |          ^~~~~~~~~~~
compilation terminated.

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <random>
#include <stdio.h>
#include <fstream>
#include "testlib.h"
#include <functional>
using namespace std;
//using namespace atcoder;

using ll = long long;
using pll = pair<ll,ll>;
//using mint = modint998244353;

#define all(i) (i).begin(),(i).end()
#define pb push_back
#define INF 100000000000000000

#define rep(i,n) for (int i=0;i<n;i++)
#define rep2(l,r) for (int i=l;i<r;i++)


bool chmin(ll &x,ll a){
  if (x > a){
    x = a;
    return 1;
  }
  else{
    return 0;
  }
}

bool chmax(ll &x,ll a){
  if (x < a){
    x = a;
    return 1;
  }
  else{
    return 0;
  }
}

const long long MIN_N = 1;
const long long MAX_N = 200;
const long long MIN_K = 1;
const long long MAX_K = 10000000000;


int main(int argc, char* argv[]){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);

  registerValidation(argc,argv);
  ll N = inf.readLong(MIN_N,MAX_N,"N");
  inf.readSpace();
  ll K = inf.readLong(MIN_K,MAX_K,"K");
  inf.readEoln();
  inf.readEof();

  ll M = ceil(sqrt(K));
  M = min(K,M);

  vector<ll> res(M+1,1);
  vector<ll> Res(M+1,1);

  res[0] = 0;
  Res[0] = 1;
  for (ll n=1;n<N+1;n++){
    for (ll i=1;i<M+1;i++){
      if (i*n<=M){
        Res[i] += Res[i*n];
      }
      else{
        Res[i] += res[K/(n*i)];
      }
    }
    for (ll i=M;i>n-1;i--){
      res[i] += res[i/n];
    }
  }

  cout<<Res[1]-1<<endl;


  


  


}
0