Submission #1226176


Source Code Expand

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AGC009MultipleArray
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            long[] A = new long[N];
            long[] B = new long[N];
            string[] vals;
            for (int i=0; i < N; i++)
            {
                vals = Console.ReadLine().Split(' ');
                A[i] = long.Parse(vals[0]);
                B[i] = long.Parse(vals[1]);
            }

            long push = 0;
            int t;
            for(int i = N-1; i >= 0; i--)
            {
                t = 1;
                A[i] += push;
                while (t * B[i] < A[i])
                    t++;
                push += t * B[i] - A[i];
            }

            Console.WriteLine(push);
        }
    }
}

Submission Info

Submission Time
Task A - Multiple Array
User hogeki
Language C# (Mono 4.6.2.0)
Score 0
Code Size 951 Byte
Status WA
Exec Time 2112 ms
Memory 16592 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 2
AC × 4
WA × 3
TLE × 11
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 2108 ms 14556 KB
02.txt TLE 2108 ms 16480 KB
03.txt TLE 2108 ms 14552 KB
04.txt TLE 2108 ms 14560 KB
05.txt TLE 2108 ms 14556 KB
06.txt TLE 2112 ms 16592 KB
07.txt TLE 2108 ms 14552 KB
08.txt TLE 2108 ms 16592 KB
09.txt TLE 2108 ms 14544 KB
10.txt TLE 2108 ms 14544 KB
11.txt AC 113 ms 16480 KB
12.txt WA 87 ms 16592 KB
13.txt TLE 2108 ms 16480 KB
14.txt AC 129 ms 16592 KB
15.txt WA 20 ms 9044 KB
16.txt WA 20 ms 11092 KB
s1.txt AC 20 ms 13140 KB
s2.txt AC 20 ms 9044 KB