結果

問題 No.3079 Unite Japanese Prefectures
ユーザー lam6er
提出日時 2025-04-15 21:48:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 644 bytes
コンパイル時間 193 ms
コンパイル使用メモリ 81,760 KB
実行使用メモリ 60,940 KB
最終ジャッジ日時 2025-04-15 21:49:32
合計ジャッジ時間 1,988 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

def main():
    input = sys.stdin.read().split()
    if not input:
        return
    T = int(input[0])
    if T == 0:
        return
    cases = list(map(int, input[1:T+1]))
    max_n = max(cases) if cases else 0
    max_n = max(max_n, 1)  # Ensure at least 1 to handle cases where all N are 0 (though per problem constraints, N >=1)
    
    divisors = [0] * (max_n + 1)
    for i in range(1, max_n + 1):
        for j in range(i, max_n + 1, i):
            divisors[j] += 1
    
    results = []
    for n in cases:
        results.append(str(divisors[n] - 1))
    print('\n'.join(results))

if __name__ == '__main__':
    main()
0