結果
問題 | No.2176 LRM Question 1 |
ユーザー |
![]() |
提出日時 | 2023-01-06 21:26:47 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 39 ms / 2,000 ms |
コード長 | 542 bytes |
コンパイル時間 | 4,138 ms |
コンパイル使用メモリ | 250,932 KB |
最終ジャッジ日時 | 2025-02-09 23:37:28 |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
#include <stdio.h> #include <bits/stdc++.h> #include <atcoder/all> using namespace atcoder; using mint = modint; using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 2000000000000000005 int main(){ long long L,R,M; cin>>L>>R>>M; mint::set_mod(M); mint cur = 1; mint ans = 0; mint mul = 1; long long cc = L; for(int i=1;i<=M;i++){ cur *= i; mul *= cur; if(L<=i && i<=R){ ans += mul; cc++; if(cc>R)break; } } cout<<(ans).val()<<endl; return 0; }