結果

問題 No.1343 Dividing Digit
ユーザー yuruhiyayuruhiya
提出日時 2021-01-16 15:10:43
言語 Ruby
(3.3.0)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 84 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 7,296 KB
実行使用メモリ 20,736 KB
最終ジャッジ日時 2024-05-05 17:49:37
合計ジャッジ時間 3,749 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
外部呼び出し有り
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
12,160 KB
testcase_01 AC 87 ms
12,288 KB
testcase_02 AC 77 ms
12,160 KB
testcase_03 AC 126 ms
19,968 KB
testcase_04 AC 87 ms
12,544 KB
testcase_05 AC 96 ms
14,080 KB
testcase_06 AC 88 ms
13,312 KB
testcase_07 AC 99 ms
14,848 KB
testcase_08 AC 119 ms
18,944 KB
testcase_09 AC 126 ms
19,584 KB
testcase_10 AC 86 ms
12,800 KB
testcase_11 AC 96 ms
14,720 KB
testcase_12 AC 117 ms
18,432 KB
testcase_13 AC 112 ms
17,792 KB
testcase_14 AC 87 ms
12,928 KB
testcase_15 AC 99 ms
14,592 KB
testcase_16 AC 87 ms
12,928 KB
testcase_17 AC 124 ms
19,712 KB
testcase_18 AC 132 ms
20,352 KB
testcase_19 AC 119 ms
18,048 KB
testcase_20 AC 105 ms
15,872 KB
testcase_21 AC 128 ms
19,072 KB
testcase_22 AC 121 ms
19,200 KB
testcase_23 AC 133 ms
20,352 KB
testcase_24 AC 126 ms
20,736 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

n,k,*a=`dd`.split.map &:to_i
m,x,y=a.sum,1,0
a.reverse.map{y=y+_1*x%m;x=x*k%m}
p y%m
0