結果

問題 No.8045 怪文書
ユーザー silv723
提出日時 2022-04-10 03:26:16
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 257 bytes
コンパイル時間 1,933 ms
コンパイル使用メモリ 192,536 KB
最終ジャッジ日時 2025-01-28 17:05:40
ジャッジサーバーID
(参考情報)
judge4 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
const ll mod=998244353;
int main(){
  ll n,m;
  cin>>n>>m;
  ll ans=1;
  if(n>=m){
    cout<<0<<endl;
    return 0;
  }
  for(ll i=1;i<=n;i++){
    ans*=i;
    ans%=m;
  }
  cout<<ans<<endl;
}
0