Submission #28739768


Source Code Expand

Copy
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
)
const BUFSIZE = 10000000
var rdr *bufio.Reader
type PriorityQueue []int64
func (pq PriorityQueue) Len() int {
return len(pq)
}
func (pq PriorityQueue) Less(i, j int) bool {
return pq[i] < pq[j]
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
package main

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

const BUFSIZE = 10000000
var rdr *bufio.Reader

type PriorityQueue []int64

func (pq PriorityQueue) Len() int {
	return len(pq)
}

func (pq PriorityQueue) Less(i, j int) bool {
	return pq[i] < pq[j]
}

func (pq PriorityQueue) Swap(i, j int) {
	pq[i], pq[j] = pq[j], pq[i]
}

func (pq *PriorityQueue) Push(x interface{}) {
	old := *pq
	*pq = append(old, x.(int64))
}

func (pq *PriorityQueue) Pop() interface{} {
	old := *pq
	n := len(old) - 1
	x := old[n]
	*pq = old[:n]
	return x
}

// See: https://qiita.com/ktateish/items/ab2df3e0864d2e931bf2

// 一行をstringで読み込み
func readline() string {
	buf := make([]byte, 0, 16)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			fmt.Println(e.Error())
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

// 一行を[]intで読み込み
func readIntSlice() []int {
	slice := make([]int, 0)
	lines := strings.Split(readline(), " ")
	for _, v := range lines {
		// s2iはstringをintに変換する関数(後述)
		slice = append(slice, s2i(v))
	}
	return slice
}

// 一行を[]stringで読み込み
func readStringSlice() []string {
	lines := strings.Split(readline(), " ")
	return lines
}

func s2i(s string) int {
	v, ok := strconv.Atoi(s)
	if ok != nil {
		panic("Faild : " + s + " can't convert to int")
	}
	return v
}


func readint2() (int, int) {
	lines := strings.Split(readline(), " ")
	return s2i(lines[0]), s2i(lines[1])
}

func readint() int {
	lines := strings.Split(readline(), " ")
	return s2i(lines[0])
}

func max(values ...int) int {
	ret := values[0]
	for _, v := range values {
		if ret < v {
			ret = v
		}
	}
	return ret
}


func maxFloat(values ...float64) float64 {
	ret := values[0]
	for _, v := range values {
		if ret < v {
			ret = v
		}
	}
	return ret
}

func main()  {
	// BUFSIZEは大きなint値を指定しておく
	rdr = bufio.NewReaderSize(os.Stdin, BUFSIZE)
	resolve()
}

func resolve() {
	n,_ := readint2()
	srr := readStringSlice()
	trr := readStringSlice()

	dicts := make(map[string]bool,0)

	for _,tr := range trr {
		dicts[tr] = true
	}

	for i:=0;i<n;i++ {
		if dicts[srr[i]] {
			fmt.Println("Yes")
			continue
		}
		fmt.Println("No")
	}
}

Submission Info

Submission Time
Task C - Route Map
User villa_ak99
Language Go (1.14.1)
Score 300
Code Size 2397 Byte
Status AC
Exec Time 198 ms
Memory 17944 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 12
Set Name Test Cases
Sample example_00.txt, example_01.txt
All example_00.txt, example_01.txt, test_00.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt
Case Name Status Exec Time Memory
example_00.txt AC 6 ms 2172 KB
example_01.txt AC 1 ms 2164 KB
test_00.txt AC 198 ms 17944 KB
test_01.txt AC 193 ms 17364 KB
test_02.txt AC 140 ms 7556 KB
test_03.txt AC 91 ms 8368 KB
test_04.txt AC 173 ms 13408 KB
test_05.txt AC 188 ms 12548 KB
test_06.txt AC 175 ms 9672 KB
test_07.txt AC 122 ms 6208 KB
test_08.txt AC 41 ms 3548 KB
test_09.txt AC 104 ms 6856 KB


2025-02-28 (Fri)
05:22:40 +00:00