結果

問題 No.1824 門\松\列
ユーザー maimai
提出日時 2021-11-01 23:27:14
言語 Ruby
(3.3.0)
結果
AC  
実行時間 271 ms / 2,000 ms
コード長 120 bytes
コンパイル時間 45 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 21,504 KB
最終ジャッジ日時 2024-04-19 00:38:15
合計ジャッジ時間 1,945 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 230 ms
19,968 KB
testcase_01 AC 224 ms
20,096 KB
testcase_02 AC 232 ms
19,968 KB
testcase_03 AC 271 ms
21,504 KB
testcase_04 AC 228 ms
20,352 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

h=1000000
mem=[0]*(h)
(2...h).reduce(0){|t, i| mem[i] = t + i * i - i}


gets.to_i.times do
    p mem[gets.to_i-1]*2
end
0