結果
| 問題 |
No.3156 Count That Day's N
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-05-04 03:37:04 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 998 bytes |
| コンパイル時間 | 3,484 ms |
| コンパイル使用メモリ | 279,264 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-05-23 18:30:36 |
| 合計ジャッジ時間 | 4,742 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 25 WA * 7 |
ソースコード
#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(n);
if(z*z != n) continue;
st.insert(n);
}
}
out(st.size());
}