結果

問題 No.1250 汝は倍数なりや?
ユーザー mai
提出日時 2020-10-09 21:35:51
言語 Ruby
(3.4.1)
結果
RE  
実行時間 -
コード長 181 bytes
コンパイル時間 74 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 33,920 KB
最終ジャッジ日時 2024-07-20 09:44:34
合計ジャッジ時間 7,098 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29 RE * 1 TLE * 1 -- * 18
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:3: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

def lscan;gets.split.map(&:to_i);end
require 'prime'
n,h=lscan
v=h.prime_division.to_h
lscan.each{|a|a.prime_division.each{|q,c|v[q]-=c if v[q]}}
puts v.all?{|q,c|c<=0}? 'YES': 'NO'
0