結果

問題 No.333 門松列を数え上げ
ユーザー ebicochineal
提出日時 2016-06-06 00:22:58
言語 Go
(1.23.4)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 783 bytes
コンパイル時間 11,721 ms
コンパイル使用メモリ 229,996 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-11 00:58:55
合計ジャッジ時間 11,723 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

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

func main() {
    var A, B int;
    fmt.Scanf("%d %d", &A, &B)
    if A < B {
        Print(B-2)
    } else {
        Print(2000000000-B-1)
    }
}

func Print(x ...interface{}){
    l := len(x) + 1
    for ii, vi := range x {
        fmt.Print(vi)
        if ii == l {
            fmt.Print("\n")
        } else {
            fmt.Print(" ")
        }
    }
}
var sc = bufio.NewScanner(os.Stdin)
func Input() string {
    sc.Scan()
    return sc.Text()
}
func InputInt() int {
    sc.Scan()
    i, e := strconv.Atoi(sc.Text())
    if e != nil {panic(e)}
    return i
}
func BinCount(x int) int {
    s := fmt.Sprintf("%b", x)
    c := 0
    for _, i := range s {
        if i == '1' {c += 1}
    }
    return c
}
0