結果

問題 No.1532 Different Products
ユーザー chineristACchineristAC
提出日時 2021-05-02 19:49:10
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 413 ms / 4,000 ms
コード長 1,522 bytes
コンパイル時間 7,670 ms
コンパイル使用メモリ 252,756 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-18 11:37:34
合計ジャッジ時間 23,650 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 67 ms
5,248 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 3 ms
5,376 KB
testcase_08 AC 5 ms
5,376 KB
testcase_09 AC 34 ms
5,376 KB
testcase_10 AC 90 ms
5,376 KB
testcase_11 AC 73 ms
5,376 KB
testcase_12 AC 203 ms
5,376 KB
testcase_13 AC 141 ms
5,376 KB
testcase_14 AC 338 ms
5,376 KB
testcase_15 AC 33 ms
5,376 KB
testcase_16 AC 76 ms
5,376 KB
testcase_17 AC 85 ms
5,376 KB
testcase_18 AC 75 ms
5,376 KB
testcase_19 AC 194 ms
5,376 KB
testcase_20 AC 343 ms
5,376 KB
testcase_21 AC 110 ms
5,376 KB
testcase_22 AC 133 ms
5,376 KB
testcase_23 AC 99 ms
5,376 KB
testcase_24 AC 314 ms
5,376 KB
testcase_25 AC 174 ms
5,376 KB
testcase_26 AC 25 ms
5,376 KB
testcase_27 AC 149 ms
5,376 KB
testcase_28 AC 116 ms
5,376 KB
testcase_29 AC 90 ms
5,376 KB
testcase_30 AC 198 ms
5,376 KB
testcase_31 AC 205 ms
5,376 KB
testcase_32 AC 237 ms
5,376 KB
testcase_33 AC 182 ms
5,376 KB
testcase_34 AC 294 ms
5,376 KB
testcase_35 AC 238 ms
5,376 KB
testcase_36 AC 287 ms
5,376 KB
testcase_37 AC 46 ms
5,376 KB
testcase_38 AC 307 ms
5,376 KB
testcase_39 AC 270 ms
5,376 KB
testcase_40 AC 278 ms
5,376 KB
testcase_41 AC 399 ms
5,376 KB
testcase_42 AC 354 ms
5,376 KB
testcase_43 AC 372 ms
5,376 KB
testcase_44 AC 406 ms
5,376 KB
testcase_45 AC 408 ms
5,376 KB
testcase_46 AC 395 ms
5,376 KB
testcase_47 AC 412 ms
5,376 KB
testcase_48 AC 407 ms
5,376 KB
testcase_49 AC 409 ms
5,376 KB
testcase_50 AC 408 ms
5,376 KB
testcase_51 AC 411 ms
5,376 KB
testcase_52 AC 402 ms
5,376 KB
testcase_53 AC 411 ms
5,376 KB
testcase_54 AC 403 ms
5,376 KB
testcase_55 AC 407 ms
5,376 KB
testcase_56 AC 393 ms
5,376 KB
testcase_57 AC 396 ms
5,376 KB
testcase_58 AC 404 ms
5,376 KB
testcase_59 AC 382 ms
5,376 KB
testcase_60 AC 413 ms
5,376 KB
testcase_61 AC 2 ms
5,376 KB
testcase_62 AC 2 ms
5,376 KB
testcase_63 AC 408 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

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