Submission #2153155


Source Code Expand

using System;
using System.Linq;

class Program {
    static void Main(string[] args) {
        int n = int.Parse(Console.ReadLine()), count = 0;
        var a = new int[n]; 
        var b = new int[n];
        for (int i = 0; i < n; i++) {
            var c = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
            a[i] = c[0];
            b[i] = c[1];
        }
        for (int i = n - 1; i >= 0; i--) {
            int c = b[i];
            a[i] += count;
            while (b[i] < a[i]) {
                b[i] += c;
            }
            count = b[i] - a[i] + count;
        }
        Console.WriteLine(count);
    }
}

Submission Info

Submission Time
Task A - Multiple Array
User gunmaken
Language C# (Mono 4.6.2.0)
Score 0
Code Size 671 Byte
Status WA
Exec Time 2108 ms
Memory 18012 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 2
AC × 4
WA × 10
TLE × 4
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 WA 163 ms 15968 KB
02.txt WA 163 ms 15964 KB
03.txt WA 407 ms 15960 KB
04.txt WA 164 ms 13916 KB
05.txt WA 163 ms 15956 KB
06.txt WA 168 ms 15968 KB
07.txt TLE 2108 ms 15968 KB
08.txt WA 159 ms 18012 KB
09.txt TLE 2108 ms 15968 KB
10.txt TLE 2108 ms 15968 KB
11.txt AC 134 ms 13920 KB
12.txt WA 107 ms 15968 KB
13.txt TLE 2108 ms 15964 KB
14.txt AC 157 ms 13916 KB
15.txt WA 22 ms 11220 KB
16.txt WA 22 ms 13268 KB
s1.txt AC 22 ms 11220 KB
s2.txt AC 22 ms 11220 KB