結果

問題 No.1057 素敵な日
ユーザー 拓哉拓哉
提出日時 2020-07-21 22:46:58
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 428 bytes
コンパイル時間 2,367 ms
コンパイル使用メモリ 71,364 KB
実行使用メモリ 56,000 KB
最終ジャッジ日時 2023-08-30 04:02:17
合計ジャッジ時間 4,426 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,456 KB
testcase_01 AC 126 ms
55,872 KB
testcase_02 AC 127 ms
53,700 KB
testcase_03 WA -
testcase_04 AC 126 ms
55,808 KB
testcase_05 WA -
testcase_06 AC 125 ms
55,568 KB
testcase_07 WA -
testcase_08 AC 125 ms
55,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int a=sc.nextInt(),b=sc.nextInt();
		int shorter=0,longer=0;
		if(a>b){
			shorter=b;
			longer=a;
		}else{
			shorter=a;
			longer=b;
		}
		int i=0;
		while(shorter>=0){
			if(i%2==0)shorter--;
			else longer--;
			i++;
		}
		System.out.println(i-1);
		sc.close();
		return;
	}
}
0