Submission #1126667


Source Code Expand

import java.util.*;
class Main{
    public static void main(String[]args){
        Scanner sc=new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        int a[] = new int[n];
        int b[] = new int[n];
        for(int i = 0; i < n; i++){
            String str = sc.nextLine();
            String strs[] = str.split(" ");
            a[i] = Integer.parseInt(strs[0]);
            b[i] = Integer.parseInt(strs[1]);    
        }
        int k = n - 1;
        int botton = 0;
        while(k >= 0){
            if(a[k] % b[k] == 0){
                k--;
                continue;
            }
            botton++;
            for(int i = 0; i <= k; i++){
                a[i]++;
            }
        }
        System.out.println(botton);
    }
}

Submission Info

Submission Time
Task A - Multiple Array
User khanda610
Language Java8 (OpenJDK 1.8.0)
Score 0
Code Size 799 Byte
Status TLE
Exec Time 2105 ms
Memory 121932 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 2104 ms 114984 KB
02.txt TLE 2104 ms 116044 KB
03.txt TLE 2104 ms 115900 KB
04.txt TLE 2104 ms 117272 KB
05.txt TLE 2104 ms 114580 KB
06.txt TLE 2105 ms 121932 KB
07.txt AC 542 ms 111140 KB
08.txt TLE 2104 ms 115596 KB
09.txt AC 504 ms 109928 KB
10.txt TLE 2105 ms 120464 KB
11.txt AC 522 ms 111868 KB
12.txt AC 498 ms 108240 KB
13.txt TLE 2105 ms 108800 KB
14.txt AC 546 ms 117556 KB
15.txt AC 88 ms 19796 KB
16.txt AC 88 ms 19028 KB
s1.txt AC 96 ms 19412 KB
s2.txt AC 88 ms 18644 KB