結果
問題 | No.8081 HQ9+ |
ユーザー |
![]() |
提出日時 | 2021-04-01 20:22:48 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 80 ms / 2,000 ms |
コード長 | 193 bytes |
コンパイル時間 | 74 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 12,416 KB |
最終ジャッジ日時 | 2024-12-18 02:03:00 |
合計ジャッジ時間 | 2,600 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 21 |
コンパイルメッセージ
Main.rb:6: warning: ambiguous first argument; put parentheses or a space even after `-' operator Main.rb:11: warning: ambiguous first argument; put parentheses or a space even after `-' operator Syntax OK
ソースコード
n=gets.to_is=gets.chompq=s.count(?Q)w=(q**0.5).to_iif q==0 || q!=w**2 || n%w>0 ||s[/[H9]/]puts -1exitendt=s.scan(/.{1,#{n/w}}/).sortif t[0]!=t[t.size-1]puts -1elseputs t[0]end