結果

問題 No.3061 uxs hxixtya pyuyn ixc hyixa kxuyn
ユーザー 👑 kakel-sankakel-san
提出日時 2024-02-19 18:38:18
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 640 bytes
コンパイル時間 63 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 16,768 KB
最終ジャッジ日時 2024-02-19 18:38:24
合計ジャッジ時間 5,559 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 95 ms
16,256 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 116 ms
16,256 KB
testcase_10 AC 102 ms
16,256 KB
testcase_11 AC 129 ms
16,256 KB
testcase_12 AC 116 ms
16,256 KB
testcase_13 RE -
testcase_14 AC 130 ms
16,384 KB
testcase_15 RE -
testcase_16 AC 85 ms
16,256 KB
testcase_17 AC 130 ms
16,384 KB
testcase_18 AC 96 ms
16,384 KB
testcase_19 AC 85 ms
16,256 KB
testcase_20 WA -
testcase_21 AC 85 ms
16,256 KB
testcase_22 WA -
testcase_23 AC 91 ms
16,256 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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
puts 'No'
0