ens-ulm-1-2015

google hashcode 2015 source for team ens-ulm-1
git clone https://a3nm.net/git/ens-ulm-1-2015/
Log | Files | Refs

commit 1f08c46930643ff4b80001e75206c18ad169f5f2
parent ce00704899f9c14a6911cb1390382d7f0f164a3d
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Thu, 12 Mar 2015 19:43:54 +0100

fix

Diffstat:
a3nm/server.cpp | 10++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/a3nm/server.cpp b/a3nm/server.cpp @@ -41,7 +41,6 @@ int main() { int z, c; scanf("%d", &z); scanf("%d", &c); - printf("%d %d\n", z, c); serv.push_back(Server(i, z, c)); } @@ -101,12 +100,19 @@ int main() { capa[idx] += serv[i].c; gcapa[whererow][idx] += serv[i].c; for (int k = 0; k < serv[i].z; k++) - grid[whererow][wherecol] = 1; + grid[whererow][wherecol+k] = 2; fposr[serv[i].id] = whererow; fposc[serv[i].id] = wherecol; fgroup[serv[i].id] = idx; } } + + for (int i = 0; i < R; i++) { + for (int j = 0; j < S; j++) + putchar(grid[i][j] == 1? 'X' : (grid[i][j] == 2 ? 'O' : ' ')); + putchar('\n'); + } + // display sol for (int i= 0 ; i < M; i++) {