結果
問題 | No.1552 Simple Dice Game |
ユーザー |
|
提出日時 | 2021-06-18 22:43:50 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 380 ms / 2,500 ms |
コード長 | 316 bytes |
コンパイル時間 | 484 ms |
コンパイル使用メモリ | 67,940 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-22 21:05:54 |
合計ジャッジ時間 | 5,456 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; } for(int i=1;i<=M;i++) { } cout<<ans.val()<<endl; }