結果

問題 No.1330 Multiply or Divide
ユーザー aqua_tenhouaqua_tenhou
提出日時 2021-01-08 22:03:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 294 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 33,000 KB
最終ジャッジ日時 2024-04-28 03:04:46
合計ジャッジ時間 6,610 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 204 ms
29,412 KB
testcase_02 AC 30 ms
10,624 KB
testcase_03 WA -
testcase_04 AC 30 ms
10,752 KB
testcase_05 AC 30 ms
10,752 KB
testcase_06 AC 155 ms
14,476 KB
testcase_07 WA -
testcase_08 AC 188 ms
32,872 KB
testcase_09 WA -
testcase_10 AC 188 ms
32,736 KB
testcase_11 AC 189 ms
32,384 KB
testcase_12 AC 190 ms
32,704 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 29 ms
10,624 KB
testcase_17 WA -
testcase_18 AC 196 ms
32,376 KB
testcase_19 AC 220 ms
32,868 KB
testcase_20 AC 192 ms
33,000 KB
testcase_21 AC 194 ms
32,620 KB
testcase_22 AC 198 ms
32,640 KB
testcase_23 AC 193 ms
32,668 KB
testcase_24 AC 30 ms
10,752 KB
testcase_25 AC 30 ms
10,752 KB
testcase_26 AC 29 ms
10,624 KB
testcase_27 AC 30 ms
10,624 KB
testcase_28 AC 30 ms
10,752 KB
testcase_29 AC 30 ms
10,752 KB
testcase_30 AC 29 ms
10,624 KB
testcase_31 AC 29 ms
10,752 KB
testcase_32 AC 30 ms
10,752 KB
testcase_33 AC 30 ms
10,752 KB
testcase_34 AC 152 ms
26,868 KB
testcase_35 AC 65 ms
15,020 KB
testcase_36 AC 143 ms
25,380 KB
testcase_37 AC 124 ms
23,844 KB
testcase_38 AC 89 ms
18,612 KB
testcase_39 AC 71 ms
16,056 KB
testcase_40 AC 80 ms
17,344 KB
testcase_41 AC 56 ms
13,824 KB
testcase_42 AC 123 ms
22,500 KB
testcase_43 AC 136 ms
24,720 KB
testcase_44 WA -
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,p = map(int,input().split())
a = list(map(int,input().split()))
m_a = max(a)

s = 1
for x in a:
    s = max(s, x%p)
if s == 1:
    if m_a > m:
        print(1)
    else:
        print(-1)
else:
    ans = 1
    x = 1
    while x*m_a <= m:
        x *= s
        ans += 1
    print(ans)
    
0