// 红方阵营类 class Red { public: int redNo = 0; int manCount[5] = {0, 0, 0, 0, 0}; int manBlood[5] = {2, 3, 4, 1, 0}; int sumBlood; int startMan = 0; int t;
Red(int n) : sumBlood(n) {}
int makeMan(int nown, string str) { for (int i = 0; i <5; ++i) { t = startMan % 5; if (sumBlood ++startMan; continue; } ++startMan; ++redNo; ++manCount[t]; sumBlood -= manBlood[t]; cout < return 1; } cout < return 0; } };
// 蓝方阵营类 class Blue { public: int blueNo = 0; int manCount[5] = {0, 0, 0, 0, 0}; int manBlood[5] = {3, 0, 1, 2, 4}; int sumBlood; int startMan = 0; int t;
Blue(int n) : sumBlood(n) {}
int makeMan(int nown, string str) { for (int i = 0; i <5; ++i) { t = startMan % 5; if (sumBlood ++startMan; continue; } ++startMan; ++blueNo; ++manCount[t]; sumBlood -= manBlood[t]; cout < return 1; } cout < return 0; } };
string getTime(int n) { if (n == 0) return "000"; string res = to_string(n); if (res.length() == 1) res = "00" + res; if (res.length() == 2) res = "0" + res; return res; }
int main() { int n; cin >> n; int* sumBloodArr = new int[n]; int (*manBloodArr)[5] = new int[n][5];
for (int i = 0; i cin >> sumBloodArr[i]; for (int j = 0; j <5; ++j) { cin >> manBloodArr[i][j]; } }
for (int i = 0; i cout <<"Case: " < Red redTeam(sumBloodArr[i]); Blue blueTeam(sumBloodArr[i]); bool f1 = true, f2 = true; int j = 0; while (f1 || f2) { if (f1) { f1 = redTeam.makeMan(i, getTime(j)); } if (f2) { f2 = blueTeam.makeMan(i, getTime(j)); } ++j; } }