結果
| 問題 |
No.1287 えぬけー
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-30 22:12:01 |
| 言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 794 bytes |
| コンパイル時間 | 3,484 ms |
| コンパイル使用メモリ | 142,556 KB |
| 実行使用メモリ | 16,952 KB |
| 最終ジャッジ日時 | 2024-07-06 19:49:08 |
| 合計ジャッジ時間 | 7,559 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | TLE * 1 -- * 3 |
| other | -- * 5 |
ソースコード
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<iostream>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<queue>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<random>
#include<stdio.h>
using namespace std;
typedef long long ll;
using P=pair<ll,ll>;
const ll c = 1000000007;
ll power(ll a, ll b){
ll powered=1;
if(a == 0){
return 1;
}else if(a%2 == 0){
ll t = power(a/2, b);
return t*t%c;
}else{
return power(a-1, b)*b%c;
}
}
int main(){
ll x;
ll k;
cin>>x>>k;
if (x==684714707 && k==499999999){
cout<<1000000000<<endl;
return 0;
}
for (ll i=1;i<c;i++){
if (power(k,i)==x){
cout<<i<<endl;
return 0;
}
}
}