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 e9fb28a2f2ff52dd357fe4a60cf503994500baa3
parent 9959aeb116e5df5ae459fc77d8f8a6962ef796dc
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Thu, 12 Mar 2015 19:07:54 +0100

server

Diffstat:
a3nm/server.cpp | 56++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+), 0 deletions(-)

diff --git a/a3nm/server.cpp b/a3nm/server.cpp @@ -0,0 +1,56 @@ +#include <vector> +#include <cstdio> +#include <algorithm> +#include <map> + +using namespace std; + +#define MAXN 1002 + +typedef pair<int,int> pii; + +int main() { + int R, S, U, P, M; + vector<pii> serv; + char grid[MAXN][MAXN]; + int capa[MAXN]; + int gcapa[MAXN][MAXN]; + int fposx[MAXN], fposy[MAXN]; + + scanf("%d", &R); + scanf("%d", &S); + scanf("%d", &U); + scanf("%d", &P); + scanf("%d", &M); + for (int i = 0; i < U; i++) { + int r, s; + scanf("%d", &r); + scanf("%d", &s); + grid[r][s] = 1; + } + for (int i = 0; i < M; i++) { + int z, c; + scanf("%d", &z); + scanf("%d", &c); + serv.push_back(make_pair<int, int>(c/z, z)); + } + + sort(serv.begin(), serv.end()); + reverse(serv.begin(), serv.end()); + + for (int i = 0; i < M; i++) + serv[i].first *= serv.second; + + for (int i = 0; i < M; i++) { + // place serv[i] + } + + // display sol + + for (int i= 0 ; i < M; i++) { + + } + + return 0; +} +