結果
| 問題 |
No.796 well known
|
| コンテスト | |
| ユーザー |
urutom
|
| 提出日時 | 2019-04-04 01:06:45 |
| 言語 | Ruby (3.4.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 315 bytes |
| コンパイル時間 | 44 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 112,716 KB |
| 最終ジャッジ日時 | 2024-12-23 16:53:00 |
| 合計ジャッジ時間 | 41,648 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 2 TLE * 13 |
コンパイルメッセージ
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)
ans=[]
}
puts ans*" "
urutom