Skip to content

Instantly share code, notes, and snippets.

@minus9d
Last active April 24, 2019 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minus9d/d0e607dfb304bbb64d738fa3a8103ee5 to your computer and use it in GitHub Desktop.
Save minus9d/d0e607dfb304bbb64d738fa3a8103ee5 to your computer and use it in GitHub Desktop.
Google Code Jam 2019 Round 1A Golf Gophers
#include <numeric>
#include <iostream>
#include <vector>
using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
#define REP(i,n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i,a,b) for(int i = (a); i < (int)(b); ++i)
#define ALL(c) (c).begin(), (c).end()
#define SIZE(v) ((int)v.size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
void flush_blades(vector<int>& blades) {
REP(i, SIZE(blades)) {
if (i == 0) cout << blades[i];
else cout << " " << blades[i];
}
cout << endl;
cout << flush;
}
vector<int> read_res() {
vector<int> res(18);
REP(n, 18) cin >> res[n];
return res;
}
void solve(int N, int M) {
int ans = 0;
REP(n, N) {
vector<int> blades(18, 18);
flush_blades(blades);
vector<int> res = read_res();
ans = max(ans, accumulate(ALL(res), 0));
}
cout << ans << endl;
cout << flush;
int verdict;
cin >> verdict;
if (verdict == -1) {
exit(-1);
}
}
int main(void)
{
cin.sync_with_stdio(false);
int T, N, M;
cin >> T >> N >> M;
REP(t, T) {
solve(N, M);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment