結果

問題 No.10 +か×か
ユーザー syarosyaro
提出日時 2016-01-17 01:48:25
言語 Ruby
(3.3.0)
結果
AC  
実行時間 842 ms / 5,000 ms
コード長 189 bytes
コンパイル時間 109 ms
コンパイル使用メモリ 11,296 KB
実行使用メモリ 53,852 KB
最終ジャッジ日時 2023-08-21 06:16:31
合計ジャッジ時間 4,742 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,108 KB
testcase_01 AC 82 ms
15,048 KB
testcase_02 AC 83 ms
15,176 KB
testcase_03 AC 842 ms
53,720 KB
testcase_04 AC 568 ms
40,668 KB
testcase_05 AC 78 ms
15,124 KB
testcase_06 AC 833 ms
53,852 KB
testcase_07 AC 565 ms
40,736 KB
testcase_08 AC 213 ms
22,660 KB
testcase_09 AC 330 ms
28,696 KB
testcase_10 AC 80 ms
15,348 KB
testcase_11 AC 78 ms
15,156 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n,t,*a=gets(p).split.map &:to_i
d=(0..n-=1).map{[]}
n.downto(d[n][t]=2){|i|1.upto(t){|j|d[i-1][j]=d[i][j+a[i]]||d[i][j*a[i]]}}
v,=a
1.upto(n){|i|putc (f=d[i][n=v+a[i]])??+:?*;v=f ?n:v*a[i]}
0