結果
問題 |
No.1644 Eight Digits
|
ユーザー |
![]() |
提出日時 | 2021-08-16 03:12:41 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 146 ms / 1,000 ms |
コード長 | 198 bytes |
コンパイル時間 | 336 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-10-08 18:17:08 |
合計ジャッジ時間 | 5,763 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 |
コンパイルメッセージ
Syntax OK
ソースコード
K = gets.to_i ans = 0 [1, 2, 3, 4, 5, 6, 7, 8].permutation(8) do |nums| x = 0 base = 1 nums.each do |n| x += n * base x %= K base *= 10 end ans += 1 if x == 0 end puts ans