結果

問題 No.3081 HQ9+
ユーザー cielciel
提出日時 2021-04-15 09:55:47
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 160 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 11,228 KB
実行使用メモリ 15,560 KB
最終ジャッジ日時 2023-09-14 01:22:11
合計ジャッジ時間 3,113 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,336 KB
testcase_01 AC 82 ms
15,300 KB
testcase_02 AC 83 ms
15,300 KB
testcase_03 AC 82 ms
15,312 KB
testcase_04 AC 81 ms
15,340 KB
testcase_05 AC 79 ms
15,364 KB
testcase_06 AC 80 ms
15,040 KB
testcase_07 AC 79 ms
15,136 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 81 ms
15,240 KB
testcase_12 AC 79 ms
15,236 KB
testcase_13 AC 79 ms
15,240 KB
testcase_14 AC 81 ms
15,304 KB
testcase_15 AC 79 ms
15,040 KB
testcase_16 AC 79 ms
15,184 KB
testcase_17 AC 76 ms
15,256 KB
testcase_18 AC 77 ms
15,348 KB
testcase_19 AC 77 ms
15,236 KB
testcase_20 AC 77 ms
15,420 KB
testcase_21 AC 82 ms
15,420 KB
testcase_22 AC 82 ms
15,560 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:5: warning: ambiguous first argument; put parentheses or a space even after `-' operator
Main.rb:9: warning: ambiguous first argument; put parentheses or a space even after `-' operator
Syntax OK

ソースコード

diff #

n=gets.to_i
s=gets.chomp
c=s.count 'Q'
if s.include?('H')||c<1
  p -1;exit
end
a=s.chars.each_slice(n/c).to_a
if a.any?{|e|e!=a[0]}
  p -1;exit
end
puts a[0]*''
0