結果
問題 | No.644 G L C C D M |
ユーザー | ciel |
提出日時 | 2018-02-03 12:55:05 |
言語 | Ruby (3.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 220 bytes |
コンパイル時間 | 69 ms |
コンパイル使用メモリ | 11,248 KB |
実行使用メモリ | 15,564 KB |
最終ジャッジ日時 | 2023-09-02 08:25:15 |
合計ジャッジ時間 | 3,849 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | RE | - |
testcase_01 | RE | - |
testcase_02 | AC | 83 ms
15,068 KB |
testcase_03 | RE | - |
testcase_04 | AC | 82 ms
15,112 KB |
testcase_05 | RE | - |
testcase_06 | RE | - |
testcase_07 | RE | - |
testcase_08 | RE | - |
testcase_09 | RE | - |
testcase_10 | AC | 83 ms
15,084 KB |
testcase_11 | RE | - |
testcase_12 | RE | - |
testcase_13 | RE | - |
testcase_14 | RE | - |
testcase_15 | AC | 83 ms
15,140 KB |
testcase_16 | AC | 83 ms
15,128 KB |
testcase_17 | AC | 83 ms
15,036 KB |
testcase_18 | AC | 89 ms
15,060 KB |
testcase_19 | AC | 82 ms
15,060 KB |
testcase_20 | AC | 83 ms
15,060 KB |
testcase_21 | AC | 84 ms
15,092 KB |
testcase_22 | RE | - |
testcase_23 | RE | - |
testcase_24 | RE | - |
testcase_25 | RE | - |
testcase_26 | RE | - |
コンパイルメッセージ
Syntax OK
ソースコード
M=1000000007 def fact(n) r=1 (2..n).each{|i|r=r*i%M} r end def totient(n) n.prime_division.reduce(1){|s,e|s*(e[0]-1)*e[0]**(e[1]-1)} end n,m=gets.split.map &:to_i p 2*fact(n-2)*(2..n/m).reduce(0){|s,i|s+totient(i)}%M