結果

問題 No.1140 EXPotentiaLLL!
ユーザー yuji9511yuji9511
提出日時 2020-07-31 22:02:37
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,230 bytes
コンパイル時間 2,304 ms
コンパイル使用メモリ 209,144 KB
実行使用メモリ 42,808 KB
最終ジャッジ日時 2023-09-20 23:21:58
合計ジャッジ時間 10,398 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 425 ms
22,476 KB
testcase_01 AC 423 ms
22,224 KB
testcase_02 WA -
testcase_03 AC 758 ms
39,548 KB
testcase_04 AC 595 ms
35,012 KB
testcase_05 AC 877 ms
42,808 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 160 ms
22,136 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 161 ms
22,756 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘std::vector<long long int> sieve(ll)’ 内:
main.cpp:26:15: 警告: 左シフト回数 >= 型の幅となっています [-Wshift-count-overflow]
   26 |     rep(i,0,(1<<60)){
      |              ~^~~~
main.cpp:8:36: 備考: in definition of macro ‘rep’
    8 | #define rep(i,m,n) for(ll i=(m);i<(n);i++)
      |                                    ^

ソースコード

diff #

/*** author: yuji9511 ***/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using lpair = pair<ll, ll>;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i=(m);i<(n);i++)
#define rrep(i,m,n) for(ll i=(m);i>=(n);i--)
#define printa(x,n) for(ll i=0;i<n;i++){cout<<(x[i])<<" \n"[i==n-1];};
void print() {}
template <class H,class... T>
void print(H&& h, T&&... t){cout<<h<<" \n"[sizeof...(t)==0];print(forward<T>(t)...);}
vector<ll> sieve(ll n){ //エラトステネス
    vector<bool> is_prime(n+1);
    vector<ll> prime;
    rep(i,0,n+1) is_prime[i] = true;
    is_prime[0] = is_prime[1] = false;
    rep(i,2,n+1){
        if(is_prime[i]){
            prime.push_back(i);
            for(int j = 2 * i; j <= n; j += i) is_prime[j] = false;
        }
    }
    return prime;
    rep(i,0,(1<<60)){
        print(i);
    }
}
vector<ll> primes = sieve(5000000);

void solve(){
    map<int,bool> mp;
    for(auto &e: primes) mp[e] = true;
    ll T;
    cin >> T;
    while(T--){
        ll A,P;
        cin >> A >> P;
        if(not mp[P]){
            print(-1);
        }else{
            print(1);
        }
    }


}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
}
0