結果
| 問題 |
No.3357 eの部分和 mod 素数
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-11-14 22:48:04 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2,415 ms / 10,000 ms |
| コード長 | 415 bytes |
| コンパイル時間 | 2,849 ms |
| コンパイル使用メモリ | 278,096 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2025-11-14 22:48:37 |
| 合計ジャッジ時間 | 31,945 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include<bits/stdc++.h>
#include<atcoder/modint>
#define int long long
#define double long double
using namespace std;
using mint=atcoder::modint;
const int inf=1e18;
signed main(){
int p;cin>>p;
atcoder::modint::set_mod(p);
mint cur=1;
int pw=1;
mint ans=0;
for(int i=0;i<p;i++){
pw*=-1;
ans+=cur*pw;
cur*=i+1;
}
// ans+=cur*pw;
cout<<ans.val()<<endl;
}