結果
| 問題 |
No.3156 Count That Day's N
|
| コンテスト | |
| ユーザー |
Ponzu
|
| 提出日時 | 2025-05-29 20:10:10 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 517 bytes |
| コンパイル時間 | 1,469 ms |
| コンパイル使用メモリ | 105,108 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-05-29 20:10:14 |
| 合計ジャッジ時間 | 3,438 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 25 WA * 7 |
ソースコード
#include<iostream>
#include<vector>
#include<math.h>
using namespace std;
long long fx(long long x){
return x * x * x * x * x * x;
}
long long fy(long long y){
return y * y * y * y;
}
int main(){
long long K,N;
cin>>K>>N;
int count = 0;
for(long long x=1;x<=1000;++x){
for(long long y=1;y<=10000;++y){
long long res = (fx(x) + fy(y));
if(N < res) continue;
if(res % K) continue;
res /= K;
long long sq = sqrtl(res);
if(sq*sq == res ){
count++;
}
}
}
cout << count << endl;
}
Ponzu