Submission #287249


Source Code Expand

Copy
n, q = gets.chomp.split(" ").map(&:to_i)
arr  = gets.chomp.split(" ").map(&:to_i)
while q = gets
  q = q.chomp.split(" ").map(&:to_i)
  if    q[0] == 1
    a, b = q[1]-1, q[2]-1
    a.upto(b){|i|
      arr[i] += q[3]
    }
  elsif q[0] == 2
    a, b = q[1]-1, q[2]-1
    c, d = q[3]-1, q[4]-1
    arr[a..b] = arr[c..d]
  elsif q[0] == 3
    a, b = q[1]-1, q[2]-1
    puts arr[a..b].inject(:+)
  end
end

Submission Info

Submission Time
Task D - グラフではない
User yosidaa
Language Ruby (1.9.3)
Score 0
Code Size 421 Byte
Status TLE
Exec Time 5056 ms
Memory 77920 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 100
Status
AC × 2
AC × 13
TLE × 9
Set Name Test Cases
Sample subtask0_sample_01.txt, subtask0_sample_02.txt
All subtask0_sample_01.txt, subtask0_sample_02.txt, subtask1_largerandom_t1_01.txt, subtask1_largerandom_t1_02.txt, subtask1_largerandom_t2_03.txt, subtask1_largerandom_t2_04.txt, subtask1_largespecial01.txt, subtask1_largespecial02.txt, subtask1_largespecial03.txt, subtask1_largespecial04.txt, subtask1_largespecial05.txt, subtask1_largespecial06.txt, subtask1_smallrandom_01.txt, subtask1_smallrandom_02.txt, subtask1_smallrandom_03.txt, subtask1_smallrandom_04.txt, subtask1_smallrandom_05.txt, subtask1_smallrandom_06.txt, subtask1_smallrandom_07.txt, subtask1_smallrandom_08.txt, subtask1_smallrandom_09.txt, subtask1_smallrandom_10.txt
Case Name Status Exec Time Memory
subtask0_sample_01.txt AC 56 ms 4256 KB
subtask0_sample_02.txt AC 55 ms 4208 KB
subtask1_largerandom_t1_01.txt TLE 5044 ms 46056 KB
subtask1_largerandom_t1_02.txt TLE 5043 ms 39984 KB
subtask1_largerandom_t2_03.txt TLE 5046 ms 43176 KB
subtask1_largerandom_t2_04.txt TLE 5042 ms 44388 KB
subtask1_largespecial01.txt TLE 5051 ms 60084 KB
subtask1_largespecial02.txt TLE 5041 ms 38244 KB
subtask1_largespecial03.txt TLE 5040 ms 38244 KB
subtask1_largespecial04.txt TLE 5056 ms 77920 KB
subtask1_largespecial05.txt TLE 5046 ms 51040 KB
subtask1_largespecial06.txt AC 1165 ms 4188 KB
subtask1_smallrandom_01.txt AC 160 ms 4212 KB
subtask1_smallrandom_02.txt AC 56 ms 4256 KB
subtask1_smallrandom_03.txt AC 56 ms 4208 KB
subtask1_smallrandom_04.txt AC 57 ms 4208 KB
subtask1_smallrandom_05.txt AC 58 ms 4208 KB
subtask1_smallrandom_06.txt AC 59 ms 4212 KB
subtask1_smallrandom_07.txt AC 56 ms 4212 KB
subtask1_smallrandom_08.txt AC 55 ms 4212 KB
subtask1_smallrandom_09.txt AC 57 ms 4208 KB
subtask1_smallrandom_10.txt AC 55 ms 4252 KB