結果

問題 No.3061 uxs hxixtya pyuyn ixc hyixa kxuyn
ユーザー 👑 kakel-sankakel-san
提出日時 2024-02-19 18:45:42
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,339 ms / 2,000 ms
コード長 657 bytes
コンパイル時間 193 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 16,768 KB
最終ジャッジ日時 2024-02-19 18:45:47
合計ジャッジ時間 4,843 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
16,256 KB
testcase_01 AC 74 ms
16,256 KB
testcase_02 AC 72 ms
16,256 KB
testcase_03 AC 84 ms
16,384 KB
testcase_04 AC 84 ms
16,384 KB
testcase_05 AC 1,339 ms
16,768 KB
testcase_06 AC 394 ms
16,384 KB
testcase_07 AC 73 ms
16,256 KB
testcase_08 AC 74 ms
16,256 KB
testcase_09 AC 101 ms
16,384 KB
testcase_10 AC 85 ms
16,384 KB
testcase_11 AC 110 ms
16,384 KB
testcase_12 AC 80 ms
16,384 KB
testcase_13 AC 74 ms
16,256 KB
testcase_14 AC 112 ms
16,384 KB
testcase_15 AC 72 ms
16,256 KB
testcase_16 AC 72 ms
16,256 KB
testcase_17 AC 111 ms
16,384 KB
testcase_18 AC 82 ms
16,384 KB
testcase_19 AC 74 ms
16,256 KB
testcase_20 AC 73 ms
16,256 KB
testcase_21 AC 72 ms
16,256 KB
testcase_22 AC 72 ms
16,256 KB
testcase_23 AC 75 ms
16,256 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

begin
s = readline().chomp
for i in 0..(s.length-1) do
  for j in (i+2)..(s.length) do
  inlist = Array.new(26, 0)
  outlist = Array.new(26, 0)
  flg = true
    for k in 0..(s.length-1) do
      c = s[k].codepoints[0] - 97
      if k < i || k >= j || (k - i) % 2 == 1
        if s[k] != ' '
          outlist[c] = outlist[c] + 1
        end
      else
        if s[k] == ' '
          flg = false
        else
          inlist[c] = inlist[c] + 1
        end
      end
    end
    for k in 0..25 do
      if inlist[k] > 0 && outlist[k] > 0
        flg = false
      end
    end
    if flg
      puts 'Yes'
      exit()
    end
  end
end
rescue
end
puts 'NO'
0