結果

問題 No.152 貯金箱の消失
ユーザー cielciel
提出日時 2015-02-16 18:51:30
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,616 ms / 5,000 ms
コード長 148 bytes
コンパイル時間 61 ms
コンパイル使用メモリ 11,580 KB
実行使用メモリ 15,384 KB
最終ジャッジ日時 2023-09-06 01:39:59
合計ジャッジ時間 7,092 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,284 KB
testcase_01 AC 83 ms
15,152 KB
testcase_02 AC 82 ms
15,104 KB
testcase_03 AC 83 ms
15,156 KB
testcase_04 AC 102 ms
15,176 KB
testcase_05 AC 103 ms
15,384 KB
testcase_06 AC 120 ms
15,136 KB
testcase_07 AC 322 ms
15,172 KB
testcase_08 AC 1,591 ms
15,296 KB
testcase_09 AC 1,616 ms
15,144 KB
testcase_10 AC 1,268 ms
15,228 KB
testcase_11 AC 749 ms
15,144 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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
		break if a+b+c>L
		r+=1
	}
}
p r
0