結果
問題 | No.1330 Multiply or Divide |
ユーザー |
![]() |
提出日時 | 2021-01-08 22:05:42 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 319 bytes |
コンパイル時間 | 537 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 26,240 KB |
最終ジャッジ日時 | 2024-11-16 12:11:12 |
合計ジャッジ時間 | 8,431 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 39 WA * 7 |
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n Main.rb:8: warning: assigned but unused variable - l Main.rb:11: warning: assigned but unused variable - ans Syntax OK
ソースコード
n,m,q=gets.split.map(&:to_i)m+=1a=gets.split.map(&:to_i)if a.max>=mputs 1exitendl=[]mq=0nq=0ans=1/0.0a.each do |aa|if aa%q==0mq=aa if mq<aaelsenq=aa if nq<aaendendc=0if mq>0&&mq>nqm=(m-1)/mq+1c=1endif m>1&&nq==0puts "-1"exitendx=1while x<mx*=nqc+=1endputs c