結果
| 問題 | No.8045 怪文書 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-26 20:43:01 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 287 bytes |
| 記録 | |
| コンパイル時間 | 1,190 ms |
| コンパイル使用メモリ | 178,232 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-22 18:53:54 |
| 合計ジャッジ時間 | 2,249 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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";
}