結果
| 問題 |
No.1552 Simple Dice Game
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-06-18 22:44:09 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 369 ms / 2,500 ms |
| コード長 | 287 bytes |
| コンパイル時間 | 494 ms |
| コンパイル使用メモリ | 67,880 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-22 21:06:01 |
| 合計ジャッジ時間 | 5,443 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
7 | main()
| ^~~~
ソースコード
#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;
}