結果
問題 | No.8045 怪文書 |
ユーザー |
|
提出日時 | 2021-03-26 20:43:01 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 287 bytes |
コンパイル時間 | 1,508 ms |
コンパイル使用メモリ | 165,672 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-28 20:33:30 |
合計ジャッジ時間 | 2,243 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 18 WA * 2 |
ソースコード
#include <bits/stdc++.h> using namespace std; long factorial(long n){ if (n<=1) return 1; return n*factorial(n-1); } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); long n,m; cin>>n>>m; if(n>=m) cout<<"0\n"; else cout<<(factorial(n))%m<<"\n"; }