結果

問題 No.1567 Integer Coefficient Equation
ユーザー chocoruskchocorusk
提出日時 2021-08-11 19:32:07
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 319 ms / 2,000 ms
コード長 1,267 bytes
コンパイル時間 4,464 ms
コンパイル使用メモリ 189,400 KB
実行使用メモリ 7,544 KB
最終ジャッジ日時 2023-10-25 21:18:47
合計ジャッジ時間 16,878 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
7,544 KB
testcase_01 AC 75 ms
7,544 KB
testcase_02 AC 260 ms
7,544 KB
testcase_03 AC 258 ms
7,544 KB
testcase_04 AC 260 ms
7,544 KB
testcase_05 AC 259 ms
7,544 KB
testcase_06 AC 258 ms
7,544 KB
testcase_07 AC 76 ms
7,544 KB
testcase_08 AC 74 ms
7,544 KB
testcase_09 AC 76 ms
7,544 KB
testcase_10 AC 74 ms
7,544 KB
testcase_11 AC 75 ms
7,544 KB
testcase_12 AC 73 ms
7,544 KB
testcase_13 AC 74 ms
7,544 KB
testcase_14 AC 75 ms
7,544 KB
testcase_15 AC 74 ms
7,544 KB
testcase_16 AC 75 ms
7,544 KB
testcase_17 AC 312 ms
7,544 KB
testcase_18 AC 313 ms
7,544 KB
testcase_19 AC 309 ms
7,544 KB
testcase_20 AC 309 ms
7,544 KB
testcase_21 AC 310 ms
7,544 KB
testcase_22 AC 312 ms
7,544 KB
testcase_23 AC 309 ms
7,544 KB
testcase_24 AC 310 ms
7,544 KB
testcase_25 AC 314 ms
7,544 KB
testcase_26 AC 307 ms
7,544 KB
testcase_27 AC 313 ms
7,544 KB
testcase_28 AC 311 ms
7,544 KB
testcase_29 AC 311 ms
7,544 KB
testcase_30 AC 311 ms
7,544 KB
testcase_31 AC 313 ms
7,544 KB
testcase_32 AC 312 ms
7,544 KB
testcase_33 AC 311 ms
7,544 KB
testcase_34 AC 313 ms
7,544 KB
testcase_35 AC 310 ms
7,544 KB
testcase_36 AC 313 ms
7,544 KB
testcase_37 AC 316 ms
7,544 KB
testcase_38 AC 319 ms
7,544 KB
testcase_39 AC 303 ms
7,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#include <list>
#include <atcoder/all>
#define popcount __builtin_popcount
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef pair<int, int> P;
bool ok[800080];
int s[800080];
const int n=400001;
int main()
{
  for(int a=1; a<=n; a++){
    for(int b=1; b<=a && a*b<=n; b++){
      for(int c=1; c<=b && a*b*c<=n; c++){
        for(int d=1; d<=c && a*b*c*d<=n; d++){
          for(int e=1; e<=d && a*b*c*d*e<=n; e++){
            if(a==b && b==c) continue;
            if(b==c && c==d) continue;
            if(c==d && d==e) continue;
            ok[n+a*b*c*d*e]=1;
            ok[n-a*b*c*d*e]=1;
          }
        }
      }
    }
  }
  ok[n]=1;
  for(int i=0; i<=2*n; i++) s[i+1]=s[i]+ok[i];
  int t; cin>>t;
  while(t--){
    int p, l, r; cin>>p>>l>>r;
    cout<<s[r-p+n+1]-s[l-p+n]<<endl;
  }
    return 0;
}
0