AtCoder Beginner Contest 013

Submission #1678861

Source codeソースコード

lines = $stdin.read
array = lines.split("\n")
 
N,M,D = array[0].split(" ").map(&:to_i)
A     = array[1].split(" ").map(&:to_i)
 
st    = 1.upto(N).to_a
to    = 1.upto(N).to_a
 
for a in A.reverse
  to[a], to[a-1] = to[a-1],to[a]
end
 
1.upto(D) do |i|
  #puts "concat! D =#{i}"
  neo_to = Array.new(N)

  to.each_with_index do |elem,idx|
    neo_to[idx] = st[elem-1]
  end
  st = neo_to
  #puts st.to_s
end
 
st.each{ |t| puts t }

Submission

Task問題 D - 阿弥陀
User nameユーザ名 hiroyuking
Created time投稿日時
Language言語 Ruby (2.3.3)
Status状態 RE
Score得点 10
Source lengthソースコード長 455 Byte
File nameファイル名
Exec time実行時間 ms
Memory usageメモリ使用量 -

Test case

Set

Set name Score得点 / Max score Cases
Subtask1 10 / 10 sample_1.txt,01_i.txt,01_random01.txt,01_random02.txt,01_random03.txt,01_random04.txt,01_random05.txt,01_random06.txt,01_random07.txt
Subtask2 0 / 20 sample_1.txt,sample_2.txt,sample_3.txt,02_i.txt,02_p.txt,02_random01.txt,02_random02.txt,02_random03.txt,02_random04.txt,02_random05.txt,02_random06.txt,02_random07.txt,02_random08.txt,02_rp01.txt,02_rp02.txt,02_rp03.txt,02_rp04.txt,02_rp05.txt
Subtask3 0 / 20 sample_1.txt,sample_2.txt,03_i.txt,03_random01.txt,03_random02.txt,03_random03.txt,03_random04.txt,03_random05.txt,03_random06.txt,03_random07.txt,03_random08.txt,03_random09.txt,03_random10.txt,03_random11.txt,03_random12.txt,03_random13.txt,03_random14.txt,03_random15.txt
Subtask4 0 / 50 sample_1.txt,sample_2.txt,sample_3.txt,04_i.txt,04_p1.txt,04_p2.txt,04_random01.txt,04_random02.txt,04_random03.txt,04_random04.txt,04_random05.txt,04_random06.txt,04_random07.txt,04_random08.txt,04_random09.txt,04_random10.txt,04_random11.txt,04_random12.txt,04_random13.txt,04_rp01.txt,04_rp02.txt,04_rp03.txt,04_rp04.txt,04_rp05.txt,04_rp06.txt,04_rp07.txt,04_rp08.txt,04_rp09.txt,04_rp10.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
01_i.txt AC 224 ms 24500 KB
01_random01.txt AC 8 ms 1788 KB
01_random02.txt AC 7 ms 1788 KB
01_random03.txt AC 8 ms 1788 KB
01_random04.txt AC 16 ms 2556 KB
01_random05.txt AC 117 ms 7036 KB
01_random06.txt AC 193 ms 21496 KB
01_random07.txt AC 227 ms 24500 KB
02_i.txt AC 120 ms 9084 KB
02_p.txt AC 114 ms 8956 KB
02_random01.txt RE
02_random02.txt AC 8 ms 1788 KB
02_random03.txt AC 19 ms 2684 KB
02_random04.txt RE
02_random05.txt AC 43 ms 5500 KB
02_random06.txt AC 66 ms 11644 KB
02_random07.txt AC 237 ms 28924 KB
02_random08.txt AC 237 ms 28924 KB
02_rp01.txt AC 71 ms 6140 KB
02_rp02.txt AC 64 ms 5756 KB
02_rp03.txt AC 23 ms 2812 KB
02_rp04.txt AC 66 ms 5884 KB
02_rp05.txt AC 68 ms 6140 KB
03_i.txt TLE
03_random01.txt TLE
03_random02.txt TLE
03_random03.txt TLE
03_random04.txt TLE
03_random05.txt TLE
03_random06.txt TLE
03_random07.txt TLE
03_random08.txt TLE
03_random09.txt TLE
03_random10.txt TLE
03_random11.txt TLE
03_random12.txt TLE
03_random13.txt TLE
03_random14.txt TLE
03_random15.txt TLE
04_i.txt TLE
04_p1.txt TLE
04_p2.txt TLE
04_random01.txt TLE
04_random02.txt TLE
04_random03.txt TLE
04_random04.txt TLE
04_random05.txt TLE
04_random06.txt TLE
04_random07.txt TLE
04_random08.txt TLE
04_random09.txt TLE
04_random10.txt TLE
04_random11.txt TLE
04_random12.txt TLE
04_random13.txt TLE
04_rp01.txt TLE
04_rp02.txt TLE
04_rp03.txt TLE
04_rp04.txt TLE
04_rp05.txt TLE
04_rp06.txt TLE
04_rp07.txt TLE
04_rp08.txt TLE
04_rp09.txt TLE
04_rp10.txt TLE
sample_1.txt AC 8 ms 1788 KB
sample_2.txt AC 7 ms 1788 KB
sample_3.txt AC 8 ms 1788 KB