結果

問題 No.1915 Addition
ユーザー ks2mks2m
提出日時 2022-04-29 21:30:39
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 532 bytes
コンパイル時間 3,512 ms
コンパイル使用メモリ 72,276 KB
実行使用メモリ 57,828 KB
最終ジャッジ日時 2023-09-11 12:22:50
合計ジャッジ時間 6,592 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
権限があれば一括ダウンロードができます

ソースコード

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