結果

問題 No.3062 A + B
ユーザー ks2mks2m
提出日時 2020-04-01 22:10:17
言語 Java21
(openjdk 21)
結果
AC  
実行時間 49 ms / 2,000 ms
コード長 459 bytes
コンパイル時間 3,044 ms
コンパイル使用メモリ 78,600 KB
実行使用メモリ 50,108 KB
最終ジャッジ日時 2023-09-09 18:28:18
合計ジャッジ時間 4,378 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
49,752 KB
testcase_01 AC 48 ms
49,448 KB
testcase_02 AC 48 ms
50,108 KB
testcase_03 AC 43 ms
49,416 KB
testcase_04 AC 43 ms
49,316 KB
testcase_05 AC 49 ms
49,680 KB
testcase_06 AC 43 ms
49,224 KB
testcase_07 AC 49 ms
49,932 KB
testcase_08 AC 43 ms
49,088 KB
testcase_09 AC 44 ms
49,456 KB
testcase_10 AC 44 ms
49,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] sa = br.readLine().split(" ");
		long a = Long.parseLong(sa[0]);
		long b = Long.parseLong(sa[1]);
		br.close();

		if (b < 0 || a == 0) {
			System.out.println(a + b);
		} else {
			System.out.println(sa[0] + sa[1]);
		}
	}
}
0