結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
16,256 KB
testcase_01 AC 71 ms
16,256 KB
testcase_02 AC 73 ms
16,256 KB
testcase_03 AC 97 ms
16,384 KB
testcase_04 AC 98 ms
16,384 KB
testcase_05 AC 1,351 ms
16,768 KB
testcase_06 AC 383 ms
16,384 KB
testcase_07 AC 72 ms
16,256 KB
testcase_08 AC 71 ms
16,256 KB
testcase_09 AC 97 ms
16,384 KB
testcase_10 AC 95 ms
16,384 KB
testcase_11 AC 125 ms
16,384 KB
testcase_12 AC 93 ms
16,384 KB
testcase_13 RE -
testcase_14 AC 111 ms
16,384 KB
testcase_15 RE -
testcase_16 AC 77 ms
16,256 KB
testcase_17 AC 113 ms
16,384 KB
testcase_18 AC 82 ms
16,384 KB
testcase_19 AC 73 ms
16,256 KB
testcase_20 AC 73 ms
16,256 KB
testcase_21 AC 73 ms
16,256 KB
testcase_22 AC 73 ms
16,256 KB
testcase_23 AC 75 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