結果

問題 No.2394 部分和乗総和
ユーザー tailstails
提出日時 2023-07-31 16:05:00
言語 cLay
(20240104-1)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 215 bytes
コンパイル時間 7,940 ms
コンパイル使用メモリ 221,220 KB
実行使用メモリ 12,596 KB
最終ジャッジ日時 2024-04-18 16:08:06
合計ジャッジ時間 8,434 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 8 ms
11,844 KB
testcase_01 AC 8 ms
11,716 KB
testcase_02 AC 9 ms
9,804 KB
testcase_03 AC 8 ms
11,848 KB
testcase_04 AC 9 ms
10,032 KB
testcase_05 AC 10 ms
9,796 KB
testcase_06 AC 8 ms
9,804 KB
testcase_07 AC 9 ms
10,716 KB
testcase_08 AC 7 ms
9,956 KB
testcase_09 AC 8 ms
12,452 KB
testcase_10 AC 8 ms
9,800 KB
testcase_11 AC 8 ms
9,800 KB
testcase_12 AC 8 ms
9,800 KB
testcase_13 AC 12 ms
11,848 KB
testcase_14 AC 19 ms
12,596 KB
testcase_15 AC 20 ms
10,308 KB
testcase_16 AC 23 ms
11,008 KB
testcase_17 AC 39 ms
11,112 KB
testcase_18 AC 38 ms
11,036 KB
testcase_19 AC 35 ms
11,976 KB
testcase_20 AC 26 ms
11,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ull c[32];
ll@n;
ull@m,@b,z=1;
m%=b;
c[0]=m;
rep(i,31){
	c[i+1]=c[i]*c[i]%b;
}
ull p=EulerPhi(b);
rep(n){
	ull@a;
	a=(a-1)%p+1;
	ull r=1;
	rep(i,32){
		if(a&1){
			r=r*c[i]%b;
		}
		a>>=1;
	}
	z=z*(r+1)%b;
}
wt(z);
0