結果

問題 No.481 1から10
ユーザー jimanojimano
提出日時 2018-01-06 18:03:49
言語 Java21
(openjdk 21)
結果
AC  
実行時間 53 ms / 2,000 ms
コード長 588 bytes
コンパイル時間 3,023 ms
コンパイル使用メモリ 72,204 KB
実行使用メモリ 51,020 KB
最終ジャッジ日時 2023-08-24 22:20:03
合計ジャッジ時間 4,316 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
50,664 KB
testcase_01 AC 53 ms
50,664 KB
testcase_02 AC 52 ms
50,656 KB
testcase_03 AC 52 ms
50,536 KB
testcase_04 AC 53 ms
51,020 KB
testcase_05 AC 52 ms
50,820 KB
testcase_06 AC 52 ms
50,636 KB
testcase_07 AC 52 ms
50,564 KB
testcase_08 AC 53 ms
50,648 KB
testcase_09 AC 53 ms
50,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.stream.IntStream;

public class No0481 {
	public static void main(String[] args) {
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			String[] strArray = br.readLine().trim().split(" ");
			int sum = IntStream.rangeClosed(1, 10).sum();
			int num = 0;//書いた数9個の合計

			for (String s : strArray) {
				num += Integer.parseInt(s);
			}

			System.out.println(sum - num);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
0