結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 412 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 328 ms
4,376 KB
testcase_10 AC 377 ms
4,376 KB
testcase_11 AC 381 ms
4,380 KB
testcase_12 AC 110 ms
4,376 KB
testcase_13 AC 322 ms
4,380 KB
testcase_14 AC 186 ms
4,380 KB
testcase_15 AC 237 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,376 KB
testcase_19 AC 415 ms
4,380 KB
testcase_20 AC 415 ms
4,376 KB
testcase_21 AC 416 ms
4,376 KB
testcase_22 AC 415 ms
4,376 KB
testcase_23 AC 418 ms
4,380 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;
	}
	cout<<ans.val()<<endl;
}
0