結果

問題 No.1915 Addition
ユーザー ks2mks2m
提出日時 2022-04-29 21:30:39
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 532 bytes
コンパイル時間 3,024 ms
コンパイル使用メモリ 74,592 KB
実行使用メモリ 54,536 KB
最終ジャッジ日時 2024-06-29 02:48:56
合計ジャッジ時間 5,163 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1
other WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		label:
		for (int z = 0; z < t; z++) {
			int n = sc.nextInt();
			long a = 1;
			for (int i = 0; i < 18; i++) {
				a *= 10;
				if (a > n) {
					long b = a - n;
					StringBuilder sb = new StringBuilder();
					sb.append(b);
					sb.append(0);
					sb.append(0);
					System.out.println(sb.toString());
					continue label;
				}
			}
		}
		sc.close();
	}
}
0