結果
| 問題 |
No.1232 2^x = x
|
| コンテスト | |
| ユーザー |
YamaKasa
|
| 提出日時 | 2020-09-18 22:38:52 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 617 bytes |
| コンパイル時間 | 2,125 ms |
| コンパイル使用メモリ | 166,324 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-22 10:05:47 |
| 合計ジャッジ時間 | 1,927 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 3 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int N;
cin >> N;
ll p[N];
for (int i = 0; i < N; i++) {
cin >> p[i];
}
ll v = 2;
ll t = pow(10, 18);
for (int i = 0; i < N; i++) {
v = 2;
bool flag = true;
for (int x = 1; x < 60; x++) {
if (x > t) break;
if ((v % p[i]) == (x % p[i])) {
flag = false;
cout << x << "\n";
break;
}
v *= 2;
}
if (flag) {
cout << "-1\n";
}
}
return 0;
}
YamaKasa