提出 #61539505


ソースコード 拡げる

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"sort"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)
var wr = bufio.NewWriter(os.Stdout)

func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer([]byte{}, math.MaxInt32)
	// use getI(), getS(), getInts(), getF()

	s := strings.Split(getS(), "")
	out(s[0] + "UPC")
}

func out(x ...interface{}) {
	fmt.Fprintln(wr, x...)
}

func outStrings(x []string) {
	out(strings.Join(x, " "))
}

func outInts(x []int) {
	y := make([]string, len(x))
	for i := 0; i < len(x); i++ {
		y[i] = strconv.Itoa(x[i])
	}
	outStrings(y)
}

func getI() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getF() float64 {
	sc.Scan()
	i, e := strconv.ParseFloat(sc.Text(), 64)
	if e != nil {
		panic(e)
	}
	return i
}

func getInts(N int) []int {
	ret := make([]int, N)
	for i := 0; i < N; i++ {
		ret[i] = getI()
	}
	return ret
}

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

// min, max, aSub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

// min for n entry
func nMin(a ...int) int {
	ret := a[0]
	for _, e := range a {
		ret = min(ret, e)
	}
	return ret
}

// max for n entry
func nMax(a ...int) int {
	ret := a[0]
	for _, e := range a {
		ret = max(ret, e)
	}
	return ret
}

func chMin(a *int, b int) bool {
	if *a < b {
		return false
	}
	*a = b
	return true
}

func chMax(a *int, b int) bool {
	if *a > b {
		return false
	}
	*a = b
	return true
}

func aSub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

func lowerBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

提出情報

提出日時
問題 A - ?UPC
ユーザ taiga41
言語 Go (go 1.20.6)
得点 100
コード長 1951 Byte
結果 AC
実行時間 1 ms
メモリ 1632 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 100 / 100
結果
AC × 2
AC × 14
セット名 テストケース
Sample sample00.txt, sample01.txt
All sample00.txt, sample01.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt, testcase11.txt
ケース名 結果 実行時間 メモリ
sample00.txt AC 1 ms 1620 KiB
sample01.txt AC 1 ms 1624 KiB
testcase00.txt AC 1 ms 1620 KiB
testcase01.txt AC 1 ms 1620 KiB
testcase02.txt AC 1 ms 1628 KiB
testcase03.txt AC 1 ms 1628 KiB
testcase04.txt AC 1 ms 1624 KiB
testcase05.txt AC 1 ms 1628 KiB
testcase06.txt AC 1 ms 1624 KiB
testcase07.txt AC 1 ms 1632 KiB
testcase08.txt AC 1 ms 1624 KiB
testcase09.txt AC 1 ms 1624 KiB
testcase10.txt AC 1 ms 1628 KiB
testcase11.txt AC 1 ms 1628 KiB