結果

問題 No.1140 EXPotentiaLLL!
ユーザー yuji9511yuji9511
提出日時 2020-07-31 22:08:08
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 1,579 bytes
コンパイル時間 2,094 ms
コンパイル使用メモリ 209,152 KB
実行使用メモリ 23,320 KB
最終ジャッジ日時 2023-09-20 23:34:50
合計ジャッジ時間 5,894 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 419 ms
22,196 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 AC 156 ms
21,904 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);
    }
}
ll power(ll x, ll n, ll M){
    if(n == 0) return 1LL;
    ll res = power(x * x % M, n/2, M);
    if(n % 2 == 1) res = res * x % M;
    return res;
}
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{
            exit(1);
            // ll ans = 1;
            // rep(i,1,P+1){
            //     ans *= i;
            //     ans %= P-1;
            // }
            // ans = power(A, ans, P);

            // print(ans);
        }
    }


}

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