結果

問題 No.3046 yukicoderの過去問
ユーザー やむなくやむなく
提出日時 2019-04-01 21:59:36
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 422 bytes
コンパイル時間 1,359 ms
コンパイル使用メモリ 165,400 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-05 07:50:17
合計ジャッジ時間 1,817 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 1 ms
5,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define all(x) (x).begin(),(x).end()
#define SP <<" "<<
#define MOD 1000000007
#define IINF 1000000000
#define LINF 1000000000000000000

typedef long long LL;
typedef long double LD;

int main(){
  LL n,m;
  cin >> n >> m;
  if(n>=m){
    cout << "0" << endl;
    return 0;
  }
  LL ans=1;
  for(int i=1;i<=n;i++){
    ans=(ans*i)%m;
  }
  cout << ans << endl;
  return 0;
}
0