結果

問題 No.1287 えぬけー
ユーザー chineristACchineristAC
提出日時 2020-09-30 22:12:01
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 794 bytes
コンパイル時間 1,018 ms
コンパイル使用メモリ 106,968 KB
実行使用メモリ 12,060 KB
最終ジャッジ日時 2023-09-21 01:04:56
合計ジャッジ時間 7,554 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
    }
  }

}
0