結果

問題 No.138 化石のバージョン
コンテスト
ユーザー ゆうP
提出日時 2024-04-06 19:57:12
言語 Go
(1.27.0 + ACL)
コンパイル:
/usr/bin/go_c
実行:
./Main
結果
AC  
実行時間 1 ms / 5,000 ms
+ 439µs
コード長 592 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 9,706 ms
コンパイル使用メモリ 279,072 KB
実行使用メモリ 9,792 KB
最終ジャッジ日時 2026-09-07 03:44:52
合計ジャッジ時間 11,695 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

// 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