Submission #17609588


Source Code Expand

Copy
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def main(N):
    for a in range(1, 100):
        for b in range(1, 100):
            x = 3**a + 5**b
            if x == N:
                print(a, b)
                return
    print(-1)

main(int(read()))

Submission Info

Submission Time
Task A - 106
User maspy
Language Python (3.8.2)
Score 300
Code Size 340 Byte
Status AC
Exec Time 32 ms
Memory 9172 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 22
Set Name Test Cases
Sample 00_sample_00, 00_sample_01, 00_sample_02
All 00_sample_00, 00_sample_01, 00_sample_02, 01_test_00, 01_test_01, 01_test_02, 01_test_03, 01_test_04, 01_test_05, 01_test_06, 01_test_07, 01_test_08, 01_test_09, 01_test_10, 01_test_11, 01_test_12, 01_test_13, 01_test_14, 01_test_15, 01_test_16, 01_test_17, 02_beet_killer
Case Name Status Exec Time Memory
00_sample_00 AC 18 ms 9120 KB
00_sample_01 AC 32 ms 8884 KB
00_sample_02 AC 20 ms 8880 KB
01_test_00 AC 23 ms 9112 KB
01_test_01 AC 21 ms 9172 KB
01_test_02 AC 24 ms 9116 KB
01_test_03 AC 18 ms 8988 KB
01_test_04 AC 21 ms 8880 KB
01_test_05 AC 24 ms 8888 KB
01_test_06 AC 18 ms 9112 KB
01_test_07 AC 23 ms 9044 KB
01_test_08 AC 22 ms 8996 KB
01_test_09 AC 20 ms 8888 KB
01_test_10 AC 30 ms 8888 KB
01_test_11 AC 24 ms 8992 KB
01_test_12 AC 28 ms 8988 KB
01_test_13 AC 24 ms 8992 KB
01_test_14 AC 29 ms 8996 KB
01_test_15 AC 30 ms 8876 KB
01_test_16 AC 28 ms 8968 KB
01_test_17 AC 31 ms 9112 KB
02_beet_killer AC 26 ms 9080 KB