結果

問題 No.885 アマリクエリ
ユーザー jensen
提出日時 2021-01-22 10:33:10
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 312 bytes
コンパイル時間 113 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 51,116 KB
最終ジャッジ日時 2024-12-26 05:08:41
合計ジャッジ時間 13,024 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17 TLE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=list(map(int,input().split()))
q=int(input())
x=list(map(int,input().split()))

x_max=10**9+1
cnt=0
for i in range(q):
    if(x[i]<x_max):
        cnt=0
        for j in range(n):
            a[j]%=x[i]
            cnt+=a[j]
            x_max=x[i]
        print(cnt)
    else:
        print(cnt)
0