結果

問題 No.2007 Arbitrary Mod (Easy)
ユーザー a
提出日時 2022-07-29 18:31:40
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 425 bytes
コンパイル時間 1,938 ms
コンパイル使用メモリ 192,900 KB
最終ジャッジ日時 2025-01-30 14:55:05
ジャッジサーバーID
(参考情報)
judge2 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    long long a, n;
    cin >> a >> n;
    long long p = 1;
    for (long long i = 0; i < n; i++) {
        p *= a;
        if (p >= 10000000LL) {
            cout << p << endl;
            cout << 0 << endl;
            return 0;
        }
    }
    cout << 10000000 << endl;
    cout << p << endl;
    return 0;
}
0