結果

問題 No.2007 Arbitrary Mod (Easy)
ユーザー kinugoshi8928
提出日時 2022-07-15 22:41:47
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 361 bytes
コンパイル時間 1,589 ms
コンパイル使用メモリ 166,532 KB
実行使用メモリ 6,940 KB
最終ジャッジ日時 2024-06-27 19:37:02
合計ジャッジ時間 4,289 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define ll long long
using namespace std;
#define all(v) v.begin(), v.end()

int main() {
    ll a,n;
    cin >> a >> n;
    ll ans = 1;
    n %= 10000019;
    for(int i=0;i<n;i++){
        ans *= a;
        ans %= 10000019;
    }
    if(a%(n+1))cout << 10000019 << endl << ans << endl;
    else cout << 10000019 << endl << 0 << endl;
}
0