結果

問題 No.136 Yet Another GCD Problem
ユーザー yuki2006
提出日時 2015-03-07 09:16:46
言語 Go
(1.23.4)
結果
RE  
実行時間 -
コード長 512 bytes
コンパイル時間 12,075 ms
コンパイル使用メモリ 233,680 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-10 03:27:16
合計ジャッジ時間 13,061 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other RE * 39
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

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

var s = bufio.NewScanner(os.Stdin)

func next() string {
	s.Split(bufio.ScanWords)
	s.Scan()
	return s.Text()
}

func nextInt() int {
	i, e := strconv.Atoi(next())
	if e != nil {
		panic(e)
	}
	return i
}
func nextLong() int64 {
	i, e := strconv.ParseInt(next(), 10, 64)
	if e != nil {
		panic(e)
	}
	return i
}
func main() {
	N := nextInt()
	_ = nextInt()
	ans := 0
	for i := 2; i*i <= N; i++ {
		if N%i == 0 {
			ans = N/i
		}
	}
	fmt.Println(ans)

}
0