結果
| 問題 |
No.1305 Speak of the Devil
|
| コンテスト | |
| ユーザー |
ocvret_
|
| 提出日時 | 2020-12-14 19:29:30 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 541 bytes |
| コンパイル時間 | 1,586 ms |
| コンパイル使用メモリ | 166,024 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-20 00:52:50 |
| 合計ジャッジ時間 | 7,373 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 11 WA * 12 |
ソースコード
#include<bits/stdc++.h>
// #include<atcoder/all>
using namespace std;
// using namespace atcoder;
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
#define rep(i,n) for(ll i = 0;i < (ll)n;i++)
#define ALL(x) (x).begin(),(x).end()
#define MOD 1000000007
int main(){
cout << fixed << setprecision(20);
ll p,q;
cin >> p >> q;
long double res = 0;
long double k = 1;
rep(i,1000000){
k /= p;
res += (i+1)*k;
k *= (p-1);
}
cout << min(res,(long double)(q)) << "\n";
return 0;
}
ocvret_