結果

問題 No.1860 Magnets
ユーザー MtSakaMtSaka
提出日時 2021-11-21 22:39:17
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 2,000 ms
コード長 269 bytes
コンパイル時間 1,876 ms
コンパイル使用メモリ 71,124 KB
実行使用メモリ 56,040 KB
最終ジャッジ日時 2023-09-25 20:40:50
合計ジャッジ時間 6,793 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,884 KB
testcase_01 AC 123 ms
55,604 KB
testcase_02 AC 122 ms
55,832 KB
testcase_03 AC 122 ms
55,652 KB
testcase_04 AC 121 ms
53,628 KB
testcase_05 AC 120 ms
55,420 KB
testcase_06 AC 119 ms
55,680 KB
testcase_07 AC 117 ms
55,820 KB
testcase_08 AC 118 ms
56,040 KB
testcase_09 AC 121 ms
55,720 KB
testcase_10 AC 128 ms
55,984 KB
testcase_11 AC 120 ms
55,956 KB
testcase_12 AC 122 ms
55,716 KB
testcase_13 AC 123 ms
55,788 KB
testcase_14 AC 124 ms
55,424 KB
testcase_15 AC 121 ms
55,640 KB
testcase_16 AC 121 ms
55,720 KB
testcase_17 AC 121 ms
55,840 KB
testcase_18 AC 122 ms
55,428 KB
testcase_19 AC 122 ms
55,880 KB
testcase_20 AC 130 ms
55,748 KB
testcase_21 AC 121 ms
55,676 KB
testcase_22 AC 123 ms
55,876 KB
testcase_23 AC 125 ms
55,612 KB
testcase_24 AC 121 ms
55,604 KB
testcase_25 AC 122 ms
55,616 KB
testcase_26 AC 122 ms
55,480 KB
testcase_27 AC 126 ms
55,648 KB
testcase_28 AC 123 ms
55,908 KB
testcase_29 AC 120 ms
55,628 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt(),b=sc.nextInt();
		// 出力
		System.out.println(a+b+Math.max(0,Math.abs(a-b)-1));
	}
}
0