CODE FESTIVAL 2017 Final (Parallel)

Submission #1802920

Source codeソースコード

s = gets.chomp
t = "AKIHABARA"
i = 0
j = 0
while i < s.size() && j < t.size()
  if s[i] == t[j]
    t[j] = "A"
    i += 1
    j += 1
  else
    j += 1
  end
end

if i < s.size()
  puts "NO"
else
  for k in 0...t.size()
    if t[k] != "A"
      puts "NO"
      exit
    end
  end
  puts "YES"
end

Submission

Task問題 A - AKIBA
User nameユーザ名 Kazune Takahashi
Created time投稿日時
Language言語 Ruby (2.3.3)
Status状態 AC
Score得点 300
Source lengthソースコード長 321 Byte
File nameファイル名
Exec time実行時間 7 ms
Memory usageメモリ使用量 1788 KB

Test case

Set

Set name Score得点 / Max score Cases
sample - sample-01.txt,sample-02.txt,sample-03.txt
All 300 / 300 sample-01.txt,sample-02.txt,sample-03.txt,01-01.txt,01-02.txt,01-03.txt,01-04.txt,01-05.txt,01-06.txt,01-07.txt,01-08.txt,01-09.txt,01-10.txt,01-11.txt,01-12.txt,01-13.txt,01-14.txt,01-15.txt,01-16.txt,01-17.txt,01-18.txt,sample-01.txt,sample-02.txt,sample-03.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
01-01.txt AC 7 ms 1788 KB
01-02.txt AC 7 ms 1788 KB
01-03.txt AC 7 ms 1788 KB
01-04.txt AC 7 ms 1788 KB
01-05.txt AC 7 ms 1788 KB
01-06.txt AC 7 ms 1788 KB
01-07.txt AC 7 ms 1788 KB
01-08.txt AC 7 ms 1788 KB
01-09.txt AC 7 ms 1788 KB
01-10.txt AC 7 ms 1788 KB
01-11.txt AC 7 ms 1788 KB
01-12.txt AC 7 ms 1788 KB
01-13.txt AC 7 ms 1788 KB
01-14.txt AC 7 ms 1788 KB
01-15.txt AC 7 ms 1788 KB
01-16.txt AC 7 ms 1788 KB
01-17.txt AC 7 ms 1788 KB
01-18.txt AC 7 ms 1788 KB
sample-01.txt AC 7 ms 1788 KB
sample-02.txt AC 7 ms 1788 KB
sample-03.txt AC 7 ms 1788 KB