結果

問題 No.358 も~っと!門松列
ユーザー cielciel
提出日時 2016-04-17 22:37:00
言語 Ruby
(3.3.0)
結果
AC  
実行時間 701 ms / 1,000 ms
コード長 322 bytes
コンパイル時間 134 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,544 KB
最終ジャッジ日時 2024-04-15 02:19:44
合計ジャッジ時間 17,353 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 698 ms
12,416 KB
testcase_01 AC 664 ms
12,288 KB
testcase_02 AC 691 ms
12,288 KB
testcase_03 AC 606 ms
12,416 KB
testcase_04 AC 690 ms
12,288 KB
testcase_05 AC 695 ms
12,416 KB
testcase_06 AC 610 ms
12,416 KB
testcase_07 AC 692 ms
12,416 KB
testcase_08 AC 688 ms
12,416 KB
testcase_09 AC 689 ms
12,416 KB
testcase_10 AC 602 ms
12,288 KB
testcase_11 AC 686 ms
12,416 KB
testcase_12 AC 690 ms
12,288 KB
testcase_13 AC 664 ms
12,416 KB
testcase_14 AC 688 ms
12,544 KB
testcase_15 AC 697 ms
12,416 KB
testcase_16 AC 669 ms
12,416 KB
testcase_17 AC 699 ms
12,416 KB
testcase_18 AC 701 ms
12,544 KB
testcase_19 AC 668 ms
12,288 KB
testcase_20 AC 698 ms
12,544 KB
testcase_21 AC 700 ms
12,544 KB
testcase_22 AC 687 ms
12,288 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#!/usr/bin/ruby
def isok(a)
	return false if a[0]==a[2]
	return (a[1]<a[0]&&a[1]<a[2]) || (a[1]>a[0]&&a[1]>a[2])
end

a=gets.split.map(&:to_i)
#if a[1]==1 && isok(a)
#	puts :INF
#else
	k=100000
	x=(1...k).count{|i|isok(a.map{|e|e%i})}
	y=(k..1000000).count{|i|isok(a.map{|e|e%i})}
	if y>0
		puts :INF
	else
		p x
	end
#end
0