提出 #15651178


ソースコード 拡げる

K = gets.to_i
7 = [
	[],
	[7,6,5,4,3,2,1,0,9,8],
	[],
	[9,2,5,8,1,4,7,0,3,6],
	[],
	[],
	[],
	[1,8,5,2,9,6,3,0,7,4],
	[],
	[3,4,5,6,7,8,9,0,1,2]
][K%10]
if 7.empty?
	p(-1)
	exit
end

n = 0
k = K*7[0]
z = 0
while 0<k
	k += K*7[z] if 7 != z = k%10
	n += 1
	k /= 10
end
p n

提出情報

提出日時
問題 C - Repsept
ユーザ ds14050
言語 Ruby (2.7.1)
得点 300
コード長 306 Byte
結果 AC
実行時間 136 ms
メモリ 14428 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 3
AC × 27
セット名 テストケース
Sample sample_01.txt, sample_02.txt, sample_03.txt
All hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, hand_10.txt, hand_11.txt, hand_12.txt, hand_13.txt, hand_14.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, sample_01.txt, sample_02.txt, sample_03.txt
ケース名 結果 実行時間 メモリ
hand_01.txt AC 60 ms 14292 KiB
hand_02.txt AC 66 ms 14388 KiB
hand_03.txt AC 57 ms 14352 KiB
hand_04.txt AC 56 ms 14328 KiB
hand_05.txt AC 132 ms 14168 KiB
hand_06.txt AC 136 ms 14220 KiB
hand_07.txt AC 56 ms 14428 KiB
hand_08.txt AC 58 ms 14396 KiB
hand_09.txt AC 98 ms 14384 KiB
hand_10.txt AC 64 ms 14288 KiB
hand_11.txt AC 71 ms 14384 KiB
hand_12.txt AC 68 ms 14332 KiB
hand_13.txt AC 70 ms 14308 KiB
hand_14.txt AC 57 ms 14300 KiB
random_01.txt AC 60 ms 14324 KiB
random_02.txt AC 57 ms 14248 KiB
random_03.txt AC 57 ms 14328 KiB
random_04.txt AC 57 ms 14388 KiB
random_05.txt AC 65 ms 14304 KiB
random_06.txt AC 61 ms 14120 KiB
random_07.txt AC 59 ms 14392 KiB
random_08.txt AC 71 ms 14108 KiB
random_09.txt AC 84 ms 14256 KiB
random_10.txt AC 74 ms 14204 KiB
sample_01.txt AC 64 ms 14200 KiB
sample_02.txt AC 62 ms 14308 KiB
sample_03.txt AC 130 ms 14204 KiB