1. 通过打表法记录输赢
2.通过%控制循环周期
3.用两个变量进行累加
#include <bits/stdc++.h>
using namespace std;
int a[205], b[205];
int main() {int vs[5][5] = { {0,0,1,1,0},{1,0,0,1,0},{0,1,0,0,1},{0,0,1,0,1},{1,1,0,0,0} };int n, na, nb;cin >> n>>na>>nb;for (int i = 0; i < na; i++) {cin >> a[i];}for (int i = 0; i < nb; i++) {cin >> b[i];}int x = 0, y = 0;for (int i = 0; i < n; i++) {x += vs[a[i % na]][b[i % nb]];y += vs[b[i % nb]][a[i % na]];}cout << x << ' ' << y;return 0;
}