結果

問題 No.3156 Count That Day's N
ユーザー tatesoto
提出日時 2025-05-04 02:43:47
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 1,002 bytes
コンパイル時間 3,462 ms
コンパイル使用メモリ 280,896 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-05-23 18:30:31
合計ジャッジ時間 4,195 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 25 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define out(x) cout<<x<<'\n'
#define all(v) v.begin(),v.end()
#define rep(i,n) for(int i=0;i<(ll)(n);i++)
template<class T> inline bool chmin(T& a, T b) {if(a > b){a = b; return true;} else {return false;}};
template<class T> inline bool chmax(T& a, T b) {if(a < b){a = b; return true;} else {return false;}};
const ll INF=(1LL<<60);
const ll mod=998244353;
using Graph = vector<vector<ll>>;
using Network = vector<vector<pair<ll,ll>>>;
using Grid = vector<string>;
const vector<ll> dx = {0, 1, 0, -1};
const vector<ll> dy = {1, 0, -1, 0};

int main() {
    ll K, N;cin>>K>>N;
    set<ll> st;
    for(ll x = 1; x*x*x*x*x*x <= N; x++) {
        for(ll y = 1; y*y*y*y <= N; y++) {
            ll n = x*x*x*x*x*x + y*y*y*y;
            if(n % K != 0) continue;
            n = n / K;
            ll z = sqrt((ld)n);
            if(z*z != n) continue;
            st.insert(n);
        }
    }
    out(st.size());
}
0