結果

問題 No.976 2 の 128 乗と M
ユーザー vectorcc
提出日時 2020-02-05 11:01:39
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 533 bytes
コンパイル時間 740 ms
コンパイル使用メモリ 72,032 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-22 06:32:19
合計ジャッジ時間 2,112 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<cmath>

#define REP(i,N) for(int i=0,__i=N;i<__i;++i)
#define REP2(i,j,N) for(int i=j,__i=N;i<__i;++i)

#define Q 1000000007
typedef unsigned long long ll;

ll M;

bool input(){
	using namespace std;
	cin>>M;
	if(M<1||M>pow(2,60))
		return false;
	return true;
}

ll solve(){
	using namespace std;
	ll res=1;
	REP(i,128){
		res=(res*2)%M;
	}
	return res;
}

int main(){
	using namespace std;
	if(!input())
		return -1;
	ll n=solve();
	cout<<n<<endl;
}
0