結果

問題 No.138 化石のバージョン
ユーザー ゆうP
提出日時 2024-04-06 19:57:12
言語 Go
(1.23.4)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 592 bytes
コンパイル時間 10,889 ms
コンパイル使用メモリ 242,004 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-01 04:02:27
合計ジャッジ時間 11,371 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

// No.138 化石のバージョン
package main

import (
	"fmt"
	"strconv"
	"strings"
)

func main() {
	var s1, s2 string
	fmt.Scan(&s1, &s2)
	x1 := strings.SplitN(s1, ".", 3)
	a0, _ := strconv.Atoi(x1[0])
	b0, _ := strconv.Atoi(x1[1])
	c0, _ := strconv.Atoi(x1[2])

	x2 := strings.SplitN(s2, ".", 3)
	a1, _ := strconv.Atoi(x2[0])
	b1, _ := strconv.Atoi(x2[1])
	c1, _ := strconv.Atoi(x2[2])

	v0, _ := strconv.Atoi(fmt.Sprintf("%03d%03d%03d", a0, b0, c0))
	v1, _ := strconv.Atoi(fmt.Sprintf("%03d%03d%03d", a1, b1, c1))
	if v1 <= v0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}
0