結果
問題 |
No.2007 Arbitrary Mod (Easy)
|
ユーザー |
|
提出日時 | 2022-08-17 22:44:42 |
言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 962 bytes |
コンパイル時間 | 1,574 ms |
コンパイル使用メモリ | 142,240 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-05 04:44:06 |
合計ジャッジ時間 | 3,736 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <iomanip> #include <utility> #include <tuple> #include <cmath> #include <cstdint> #include <cstdio> #include <map> #include <queue> #include <set> #include <stack> #include <deque> #include <unordered_map> #include <unordered_set> #include <bitset> #include <cctype> #include <cassert> #include <functional> #include <numeric> #include <type_traits> using namespace std; #define ll long long #define rep(i, n) for (int i = 0; i < (n); i++) #define coutf(f) cout << fixed << setprecision(f) #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() const int mod = 1000000007; ll pow(ll x, ll n) { ll ret = 1; while (n > 0) { if (n & 1) ret = ret * x % mod; x = x * x % mod; n >>= 1; } return ret; } int main() { ll a, n; cin >> a >> n; cout << mod << endl; cout << pow(a, n) << endl; return 0; }