結果
問題 | No.73 helloworld |
ユーザー |
|
提出日時 | 2017-02-21 09:34:54 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 79 ms / 5,000 ms |
コード長 | 1,000 bytes |
コンパイル時間 | 97 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-06-29 23:46:19 |
合計ジャッジ時間 | 1,641 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 |
コンパイルメッセージ
Syntax OK
ソースコード
class Yukicoderdef initializealpha_num = 26@alphas = Array.new(alpha_num, 0)@targets = []alpha_num.times do |i|@alphas[i] = gets.to_iendenddef runif check()return calc()elsereturn 0endendprivatedef checknecesarry_alpha_idx = [3, 4, 7, 11, 14, 17, 22]necesarry_alpha_num = [1, 1, 1, 3, 2, 1, 1]necesarry_alpha_idx.each_with_index do |i, idx|return false if @alphas[i] < necesarry_alpha_num[idx]@targets << @alphas[i]endtrueenddef calcl_count = @alphas[11]o_count = @alphas[14]l_max = 02.upto(l_count - 1) do |i|atai = i * (i - 1) * (l_count - i) / 2l_max = atai > l_max ? atai : l_maxendo_max = 01.upto(o_count - 1) do |i|atai = i * (o_count - i)o_max = atai > o_max ? atai : o_maxend@targets[3] = l_max@targets[4] = o_maxreturn @targets.inject(:*)endendputs Yukicoder.new.run