結果
問題 | No.2007 Arbitrary Mod (Easy) |
ユーザー | Ststone |
提出日時 | 2022-07-21 17:04:04 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 903 bytes |
コンパイル時間 | 11,371 ms |
コンパイル使用メモリ | 277,648 KB |
最終ジャッジ日時 | 2025-01-30 11:24:21 |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
#pragma GCC optimize("Ofast") #pragma GCC optimize(2) #pragma GCC target("popcnt") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef string str; typedef pair<ll,ll> pii; #define F first #define S second #define pb push_back #define all(x) (x).begin(),(x).end() #define de_bug(x) cout << (x) << '\n' #define loli(x) cout << (x) << ' ' #define yn(x) cout << (x==1?"Yes\n":"No\n") #define PI 3.14159265358979323 #define Ststone ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0) const ll max_n=2e5+10,mod=10000000; ll t,k,n,m,h,q,a,b; vector<ll> v; str s; char c; template <typename T> T modpow(T a, T b) { a %= mod; T c = 1; while (b > 0) { if (b & 1) c = (c * a) % mod; a = (a * a) % mod; b >>= 1; } return c; } int main(){ Ststone; cin >> a >> n; m = 10000000; cout << m << '\n'; cout << modpow(a,n) << '\n'; } /* 49 64 8 4 17 17 */