結果

問題 No.383 レーティング
ユーザー 💕💖💞
提出日時 2016-09-09 15:07:27
言語 Go
(1.23.4)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 602 bytes
コンパイル時間 13,561 ms
コンパイル使用メモリ 231,472 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-16 08:48:40
合計ジャッジ時間 12,609 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
	_ "math"
	_ "sort"
)


func main() {
	scanner := bufio.NewScanner(os.Stdin)
	th := 0
	tgt := []int{}
	for scanner.Scan() {
	  th += 1
		text := scanner.Text()
		if text == "" { break }
		for _, t := range strings.Split(text, " ") {
		  n, _ := strconv.Atoi(t) 
		  tgt = append(tgt, n)
	  }
		if th == 1 { break }
	}
	head, tail := tgt[0], tgt[1]
	//fmt.Println(head, tail)
	delta := tail - head
	if delta == 0 {
	  fmt.Println(delta)
	}else if delta > 0 {
	  fmt.Println("+" + strconv.Itoa(delta))
	}else {
	  fmt.Println(delta)
	}
}
0