結果
問題 | No.780 オフ会 |
ユーザー |
![]() |
提出日時 | 2019-01-11 21:36:23 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,746 bytes |
コンパイル時間 | 14,092 ms |
コンパイル使用メモリ | 225,920 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-30 04:42:39 |
合計ジャッジ時間 | 15,048 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
ソースコード
package mainimport ("bufio""fmt""log""math""os""strconv")func main() {log.SetFlags(log.Lshortfile)a := nextInt() + 1b := nextInt()if b >= a {fmt.Print("YES\n")} else {fmt.Printf("NO\n")}fmt.Println(intAbs(a - b))}func intPow(a, b int) int {return int(math.Pow(float64(a), float64(b)))}func lcm(a, b int) int {return a * b / gcd(a, b)}func gcd(a, b int) int {if a < b {a, b = b, a}for b != 0 {a, b = b, a%b}return a}func intMax(a ...int) int {r := a[0]for i := 0; i < len(a); i++ {if r < a[i] {r = a[i]}}return r}func intMin(a ...int) int {r := a[0]for i := 0; i < len(a); i++ {if r > a[i] {r = a[i]}}return r}func intSum(a []int) (r int) {for i := range a {r += a[i]}return r}func intAbs(a int) int {if a < 0 {return -a}return a}type pair struct {a, b int}type pairs []pairfunc (p pairs) Len() int {return len(p)}func (p pairs) Swap(i, j int) {p[i], p[j] = p[j], p[i]}func (p pairs) Less(i, j int) bool {return p[i].b < p[j].b}var nextReader func() stringfunc init() {nextReader = newScanner()}func newScanner() func() string {r := bufio.NewScanner(os.Stdin)r.Buffer(make([]byte, 1024), int(1e+11))r.Split(bufio.ScanWords)return func() string {r.Scan()return r.Text()}}func nextString() string {return nextReader()}func nextInt64() int64 {v, _ := strconv.ParseInt(nextReader(), 10, 64)return v}func nextInt() int {v, _ := strconv.Atoi(nextReader())return v}func nextInts(n int) []int {r := make([]int, n)for i := 0; i < n; i++ {r[i] = nextInt()}return r}func nextFloat64() float64 {f, _ := strconv.ParseFloat(nextReader(), 64)return f}