結果

問題 No.1552 Simple Dice Game
ユーザー kotatsugamekotatsugame
提出日時 2021-06-18 22:43:50
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 420 ms / 2,500 ms
コード長 316 bytes
コンパイル時間 740 ms
コンパイル使用メモリ 68,448 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-04 23:52:05
合計ジャッジ時間 6,692 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 411 ms
4,384 KB
testcase_04 AC 1 ms
4,384 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 326 ms
4,380 KB
testcase_10 AC 378 ms
4,376 KB
testcase_11 AC 382 ms
4,376 KB
testcase_12 AC 110 ms
4,376 KB
testcase_13 AC 323 ms
4,376 KB
testcase_14 AC 186 ms
4,376 KB
testcase_15 AC 236 ms
4,376 KB
testcase_16 AC 34 ms
4,376 KB
testcase_17 AC 54 ms
4,376 KB
testcase_18 AC 292 ms
4,380 KB
testcase_19 AC 416 ms
4,376 KB
testcase_20 AC 417 ms
4,380 KB
testcase_21 AC 420 ms
4,376 KB
testcase_22 AC 417 ms
4,384 KB
testcase_23 AC 419 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:7:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    7 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<atcoder/modint>
using namespace std;
using mint=atcoder::modint998244353;
long N;
int M;
main()
{
	cin>>N>>M;
	mint ans=0;
	for(int i=1;i<=M;i++)
	{
		ans+=(i<M?-1:M)*mint(i).pow(N)*N*(i+1)/2;
		ans-=mint(M-i+1).pow(N)*N*(M+i)/2;
	}
	for(int i=1;i<=M;i++)
	{
	}
	cout<<ans.val()<<endl;
}
0