結果
問題 |
No.1800 Random XOR
|
ユーザー |
![]() |
提出日時 | 2022-07-08 22:24:06 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 447 bytes |
コンパイル時間 | 4,582 ms |
コンパイル使用メモリ | 242,796 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-28 06:36:57 |
合計ジャッジ時間 | 5,600 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 14 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define int long long long long modpow(long long a, long long n, long long mod) { long long res = 1; while (n > 0) { if (n & 1) res = res * a % mod; a = a * a % mod; n >>= 1; } return (res+1000000006)%mod; } const int mod = 1e9+7; signed main(){ int N,M; cin>>N>>M; int x = modpow(2,M,mod); if(x%2 == 0) cout<<x/2<<endl; else cout<<(x+mod)/2<<endl; }