結果
問題 | No.8045 怪文書 |
ユーザー |
![]() |
提出日時 | 2019-04-01 21:48:31 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 366 bytes |
コンパイル時間 | 768 ms |
コンパイル使用メモリ | 104,916 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-13 04:41:56 |
合計ジャッジ時間 | 1,503 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 20 |
ソースコード
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric; void main() { auto nm = readln.split.to!(long[]); auto N = nm[0]; auto M = nm[1]; if (M <= N) { writeln(0); } else { long w = 1; foreach (x; 2..N+1) { w = (w * x) % M; } writeln(w); } }