結果

問題 No.152 貯金箱の消失
ユーザー cielciel
提出日時 2015-02-16 18:52:44
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,535 ms / 5,000 ms
コード長 120 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 11,460 KB
実行使用メモリ 15,416 KB
最終ジャッジ日時 2023-09-06 01:40:31
合計ジャッジ時間 6,878 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,116 KB
testcase_01 AC 85 ms
15,164 KB
testcase_02 AC 85 ms
15,112 KB
testcase_03 AC 86 ms
15,012 KB
testcase_04 AC 102 ms
15,244 KB
testcase_05 AC 103 ms
15,376 KB
testcase_06 AC 118 ms
15,136 KB
testcase_07 AC 312 ms
15,392 KB
testcase_08 AC 1,514 ms
15,416 KB
testcase_09 AC 1,535 ms
15,328 KB
testcase_10 AC 1,206 ms
15,148 KB
testcase_11 AC 713 ms
15,244 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
		break if 2*m*m+2*m*n>L
		r+=1
	}
}
p r
0