Submission #1768435
Source Code Expand
using System; using System.Collections.Generic; using System.Linq; class Program { static StreamWriter sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false }; static Scan sc = new Scan(); static void Main() { int n = sc.Int; var a = sc.IntArr; Array.Sort(a); Prt(a[n - 1] - a[0]); sw.Flush(); } static void Prt(string a) { sw.WriteLine(a); } static void Prt<T>(IEnumerable<T> a) { Prt(string.Join(" ", a)); } static void Prt(params object[] a) { Prt(string.Join(" ", a)); } } class Scan { public int Int { get { return int.Parse(Str); } } public string Str { get { return Console.ReadLine().Trim(); } } public int[] IntArr { get { return StrArr.Select(int.Parse).ToArray(); } } public string[] StrArr { get { return Str.Split(new []{' '}, System.StringSplitOptions.RemoveEmptyEntries); } } }
Submission Info
Submission Time | |
---|---|
Task | B - Traveling AtCoDeer Problem |
User | riantkb |
Language | C# (Mono 4.6.2.0) |
Score | 0 |
Code Size | 927 Byte |
Status | CE |
Compile Error
./Main.cs(7,12): error CS0246: The type or namespace name `StreamWriter' could not be found. Are you missing `System.IO' using directive?