結果
| 問題 |
No.2007 Arbitrary Mod (Easy)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-07-16 16:28:53 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 476 bytes |
| コンパイル時間 | 1,910 ms |
| コンパイル使用メモリ | 191,804 KB |
| 最終ジャッジ日時 | 2025-01-30 09:35:08 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
#define all(A) A.begin(),A.end()
#define rep(i, n) for (ll i = 0; i < (ll) (n); i++)
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
ll A,N,an=1;
cin>>A>>N;
rep(i,N){
an*=A;
if(1e7<=an&&an<=1e18){
cout<<an<<endl<<0<<endl;
return 0;
}
}
cout<<ll(1e18)<<endl<<an<<endl;
}