結果
問題 | No.135 とりあえず1次元の問題 |
ユーザー | 14番 |
提出日時 | 2016-04-18 03:19:04 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,750 bytes |
コンパイル時間 | 4,142 ms |
コンパイル使用メモリ | 108,904 KB |
実行使用メモリ | 33,120 KB |
最終ジャッジ日時 | 2023-09-02 00:23:00 |
合計ジャッジ時間 | 5,232 ms |
ジャッジサーバーID (参考情報) |
judge16 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 131 ms
29,064 KB |
testcase_01 | AC | 62 ms
22,624 KB |
testcase_02 | AC | 64 ms
24,492 KB |
testcase_03 | WA | - |
testcase_04 | AC | 63 ms
20,524 KB |
testcase_05 | AC | 64 ms
22,580 KB |
testcase_06 | AC | 64 ms
24,612 KB |
testcase_07 | AC | 62 ms
20,600 KB |
testcase_08 | AC | 63 ms
20,704 KB |
testcase_09 | AC | 63 ms
24,484 KB |
testcase_10 | AC | 63 ms
22,508 KB |
testcase_11 | AC | 63 ms
24,604 KB |
testcase_12 | AC | 71 ms
22,648 KB |
testcase_13 | AC | 64 ms
22,676 KB |
testcase_14 | AC | 72 ms
20,652 KB |
testcase_15 | AC | 72 ms
22,732 KB |
testcase_16 | AC | 72 ms
24,744 KB |
testcase_17 | AC | 72 ms
22,668 KB |
testcase_18 | AC | 70 ms
22,612 KB |
testcase_19 | AC | 72 ms
24,708 KB |
testcase_20 | AC | 71 ms
22,740 KB |
testcase_21 | AC | 105 ms
29,984 KB |
testcase_22 | AC | 132 ms
33,120 KB |
evil01.txt | AC | 129 ms
29,268 KB |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections.Generic; using System.Text; using System.Linq; class Program { public void Proc() { Reader.IsDebug = false; int cnt = int.Parse(Reader.ReadLine()); int[] inpt = Reader.GetInt(); HashSet<int> tmp = new HashSet<int>(inpt); List<int> sorted = new List<int>(tmp); sorted.Sort(); int min = int.MaxValue; for(int i=1; i<sorted.Count; i++) { if(sorted[i] - sorted[i-1] < min) { min = sorted[i] - sorted[i-1]; } } Console.WriteLine(min); } private double GetDeliverCost(int fromPos, int toPos, double nimotsu) { int x1 = this.TargetList[fromPos].X; int y1 = this.TargetList[fromPos].Y; int x2 = this.TargetList[toPos].X; int y2 = this.TargetList[toPos].Y; double ans = GetMoveCost(x1, y1, x2, y2, nimotsu); ans += this.TargetList[toPos].Nimotsu; return ans; } private double GetMoveCost(int x1, int y1, int x2, int y2, double nimotsu) { double ans = (Math.Abs(x1-x2) + Math.Abs(y1-y2)) * ((nimotsu + 100) / 120d); return ans; } private List<Haitatsusaki> TargetList = new List<Haitatsusaki>(); public int StartX; public int StartY; public class Haitatsusaki { public int X; public int Y; public double Nimotsu; public Haitatsusaki(int x, int y, double nimotsu) { this.X = x; this.Y = y; this.Nimotsu = nimotsu; } } public class Reader { public static bool IsDebug = true; private static String PlainInput = @" 4 0 1 1 0 "; private static System.IO.StringReader Sr = null; public static string ReadLine() { if (IsDebug) { if (Sr == null) { Sr = new System.IO.StringReader(PlainInput.Trim()); } return Sr.ReadLine(); } else { return Console.ReadLine(); } } public static int[] GetInt(char delimiter = ' ', bool trim = false) { string inptStr = ReadLine(); if (trim) { inptStr = inptStr.Trim(); } string[] inpt = inptStr.Split(delimiter); int[] ret = new int[inpt.Length]; for (int i = 0; i < inpt.Length; i++) { ret[i] = int.Parse(inpt[i]); } return ret; } } static void Main() { Program prg = new Program(); prg.Proc(); } }