結果

問題 No.138 化石のバージョン
ユーザー toshiro_yanagi
提出日時 2022-06-26 22:12:22
言語 Go
(1.23.4)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 397 bytes
コンパイル時間 9,164 ms
コンパイル使用メモリ 222,180 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-17 12:54:12
合計ジャッジ時間 10,091 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

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

func main() {
	var s, t string
	fmt.Scan(&s, &t)
	std := strings.Split(s, ".")
	tgt := strings.Split(t, ".")

	ans := "YES"
	for i := 0; i < 3; i++ {
		S, _ := strconv.Atoi(std[i])
		T, _ := strconv.Atoi(tgt[i])
		if T > S {
			ans = "NO"
			break
		} else if T < S {
			ans = "YES"
			break
		} else {
			continue
		}
	}
	fmt.Println(ans)
}
0