code_jam_template
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
code_jam_template [2011/04/30 04:33] – created stephen | code_jam_template [2017/01/01 20:05] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 8: | Line 8: | ||
using System.IO; | using System.IO; | ||
using System.Linq; | using System.Linq; | ||
+ | |||
// Int32.MaxValue | // Int32.MaxValue | ||
// Int64.MaxValue | // Int64.MaxValue | ||
// UInt64.MaxValue = 18446744073709551615 = 18 446 744 073 709 551 615 = 1.844 10^19 | // UInt64.MaxValue = 18446744073709551615 = 18 446 744 073 709 551 615 = 1.844 10^19 | ||
+ | |||
class Program | class Program | ||
{ | { | ||
Line 19: | Line 19: | ||
private static int Parameter1; | private static int Parameter1; | ||
private static int Parameter2; | private static int Parameter2; | ||
+ | |||
static void Main(string[] args) | static void Main(string[] args) | ||
{ | { | ||
Stopwatch stopwatch = new Stopwatch(); | Stopwatch stopwatch = new Stopwatch(); | ||
stopwatch.Start(); | stopwatch.Start(); | ||
+ | |||
string filename = " | string filename = " | ||
+ | //string filename = " | ||
+ | //string filename = " | ||
using (StreamWriter sw = new StreamWriter(filename + " | using (StreamWriter sw = new StreamWriter(filename + " | ||
{ | { | ||
Line 31: | Line 33: | ||
{ | { | ||
String line; | String line; | ||
+ | |||
// Ignore the first line. | // Ignore the first line. | ||
sr.ReadLine(); | sr.ReadLine(); | ||
+ | |||
while ((line = sr.ReadLine()) != null) | while ((line = sr.ReadLine()) != null) | ||
{ | { | ||
- | var ints = line.Split(' | + | Console.WriteLine(line); |
- | + | ||
- | Parameter1 = ints[0]; | + | |
- | Parameter2 = ints[1]; | + | |
+ | var input = line.Split(' | ||
+ | |||
+ | Parameter1 = input[0]; | ||
+ | Parameter2 = input[1]; | ||
+ | |||
sw.Write(GetAnswer()); | sw.Write(GetAnswer()); | ||
+ | |||
TestCase++; | TestCase++; | ||
} | } | ||
} | } | ||
} | } | ||
+ | |||
stopwatch.Stop(); | stopwatch.Stop(); | ||
Console.WriteLine(stopwatch.ElapsedMilliseconds); | Console.WriteLine(stopwatch.ElapsedMilliseconds); | ||
} | } | ||
+ | |||
internal static string GetAnswer() | internal static string GetAnswer() | ||
{ | { | ||
- | |||
string answer = " | string answer = " | ||
code_jam_template.1304137987.txt.gz · Last modified: 2017/01/01 19:48 (external edit)