Submission #1074511
Source Code Expand
io = STDIN n=io.gets.chomp.to_i ab=[] n.times do |i| ab<<io.gets.chomp.split.map(&:to_i) end a,b=ab.transpose def calc(x,y) z=1 while x>y*z z+=1 end y*z-x end ans=0 (1..(a.size)).to_a.reverse.each do |i| add=calc(a[i.pred],b[i.pred]) (1..(i.pred).pred).each{|j|a[j]+=add} ans+=add end p ans
Submission Info
Submission Time | |
---|---|
Task | A - Multiple Array |
User | andor |
Language | Ruby (2.3.3) |
Score | 0 |
Code Size | 330 Byte |
Status | WA |
Exec Time | 2103 ms |
Memory | 12856 KB |
Judge Result
Set Name | Sample | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | s1.txt, s2.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, s1.txt, s2.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | TLE | 2103 ms | 12852 KB |
02.txt | TLE | 2103 ms | 12852 KB |
03.txt | TLE | 2103 ms | 12852 KB |
04.txt | TLE | 2103 ms | 12856 KB |
05.txt | TLE | 2103 ms | 12856 KB |
06.txt | TLE | 2103 ms | 12852 KB |
07.txt | TLE | 2103 ms | 12852 KB |
08.txt | TLE | 2103 ms | 12852 KB |
09.txt | TLE | 2103 ms | 12852 KB |
10.txt | TLE | 2103 ms | 12852 KB |
11.txt | TLE | 2103 ms | 12856 KB |
12.txt | TLE | 2103 ms | 12852 KB |
13.txt | TLE | 2103 ms | 12852 KB |
14.txt | TLE | 2103 ms | 12856 KB |
15.txt | WA | 11 ms | 1788 KB |
16.txt | WA | 10 ms | 1788 KB |
s1.txt | AC | 11 ms | 1788 KB |
s2.txt | AC | 11 ms | 1788 KB |