提出 #66975937


ソースコード 拡げる

# frozen_string_literal: true

n, q = gets.split.map(&:to_i)
qu = Array.new(q) { gets.chomp.split }

server = []
a = Array.new(n) { [] }
i = 0
c = []
qu.each do |e|
  p = e[1].to_i - 1
  case e[0].to_i
  when 1
    if !server.empty?
      j, size = server
      c << c[j][0...size].dup
      a[p] = [i, size]
      i += 1
    end
  when 2
    if a[p].empty?
      c << []
      a[p] = [i, 0]
      i += 1
    end
    j, size = a[p]
    c[j] << e[2]
    a[p] = [j, size + 1]
  when 3
    server = a[p].dup
  end
end
if server.empty?
  puts
  exit
end
i, size = server
puts c[i][0...size].flatten.join
#pp c

提出情報

提出日時
問題 D - Conflict 2
ユーザ slimepettan
言語 Ruby (ruby 3.2.2)
得点 0
コード長 606 Byte
結果 WA
実行時間 2252 ms
メモリ 770564 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 0 / 425
結果
AC × 3
AC × 30
WA × 7
TLE × 12
セット名 テストケース
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 02_random2_00.txt, 02_random2_01.txt, 02_random2_02.txt, 02_random2_03.txt, 02_random2_04.txt, 02_random2_05.txt, 02_random2_06.txt, 02_random2_07.txt, 02_random2_08.txt, 02_random2_09.txt, 02_random2_10.txt, 02_random2_11.txt, 02_random2_12.txt, 02_random2_13.txt, 02_random2_14.txt, 02_random2_15.txt, 03_random3_00.txt, 03_random3_01.txt, 03_random3_02.txt, 03_random3_03.txt, 04_random4_00.txt, 04_random4_01.txt, 05_random5_00.txt, 05_random5_01.txt, 06_handmade_00.txt, 06_handmade_01.txt, 06_handmade_02.txt, 06_handmade_03.txt, 06_handmade_04.txt, 06_handmade_05.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 139 ms 17016 KiB
00_sample_01.txt AC 54 ms 21732 KiB
00_sample_02.txt AC 44 ms 17164 KiB
01_random_00.txt AC 78 ms 29844 KiB
01_random_01.txt WA 279 ms 65452 KiB
01_random_02.txt AC 242 ms 56568 KiB
01_random_03.txt AC 65 ms 26312 KiB
01_random_04.txt AC 220 ms 52792 KiB
01_random_05.txt WA 91 ms 27228 KiB
01_random_06.txt AC 56 ms 22096 KiB
01_random_07.txt AC 76 ms 25976 KiB
01_random_08.txt AC 173 ms 49284 KiB
01_random_09.txt WA 262 ms 69796 KiB
01_random_10.txt AC 224 ms 49792 KiB
01_random_11.txt WA 95 ms 31052 KiB
01_random_12.txt AC 166 ms 43680 KiB
01_random_13.txt AC 199 ms 52528 KiB
01_random_14.txt AC 221 ms 53584 KiB
01_random_15.txt WA 183 ms 60772 KiB
02_random2_00.txt AC 266 ms 68452 KiB
02_random2_01.txt AC 291 ms 68256 KiB
02_random2_02.txt AC 292 ms 66280 KiB
02_random2_03.txt AC 287 ms 66188 KiB
02_random2_04.txt AC 364 ms 67176 KiB
02_random2_05.txt TLE 2244 ms 689316 KiB
02_random2_06.txt TLE 2238 ms 555028 KiB
02_random2_07.txt WA 330 ms 75428 KiB
02_random2_08.txt AC 374 ms 67316 KiB
02_random2_09.txt TLE 2247 ms 745064 KiB
02_random2_10.txt TLE 2246 ms 708968 KiB
02_random2_11.txt WA 310 ms 74924 KiB
02_random2_12.txt AC 294 ms 73460 KiB
02_random2_13.txt TLE 2248 ms 766320 KiB
02_random2_14.txt TLE 2247 ms 745880 KiB
02_random2_15.txt AC 239 ms 57112 KiB
03_random3_00.txt TLE 2244 ms 668964 KiB
03_random3_01.txt TLE 2252 ms 766720 KiB
03_random3_02.txt TLE 2251 ms 770564 KiB
03_random3_03.txt TLE 2251 ms 759200 KiB
04_random4_00.txt TLE 2248 ms 770448 KiB
04_random4_01.txt TLE 2248 ms 767756 KiB
05_random5_00.txt AC 289 ms 74504 KiB
05_random5_01.txt AC 290 ms 73352 KiB
06_handmade_00.txt AC 43 ms 16992 KiB
06_handmade_01.txt AC 47 ms 20648 KiB
06_handmade_02.txt AC 216 ms 55708 KiB
06_handmade_03.txt AC 373 ms 84588 KiB
06_handmade_04.txt AC 290 ms 60224 KiB
06_handmade_05.txt AC 278 ms 66368 KiB