結果

問題 No.442 和と積
ユーザー 💕💖💞💕💖💞
提出日時 2016-11-19 21:11:37
言語 Go
(1.22.1)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 627 bytes
コンパイル時間 14,030 ms
コンパイル使用メモリ 211,812 KB
実行使用メモリ 4,476 KB
最終ジャッジ日時 2023-09-18 06:31:17
合計ジャッジ時間 15,007 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,356 KB
testcase_01 AC 2 ms
4,356 KB
testcase_02 AC 1 ms
4,476 KB
testcase_03 AC 1 ms
4,356 KB
testcase_04 AC 2 ms
4,352 KB
testcase_05 AC 1 ms
4,352 KB
testcase_06 AC 1 ms
4,356 KB
testcase_07 AC 1 ms
4,356 KB
testcase_08 AC 1 ms
4,356 KB
testcase_09 AC 2 ms
4,356 KB
testcase_10 AC 2 ms
4,356 KB
testcase_11 AC 1 ms
4,352 KB
testcase_12 AC 1 ms
4,356 KB
testcase_13 AC 1 ms
4,356 KB
testcase_14 AC 2 ms
4,356 KB
testcase_15 AC 1 ms
4,356 KB
testcase_16 AC 1 ms
4,352 KB
testcase_17 AC 1 ms
4,352 KB
testcase_18 AC 1 ms
4,356 KB
testcase_19 AC 1 ms
4,356 KB
testcase_20 AC 2 ms
4,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main
import (
  "bufio"
  "fmt"
  _ "math"
  "math/big"
  "os"
  _ "strconv"
  "strings"
)

func main() {
  scanner := bufio.NewScanner(os.Stdin)
  holder := []big.Int{}
  th := 0
  for scanner.Scan() {
    th += 1
    text := scanner.Text()
    for _, x2 := range strings.Split(text, " ") {
      bigint := *big.NewInt(0)
      bigint.SetString(x2, 10)
      holder = append(holder, bigint)
    }
    if th == 1 {
      break
    }
  }
  a, b := holder[0], holder[1]
  op_sum, op_mul := big.NewInt(0), big.NewInt(0)
  op_sum.Add(&a, &b)
  op_mul.Mul(&a, &b)
  fmt.Println(new(big.Int).GCD(nil, nil, op_sum, op_mul))
}
0