結果
問題 | No.8045 怪文書 |
ユーザー |
![]() |
提出日時 | 2019-04-01 22:09:09 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 690 bytes |
コンパイル時間 | 485 ms |
コンパイル使用メモリ | 63,448 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-27 02:59:44 |
合計ジャッジ時間 | 1,121 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 20 |
ソースコード
#include<iostream> #include<cstdint> using namespace std; // 575 int main() { int N, M; cin >> N >> M; int64_t ans = 1; for (int i = 1;i <= min(N, M);++ i) { (ans *= i) %= M; } cout << ans; return 0; } /* 31536000のコメント解説欄 ここテンプレで用意してるから、A問題とかだとこの先空欄の危険あり また、コンテスト後に https://31536000.hatenablog.com/ で解説していると思うので、良かったら読んでねー YOU_ARE_GIVE_TWO_INTEGER_NANDM._YOU_TASK_IS_TO_FIND_THE_FACTORIAL_OF_N,_MODULO_M. You are give two integer N & M; You task is to find the factorial of N!, modulo M; はい、N!%Mですね……ん、マジか */