結果

問題 No.1791 Repeat Multiplication
ユーザー ramdosramdos
提出日時 2021-11-27 23:54:01
言語 Ruby
(3.3.0)
結果
AC  
実行時間 2,743 ms / 3,000 ms
コード長 226 bytes
コンパイル時間 419 ms
コンパイル使用メモリ 11,284 KB
実行使用メモリ 27,120 KB
最終ジャッジ日時 2023-10-13 19:09:00
合計ジャッジ時間 54,033 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,168 KB
testcase_01 AC 80 ms
15,072 KB
testcase_02 AC 82 ms
15,240 KB
testcase_03 AC 79 ms
15,120 KB
testcase_04 AC 82 ms
15,036 KB
testcase_05 AC 80 ms
15,040 KB
testcase_06 AC 79 ms
15,248 KB
testcase_07 AC 81 ms
15,248 KB
testcase_08 AC 396 ms
15,984 KB
testcase_09 AC 359 ms
16,040 KB
testcase_10 AC 363 ms
16,020 KB
testcase_11 AC 331 ms
15,912 KB
testcase_12 AC 225 ms
15,628 KB
testcase_13 AC 2,344 ms
25,984 KB
testcase_14 AC 2,475 ms
26,336 KB
testcase_15 AC 1,709 ms
23,448 KB
testcase_16 AC 1,669 ms
23,256 KB
testcase_17 AC 2,520 ms
26,788 KB
testcase_18 AC 2,011 ms
24,628 KB
testcase_19 AC 2,269 ms
25,872 KB
testcase_20 AC 1,780 ms
23,648 KB
testcase_21 AC 2,359 ms
25,860 KB
testcase_22 AC 2,534 ms
26,876 KB
testcase_23 AC 1,857 ms
24,012 KB
testcase_24 AC 2,433 ms
26,240 KB
testcase_25 AC 2,361 ms
25,524 KB
testcase_26 AC 2,444 ms
26,476 KB
testcase_27 AC 2,031 ms
24,428 KB
testcase_28 AC 2,584 ms
26,880 KB
testcase_29 AC 2,533 ms
26,852 KB
testcase_30 AC 2,597 ms
26,880 KB
testcase_31 AC 79 ms
15,144 KB
testcase_32 AC 2,592 ms
27,120 KB
testcase_33 AC 2,610 ms
27,008 KB
testcase_34 AC 2,743 ms
26,860 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n, q=gets.to_s.split.map{ |e| e.to_i }
v=Array.new(n+1, 0)
v[1]=1
for i in 1..n+1
  c=i*2
  while c<=n
    v[c]+=v[i]
    c+=i
  end
end
q.times do
  t=gets.to_s.to_i
  f=0
  for j in 0..n/t
    f+=v[j]
  end
  puts v[t]*f
end
0