結果
| 問題 |
No.1665 quotient replace
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-09-03 22:52:26 |
| 言語 | Ruby (3.4.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 739 bytes |
| コンパイル時間 | 147 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 132,480 KB |
| 最終ジャッジ日時 | 2024-12-15 16:17:13 |
| 合計ジャッジ時間 | 91,143 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | RE * 21 TLE * 20 |
コンパイルメッセージ
Main.rb:28: warning: assigned but unused variable - n Syntax OK
ソースコード
require 'prime'
# # https://yukicoder.me/submissions/174004
# @dp={}
# def guchoku216(aa,turn=true)
# return !turn if aa.size == 0
# aa.sort!
# return @dp[aa+[turn]] if @dp[aa+[turn]]
# aa.each_index{|i|
# ac = aa.clone
# ac[i]-=1
# while ac[i] > 0
# return @dp[aa+[turn]] = turn if (guchoku216(ac.clone,!turn) == turn)
# ac[i]-=1
# end
# ac.delete(0)
# return @dp[aa+[turn]] = turn if (guchoku216(ac.clone,!turn) == turn)
# }
# return @dp[aa+[turn]] = !turn
# end
# def game(n)
# guchoku216(n.prime_division.map{|e|e[1]})
# end
n = gets.to_i
guchoku216(gets.split.map(&:to_i).map{|e| e.prime_division.map{|e|e[1]}}.flatten!)