본문 바로가기
python-algorithm

[백준] 15818

by 무적김두칠 2021. 1. 4.

1
2
3
4
5
6
7
8
9
import sys
a,b=map(int,sys.stdin.readline().split())
tmp=list(map(int,sys.stdin.readline().split()))
for i in range(a):
    tmp[i]%=b
cnt=tmp[0]
for i in range(1,a):
    cnt*=tmp[i]
print(cnt%b)
cs
반응형

'python-algorithm' 카테고리의 다른 글

[백준] 15917  (0) 2021.01.04
[백준] 15820  (0) 2021.01.04
[백준] 15784  (0) 2021.01.04
[백준] 15781  (0) 2021.01.04
[백준] 15780  (0) 2021.01.04

댓글