結果
| 問題 | No.796 well known |
| コンテスト | |
| ユーザー |
urutom
|
| 提出日時 | 2019-04-04 01:05:57 |
| 言語 | Ruby (4.0.2) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 306 bytes |
| 記録 | |
| コンパイル時間 | 46 ms |
| コンパイル使用メモリ | 9,216 KB |
| 実行使用メモリ | 151,112 KB |
| 最終ジャッジ日時 | 2026-05-29 16:26:06 |
| 合計ジャッジ時間 | 6,910 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | TLE * 1 -- * 1 |
| other | -- * 15 |
コンパイルメッセージ
Syntax OK
ソースコード
def check?(ans,n)
return false unless ans.size==n
return false if ans.any?{|v|v<1}
sum=ans.inject(:+)
return false unless sum%3==1
prod=ans.inject(:*)
return false unless prod%3==0
sum<=312456
end
n=gets.to_i
ans=[]
loop{
n.times{ans << rand(100)+1}
break if check?(ans,n)
}
puts ans*" "
urutom