結果

問題 No.201 yukicoderじゃんけん
ユーザー yukirinyukirin
提出日時 2015-05-09 18:38:28
言語 Go
(1.22.1)
結果
AC  
実行時間 19 ms / 5,000 ms
コード長 491 bytes
コンパイル時間 10,820 ms
コンパイル使用メモリ 243,960 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-18 10:49:40
合計ジャッジ時間 11,618 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 1 ms
6,812 KB
testcase_02 AC 1 ms
6,944 KB
testcase_03 AC 3 ms
6,940 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 AC 3 ms
6,940 KB
testcase_09 AC 3 ms
6,940 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 3 ms
6,944 KB
testcase_12 AC 3 ms
6,940 KB
testcase_13 AC 3 ms
6,944 KB
testcase_14 AC 1 ms
6,944 KB
testcase_15 AC 19 ms
6,944 KB
testcase_16 AC 19 ms
6,944 KB
testcase_17 AC 19 ms
6,940 KB
testcase_18 AC 19 ms
6,944 KB
testcase_19 AC 18 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"bytes"
	"fmt"
	"strings"
)

func main() {
	var s1, s2, x1, x2 string
	var p1, p2 []byte

	fmt.Scanln(&s1, &p1, &x1)
	fmt.Scanln(&s2, &p2, &x2)

	l1, l2 := len(p1), len(p2)

	if l1 > l2 {
		p2 = append([]byte(strings.Repeat("0", l1-l2)), p2...)
	} else if l2 > l1 {
		p1 = append([]byte(strings.Repeat("0", l2-l1)), p1...)
	}

	comp := bytes.Compare(p1, p2)
	if comp == 1 {
		fmt.Println(s1)
	} else if comp == -1 {
		fmt.Println(s2)
	} else {
		fmt.Println(-1)
	}
}
0