結果
問題 |
No.1140 EXPotentiaLLL!
|
ユーザー |
![]() |
提出日時 | 2024-01-06 00:31:32 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 471 bytes |
コンパイル時間 | 2,251 ms |
コンパイル使用メモリ | 191,668 KB |
最終ジャッジ日時 | 2025-02-18 16:19:54 |
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 1 |
other | TLE * 1 -- * 11 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; vector<bool> prime; bool is_prime(ll N){ if (N == 0 || N == 1) return false; for (ll i=2; i*i<=N; i++){ if (N % i == 0) return false; } return true; } int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); ll T, A, N; cin >> T; while(T){ T--; cin >> A >> N; cout << (is_prime(N) ? 1 : -1) << '\n'; } return 0; }