結果
| 問題 |
No.1140 EXPotentiaLLL!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-08-01 09:17:35 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 432 bytes |
| コンパイル時間 | 599 ms |
| コンパイル使用メモリ | 66,116 KB |
| 最終ジャッジ日時 | 2025-01-12 12:21:38 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 6 WA * 3 TLE * 3 |
ソースコード
#include <iostream>
using lint = long long;
void solve() {
lint a;
int p;
std::cin >> a >> p;
for (int i = 2; i * i <= p; ++i) {
if (p % i != 0) continue;
std::cout << -1 << "\n";
return;
}
std::cout << (a % p != 0) << "\n";
}
int main() {
std::cin.tie(nullptr);
std::ios::sync_with_stdio(false);
int q;
std::cin >> q;
while (q--) solve();
return 0;
}