Submission #5415861


Source Code Expand

import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int A[]=new int[N];
		int B[]=new int[N];
		int z=0,sum=0;
		while(z<N){
			A[z]=stdIn.nextInt();
			B[z]=stdIn.nextInt();
			z++;
		}z--;
		while(z>=0) {
			A[z]+=sum;
			while(true) {
				if(A[z]%B[z]==0)
					break;
				A[z]++;sum++;
			}
			z--;
		}
		System.out.println(sum);
	}
}

Submission Info

Submission Time
Task A - Multiple Array
User zaki1236
Language Java8 (OpenJDK 1.8.0)
Score 0
Code Size 466 Byte
Status TLE
Exec Time 2109 ms
Memory 65268 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 2
AC × 9
TLE × 9
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 2109 ms 62992 KB
02.txt TLE 2109 ms 64616 KB
03.txt TLE 2109 ms 62680 KB
04.txt TLE 2109 ms 60684 KB
05.txt TLE 2109 ms 62912 KB
06.txt TLE 2109 ms 61640 KB
07.txt AC 523 ms 64864 KB
08.txt TLE 2109 ms 64988 KB
09.txt AC 519 ms 65268 KB
10.txt TLE 2109 ms 60260 KB
11.txt AC 520 ms 61908 KB
12.txt AC 499 ms 62508 KB
13.txt TLE 2109 ms 64084 KB
14.txt AC 602 ms 65120 KB
15.txt AC 92 ms 20564 KB
16.txt AC 93 ms 23764 KB
s1.txt AC 92 ms 19284 KB
s2.txt AC 91 ms 21844 KB