結果

問題 No.2260 Adic Sum
ユーザー kotenkoten
提出日時 2023-04-15 23:05:35
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 911 bytes
コンパイル時間 406 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 22,476 KB
最終ジャッジ日時 2024-04-19 15:10:30
合計ジャッジ時間 6,329 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
18,208 KB
testcase_01 AC 28 ms
11,136 KB
testcase_02 AC 30 ms
11,008 KB
testcase_03 AC 30 ms
11,136 KB
testcase_04 AC 28 ms
11,136 KB
testcase_05 AC 29 ms
11,136 KB
testcase_06 AC 28 ms
11,136 KB
testcase_07 AC 28 ms
11,264 KB
testcase_08 AC 244 ms
11,392 KB
testcase_09 AC 64 ms
11,264 KB
testcase_10 AC 214 ms
11,136 KB
testcase_11 AC 31 ms
11,136 KB
testcase_12 AC 199 ms
11,392 KB
testcase_13 AC 689 ms
11,392 KB
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

# This is a sample Python script.
import random
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.


def input_wrapper():
#    return inputfile.readline().strip()
     return input()


def print_hi(name):
    line = input_wrapper().split(" ")
    N = int(line[0])
    P = int(line[1])

    line = input_wrapper().split(" ")
    A = []
    for elem in line:
        A.append(int(elem))

    ans = 0
    for i in range(N - 1):
        for j in range(i + 1, N):
            tester = abs(A[i] - A[j])
            while tester % P == 0:
                ans += 1
                tester = tester / P

    print(ans)

# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    print_hi('PyCharm')
#    make_charlie()
# See PyCharm help at https://www.jetbrains.com/help/pycharm/
0