結果

問題 No.152 貯金箱の消失
ユーザー cielciel
提出日時 2015-02-16 18:44:25
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 182 bytes
コンパイル時間 253 ms
コンパイル使用メモリ 11,480 KB
実行使用メモリ 19,656 KB
最終ジャッジ日時 2023-09-06 01:39:34
合計ジャッジ時間 7,918 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,160 KB
testcase_01 AC 384 ms
15,204 KB
testcase_02 AC 82 ms
15,152 KB
testcase_03 AC 248 ms
15,168 KB
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#!/usr/bin/ruby
require 'rational'
L=gets.to_i/4
r=0
(2..L).each{|m|
	(1-m%2).step(m-1,2){|n|
		next if m.gcd(n)>1
		a=m*m-n*n
		b=2*m*n
		c=m*m+n*n
		next if a+b+c>L
		r+=1
	}
}
p r
0