Exemplo n.º 1
0
    static void Main(string[] args) {
        long t = DateTime.Now.Ticks;
        int N = int.Parse(Console.ReadLine());
        Game game = new Game();
        for (int i = 0; i < N; i++) {
            string room = Console.ReadLine();
            game.AddNode(room);
        }

        // Write an action using Console.WriteLine()
        // To debug: Console.Error.WriteLine("Debug messages...");

        Console.WriteLine(game.GetMax());
        Log.WriteLine("{0}ms", (DateTime.Now.Ticks - t) / 10000);
    }
Exemplo n.º 2
0
    static void Main(string[] args) {
        int width = int.Parse(Console.ReadLine()); // the number of cells on the X axis
        int height = int.Parse(Console.ReadLine()); // the number of cells on the Y axis
        Game game = new Game(width, height);
        for (int i = 0; i < height; i++) {
            string line = Console.ReadLine(); // width characters, each either 0 or .
            for (int j = 0; j < line.Length; j++)
                if (line[j] != '.') {
                    int links = int.Parse(line[j].ToString());
                    game.AddNode(j, i, links);
                }
        }

        // Write an action using Console.WriteLine()
        // To debug: Console.Error.WriteLine("Debug messages...");
        game.BuildNeighbors();
        game.Solve();
        //Console.WriteLine("0 0 1 0 0 1"); // Three coordinates: a node, its right neighbor, its bottom neighbor
    }