Submission #15605609


Source Code Expand

k = int(input())
i = 1
x = 7 % k
seen = {x}
while x != 0:
	x = (10 * x + 7) % k
	i += 1
	if x in seen:
		print(-1)
		break
	seen.add(x)
else:
	print(i)

Submission Info

Submission Time
Task C - Repsept
User Norrius
Language PyPy3 (7.3.0)
Score 300
Code Size 163 Byte
Status AC
Exec Time 211 ms
Memory 156328 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 27
Set Name Test Cases
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
Case Name Status Exec Time Memory
hand_01.txt AC 69 ms 61584 KiB
hand_02.txt AC 51 ms 61280 KiB
hand_03.txt AC 50 ms 61328 KiB
hand_04.txt AC 54 ms 61308 KiB
hand_05.txt AC 211 ms 156328 KiB
hand_06.txt AC 206 ms 156180 KiB
hand_07.txt AC 55 ms 61848 KiB
hand_08.txt AC 53 ms 61640 KiB
hand_09.txt AC 126 ms 145752 KiB
hand_10.txt AC 50 ms 61696 KiB
hand_11.txt AC 70 ms 78628 KiB
hand_12.txt AC 56 ms 61616 KiB
hand_13.txt AC 69 ms 78720 KiB
hand_14.txt AC 62 ms 63816 KiB
random_01.txt AC 76 ms 84380 KiB
random_02.txt AC 69 ms 72212 KiB
random_03.txt AC 57 ms 63748 KiB
random_04.txt AC 56 ms 63276 KiB
random_05.txt AC 59 ms 63616 KiB
random_06.txt AC 57 ms 64168 KiB
random_07.txt AC 61 ms 65240 KiB
random_08.txt AC 69 ms 80404 KiB
random_09.txt AC 97 ms 112812 KiB
random_10.txt AC 71 ms 84808 KiB
sample_01.txt AC 55 ms 61372 KiB
sample_02.txt AC 55 ms 61384 KiB
sample_03.txt AC 205 ms 156160 KiB