結果

問題 No.3115 One Power One Kill
ユーザー haihamabossu
提出日時 2025-04-19 01:29:34
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 727 bytes
コンパイル時間 2,242 ms
コンパイル使用メモリ 195,240 KB
実行使用メモリ 25,996 KB
平均クエリ数 2.00
最終ジャッジ日時 2025-04-19 01:29:39
合計ジャッジ時間 4,647 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <atcoder/modint>
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using mint = atcoder::dynamic_modint<-1>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

void solve() {
  ll a = 100, b = 132;
  cout << a << ' ' << b << '\n';
  cout.flush();
  ll k;
  cin >> k;
  ll y = atcoder::modint1000000007(a).pow(b).val();
  mint::set_mod(b);
  for (ll x = 100; x <= 100000; x++) {
    ll g = __gcd(x, y);
    if (g == k) {
      cout << mint(x).pow(a).val() << '\n';
      cout.flush();
      ll ret;
      cin >> ret;
      return;
    }
  }
}

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  int T = 1;
  for (int t = 0; t < T; t++) {
    solve();
  }
  return 0;
}
0