結果
問題 |
No.1232 2^x = x
|
ユーザー |
|
提出日時 | 2020-09-18 21:56:56 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 454 bytes |
コンパイル時間 | 2,019 ms |
コンパイル使用メモリ | 193,504 KB |
最終ジャッジ日時 | 2025-01-14 17:07:04 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | WA * 3 |
ソースコード
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; void solve() { ll p; cin >> p; ll temp = 1; rep(i, 60) { temp *= 2; temp %= p; if (temp == (i + 1) % p) { cout << i + 1 << "\n"; return; } } cout << -1 << endl; } int main() { ll N; cin >> N; rep(i, N) { solve(); } return 0; }