結果

問題 No.185 和風
ユーザー むらためむらため
提出日時 2018-12-16 09:39:44
言語 Nim
(2.0.2)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 283 bytes
コンパイル時間 3,748 ms
コンパイル使用メモリ 71,424 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-13 21:35:43
合計ジャッジ時間 3,783 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 3 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 47) Warning: imported and not used: 'macros' [UnusedImport]
/home/judge/data/code/Main.nim(1, 54) Warning: imported and not used: 'strformat' [UnusedImport]
/home/judge/data/code/Main.nim(1, 41) Warning: imported and not used: 'sugar' [UnusedImport]
/home/judge/data/code/Main.nim(1, 36) Warning: imported and not used: 'math' [UnusedImport]

ソースコード

diff #

import sequtils,strutils,algorithm,math,sugar,macros,strformat
template get*():string = stdin.readLine().strip()

let n = get().parseInt()
let XY = newSeqWith(n,get().split().map(parseInt)).mapIt(it[1] - it[0]).sorted(cmp)
if XY[0] == XY[^1] and XY[0] > 0 : echo XY[0]
else: echo -1
0