結果
問題 | No.1250 汝は倍数なりや? |
ユーザー |
![]() |
提出日時 | 2020-10-09 23:04:50 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 123 ms / 1,000 ms |
コード長 | 589 bytes |
コンパイル時間 | 13,391 ms |
コンパイル使用メモリ | 225,424 KB |
実行使用メモリ | 7,840 KB |
最終ジャッジ日時 | 2024-07-20 13:53:38 |
合計ジャッジ時間 | 16,357 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 49 |
ソースコード
package main import ( "bufio" "fmt" "os" ) func main() { N, H := ReadInt(), ReadInt() A := ReadInt() A %= H for i := 1; i < N; i++ { v := ReadInt() A *= v A %= H } if A == 0 { fmt.Println("YES") } else { fmt.Println("NO") } } var reader = bufio.NewReader(os.Stdin) func Scan(a ...interface{}) { if _, err := fmt.Fscan(reader, a...); err != nil { panic(err) } } func ReadInt() (i int) { Scan(&i); return } func ReadString() (s string) { Scan(&s); return } func ReadInts(n int) (a []int) { for i := 0; i < n; i++ { a = append(a, ReadInt()) } return }