Submission #1220860
Source Code Expand
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace AGC007Shik { class Program { static void Main(string[] args) { int H, W; string[] vals = Console.ReadLine().Split(' '); H = int.Parse(vals[0]); W = int.Parse(vals[1]); int[,] board = new int[H + 2, W + 2]; string line; int numStep = 0; for (int i=0; i < H; i++) { line = Console.ReadLine(); for (int j = 0; j < W; j++) { if (line[j] == '#') { board[i + 1, j + 1] = 1; numStep++; } } } int x = 1; int y = 1; numStep--; while(true) { if(x == W && y == H) { if (numStep == 0) Console.WriteLine("Possible"); else Console.WriteLine("Impossible"); return; } if(board[y, x+1] == 1) { x++; numStep--; } else if(board[y+1, x] == 1) { y++; numStep--; } else { Console.WriteLine("Impossible"); return; } } } } }
Submission Info
Submission Time | |
---|---|
Task | A - Shik and Stone |
User | hogeki |
Language | C# (Mono 4.6.2.0) |
Score | 200 |
Code Size | 1728 Byte |
Status | AC |
Exec Time | 20 ms |
Memory | 13140 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | example0.txt, example1.txt, example2.txt |
All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, example0.txt, example1.txt, example2.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
000.txt | AC | 20 ms | 9044 KB |
001.txt | AC | 19 ms | 11092 KB |
002.txt | AC | 20 ms | 11092 KB |
003.txt | AC | 20 ms | 11092 KB |
004.txt | AC | 19 ms | 9044 KB |
005.txt | AC | 19 ms | 9044 KB |
006.txt | AC | 20 ms | 13140 KB |
007.txt | AC | 20 ms | 11092 KB |
008.txt | AC | 20 ms | 13140 KB |
009.txt | AC | 19 ms | 9044 KB |
010.txt | AC | 20 ms | 11092 KB |
011.txt | AC | 20 ms | 11092 KB |
012.txt | AC | 19 ms | 9044 KB |
013.txt | AC | 20 ms | 11092 KB |
014.txt | AC | 19 ms | 9044 KB |
015.txt | AC | 19 ms | 11092 KB |
016.txt | AC | 20 ms | 13140 KB |
017.txt | AC | 20 ms | 11092 KB |
018.txt | AC | 20 ms | 11092 KB |
example0.txt | AC | 20 ms | 11092 KB |
example1.txt | AC | 20 ms | 11092 KB |
example2.txt | AC | 19 ms | 9044 KB |