Submission #29507807


Source Code Expand

Copy
package main
import (
"bufio"
"fmt"
"math"
"os"
"strconv"
"strings"
)
const BUFSIZE = 10000000
var rdr *bufio.Reader
func main() {
// BUFSIZEint
rdr = bufio.NewReaderSize(os.Stdin, BUFSIZE)
solve()
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
package main

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

const BUFSIZE = 10000000

var rdr *bufio.Reader

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

// 一行を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
}

// s2iはstringをintに変換する関数(後述)
func readint() int {
	return s2i(readline())
}

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

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

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

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

func i2s(i int) string {
	return strconv.Itoa(i)
}

// bool <-> int
func b2i(b bool) int {
	if b {
		return 1
	}
	return 0
}

func i2b(i int) bool {
	return i != 0
}

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

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

func is_prime(n int) bool {
	switch {
	case n < 2:
		return false
	case n == 2 || n == 3 || n == 5:
		return true
	case n&1 == 0:
		return false
	case n%2 == 0 || n%3 == 0 || n%5 == 0:
		return false
	}

	f := true
	v := 7
	m := int(math.Pow(float64(n), 0.5)) + 1
	for v < m {
		if n%v == 0 {
			return false
		}
		if f {
			v += 4
		} else {
			v += 2
		}
		f = !f
	}
	return true
}

func solve() {
	a, b := readint2()
	if a > b {
		a, b = b, a
	}

	if a == 1 && b == 10 {
		fmt.Println("Yes")
		return
	}

	if b-a > 1 {
		fmt.Println("No")
		return
	}

	fmt.Println("Yes")

}

Submission Info

Submission Time
Task A - Edge Checker
User villa_ak99
Language Go (1.14.1)
Score 100
Code Size 2559 Byte
Status AC
Exec Time 7 ms
Memory 2164 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 16
Set Name Test Cases
Sample example0.txt, example1.txt, example2.txt
All 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, example0.txt, example1.txt, example2.txt
Case Name Status Exec Time Memory
000.txt AC 7 ms 2160 KB
001.txt AC 2 ms 2160 KB
002.txt AC 3 ms 2148 KB
003.txt AC 2 ms 2152 KB
004.txt AC 2 ms 2152 KB
005.txt AC 3 ms 2148 KB
006.txt AC 3 ms 2152 KB
007.txt AC 2 ms 2164 KB
008.txt AC 2 ms 2148 KB
009.txt AC 2 ms 2152 KB
010.txt AC 3 ms 2164 KB
011.txt AC 2 ms 2164 KB
012.txt AC 3 ms 2152 KB
example0.txt AC 2 ms 2160 KB
example1.txt AC 3 ms 2148 KB
example2.txt AC 3 ms 2148 KB


2025-02-28 (Fri)
05:18:26 +00:00