結果
問題 |
No.1250 汝は倍数なりや?
|
ユーザー |
![]() |
提出日時 | 2022-11-23 09:50:01 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 369 bytes |
コンパイル時間 | 296 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 41,688 KB |
最終ジャッジ日時 | 2024-09-24 15:54:53 |
合計ジャッジ時間 | 5,264 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 48 WA * 1 |
ソースコード
def main(): n, h = map(int, input().split()) arr = set(map(int, input().split())) if h == 1 or 0 in arr or h in arr: exit(print("YES")) cur = 1 for a in arr: if a < 0: a *= -1 cur = (cur * (a % h)) % h if cur == 0: print("YES") else: print("NO") if __name__ == "__main__": main()