結果
問題 | No.716 距離 |
ユーザー | k.h |
提出日時 | 2019-08-06 18:05:59 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 439 bytes |
コンパイル時間 | 13,910 ms |
コンパイル使用メモリ | 220,056 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-18 14:15:09 |
合計ジャッジ時間 | 12,724 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 40 |
ソースコード
package main import ( "bufio" "fmt" "os" "strconv" ) func main() { sc := bufio.NewScanner(os.Stdin) sc.Split(bufio.ScanWords) sc.Scan() n, _ := strconv.Atoi(sc.Text()) min, max := 10000000001, 0 sc.Scan() f, _ := strconv.Atoi(sc.Text()) o := f var x int for i := 0; i < n-1; i++ { sc.Scan() x, _ = strconv.Atoi(sc.Text()) if min > x-o { min = x - o } o = x } max = x - f fmt.Println(min) fmt.Println(max) }