Skip to content

Instantly share code, notes, and snippets.

@minus9d minus9d/golf_gophers.cpp Secret
Last active Apr 24, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.