結果

問題 No.1057 素敵な日
ユーザー Daniel NakanoDaniel Nakano
提出日時 2020-05-22 21:43:31
言語 Go
(1.22.1)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 468 bytes
コンパイル時間 18,479 ms
コンパイル使用メモリ 229,040 KB
実行使用メモリ 6,812 KB
最終ジャッジ日時 2024-04-15 16:25:35
合計ジャッジ時間 13,209 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 1 ms
5,248 KB
testcase_02 AC 1 ms
5,248 KB
testcase_03 AC 2 ms
5,248 KB
testcase_04 AC 1 ms
5,248 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"bufio"
	"fmt"
	"log"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Split(bufio.ScanWords)
}

func input() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	a, err := strconv.Atoi(input())
	if err != nil {
		log.Fatal(err)
	}
	b, err := strconv.Atoi(input())
	if err != nil {
		log.Fatal(err)
	}

	if a == b {
		fmt.Println(a*2 - 1)
	} else if a > b {
		fmt.Println(b * 2)
	} else {
		fmt.Println(a * 2)
	}
}
0