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 d550a3d04cb26beaaf3dd7602ed3692f8cef3990
parent 8425737969395e0149d491b2bf2767bb2445286c
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Thu, 12 Mar 2015 19:11:13 +0100

compiles

Diffstat:
a3nm/server.cpp | 16+++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/a3nm/server.cpp b/a3nm/server.cpp @@ -12,10 +12,10 @@ typedef pair<int,int> pii; int main() { int R, S, U, P, M; vector<pii> serv; - char grid[MAXN][MAXN]; + char grid[MAXN][MAXN]; // row, col int capa[MAXN]; int gcapa[MAXN][MAXN]; - int fposx[MAXN], fposy[MAXN]; + int fposr[MAXN], fposc[MAXN], fgroup[MAXN]; scanf("%d", &R); scanf("%d", &S); @@ -39,16 +39,22 @@ int main() { reverse(serv.begin(), serv.end()); for (int i = 0; i < M; i++) - serv[i].first *= serv.second; + serv[i].first *= serv[i].second; + + for (int i = 0; i < M; i++) { + fposr[i] = fposc[i] = fgroup[i] = -1; + } for (int i = 0; i < M; i++) { // place serv[i] } // display sol - for (int i= 0 ; i < M; i++) { - + if (fposr[i] >= 0) + printf("%d %d %d\n", fposr[i], fposc[i], fgroup[i]); + else + printf("x\n"); } return 0;