Submission #1350923
Source Code Expand
import java.util.Scanner; public class Main { static Scanner in = new Scanner(System.in); public static void main(String[] args){ int n = in.nextInt(); int[] a = new int[n], b = new int[n]; for(int i = 0; i < n; i++){ a[i] = in.nextInt(); b[i] = in.nextInt(); } int sum = 0; for(int i = n - 1; i > -1; i--){ if(((a[i] + sum) % b[i]) != 0){ sum += b[i] - ((a[i] + sum) % b[i]); } } System.out.println(sum); } }
Submission Info
Submission Time | |
---|---|
Task | A - Multiple Array |
User | mosmos21 |
Language | Java8 (OpenJDK 1.8.0) |
Score | 0 |
Code Size | 467 Byte |
Status | WA |
Exec Time | 623 ms |
Memory | 73144 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 | WA | 581 ms | 62996 KB |
02.txt | WA | 571 ms | 63736 KB |
03.txt | WA | 543 ms | 63648 KB |
04.txt | WA | 570 ms | 61776 KB |
05.txt | WA | 575 ms | 65604 KB |
06.txt | WA | 623 ms | 62888 KB |
07.txt | AC | 532 ms | 62616 KB |
08.txt | WA | 572 ms | 62616 KB |
09.txt | AC | 529 ms | 65972 KB |
10.txt | WA | 583 ms | 62712 KB |
11.txt | AC | 548 ms | 63092 KB |
12.txt | AC | 492 ms | 73144 KB |
13.txt | WA | 491 ms | 63636 KB |
14.txt | AC | 617 ms | 64640 KB |
15.txt | AC | 93 ms | 18644 KB |
16.txt | AC | 98 ms | 21844 KB |
s1.txt | AC | 94 ms | 21712 KB |
s2.txt | AC | 102 ms | 20692 KB |