結果
| 問題 |
No.1232 2^x = x
|
| コンテスト | |
| ユーザー |
iqueue02
|
| 提出日時 | 2020-09-18 23:22:19 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 515 bytes |
| コンパイル時間 | 1,916 ms |
| コンパイル使用メモリ | 193,096 KB |
| 最終ジャッジ日時 | 2025-01-14 18:00:40 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 1 TLE * 2 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
void solve (int p) {
int cur = 2 % p;
int cnt = 1;
int res = -1;
while (res == -1) {
if (cur == cnt % p) res = cnt;
cur *= 2;
cur %= p;
cnt++;
}
//cout << "ans ";
cout << res << endl;
}
int main() {
int n;
cin >> n;
while (n--) {
int p;
cin >> p;
solve(p);
}
return 0;
}
iqueue02