結果

問題 No.3079 アルベド
ユーザー 👑 kakel-sankakel-san
提出日時 2024-01-26 17:24:06
言語 Ruby
(3.3.0)
結果
AC  
実行時間 265 ms / 2,000 ms
コード長 276 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 17,280 KB
最終ジャッジ日時 2024-01-26 17:24:10
合計ジャッジ時間 3,846 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 193 ms
17,280 KB
testcase_01 AC 265 ms
17,280 KB
testcase_02 AC 222 ms
17,280 KB
testcase_03 AC 198 ms
17,280 KB
testcase_04 AC 237 ms
17,280 KB
testcase_05 AC 235 ms
17,280 KB
testcase_06 AC 232 ms
17,280 KB
testcase_07 AC 165 ms
17,280 KB
testcase_08 AC 169 ms
17,280 KB
testcase_09 AC 213 ms
17,280 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

num = []
100001.times{ num.push 1 }
100001.times{|i|
  if i < 2
    num[i] = 0
  else
    j = i * 2
    while j < num.length
      num[j] = 0
      j += i
    end
  end
}
100000.times{|i|
  num[i + 1] += num[i]
}
t = readline.to_i
t.times{
  n = readline.to_i
  puts num[n]
}
0