結果
| 問題 |
No.3156 Count That Day's N
|
| コンテスト | |
| ユーザー |
ゼリトキ
|
| 提出日時 | 2025-05-23 19:16:30 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 808 bytes |
| コンパイル時間 | 3,246 ms |
| コンパイル使用メモリ | 272,432 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-05-23 19:16:41 |
| 合計ジャッジ時間 | 5,349 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 25 WA * 7 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define ll long long
const long long mod=998244353;
const long long hmod=46216567629137;
ll SQRT(ll a){
ll l=0,r=2e9;
while(l!=r){
ll m=(l+r)/2;
if(m*m<a) l=m+1;
else r=m;
}
return l;
}
int main(){
cin.tie(0)->sync_with_stdio(0);
cout.tie(0);
ll K,N;
cin>>K>>N;
int ans=0;
for(ll x=1;x<=1000;x++){
for(ll y=1;y<=10000;y++){
ll cnt=x*x*x*x*x*x+y*y*y*y;
if(cnt<=N){
if(cnt%K==0){
cnt/=K;
ll b=SQRT(cnt);
if(cnt==b*b){
ans++;
}
}
}
}
}
cout<<ans<<"\n";
}
ゼリトキ