結果

問題 No.265 数学のテスト
ユーザー cielciel
提出日時 2015-08-09 03:05:41
言語 Ruby
(3.3.0)
結果
RE  
実行時間 -
コード長 557 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 11,496 KB
実行使用メモリ 31,748 KB
最終ジャッジ日時 2023-09-25 07:26:41
合計ジャッジ時間 6,712 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 289 ms
31,748 KB
testcase_03 AC 181 ms
24,272 KB
testcase_04 AC 197 ms
24,800 KB
testcase_05 AC 222 ms
26,452 KB
testcase_06 AC 188 ms
24,224 KB
testcase_07 AC 209 ms
26,248 KB
testcase_08 AC 247 ms
28,804 KB
testcase_09 AC 186 ms
23,668 KB
testcase_10 AC 203 ms
24,224 KB
testcase_11 AC 213 ms
25,712 KB
testcase_12 AC 85 ms
15,296 KB
testcase_13 AC 104 ms
18,256 KB
testcase_14 AC 105 ms
17,348 KB
testcase_15 AC 82 ms
15,248 KB
testcase_16 AC 99 ms
16,808 KB
testcase_17 AC 82 ms
15,132 KB
testcase_18 AC 80 ms
15,144 KB
testcase_19 AC 82 ms
15,172 KB
testcase_20 AC 83 ms
15,308 KB
testcase_21 AC 81 ms
15,168 KB
testcase_22 AC 110 ms
17,416 KB
testcase_23 AC 80 ms
15,264 KB
testcase_24 AC 81 ms
15,168 KB
testcase_25 AC 139 ms
19,844 KB
testcase_26 AC 80 ms
15,120 KB
testcase_27 AC 82 ms
15,124 KB
testcase_28 AC 88 ms
15,924 KB
testcase_29 AC 82 ms
15,248 KB
testcase_30 AC 87 ms
15,692 KB
testcase_31 AC 81 ms
15,128 KB
testcase_32 AC 83 ms
15,268 KB
testcase_33 AC 81 ms
15,180 KB
testcase_34 AC 82 ms
15,176 KB
testcase_35 AC 81 ms
15,272 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#!/usr/bin/ruby
class Array
	def -@
		self.map(&:-@)
	end
	def +(other)
		m=[self.size,other.size].max
		m.times.map{|i|(self.size<=i ? 0 : self[i])+(other.size<=i ? 0 : other[i])}
	end
	def -(other)
		self+-other
	end
	def *(other)
		r=[]
		other.size.times{|i|
			r=r+i.times.map{0}.concat(self.map{|e|other[i]*e})
		}
		r
	end
end
def d(a)
	a.size<=1 ? [0] : 1.step(a.size-1).map{|i|i*a[i]}
end

gets
D=gets.to_i
S=gets.chomp.gsub(/(\d+)/,'[\1]').gsub('x','[0,1]').gsub('d{','d(').gsub('}',')')
A=eval S
puts A.concat((D+1-A.size).times.map{0}).join(' ')
0