请问,这道题,这样输入对吗?好像会re

P1838 三子棋I

@[telankesi](/user/866969) 不会RE,而且试一试不就好了吗
by gongziwen @ 2022-12-30 21:18:16


# [博客地址](https://www.ricemoon.cn/) ```cpp #include <bits/stdc++.h> using namespace std; #define LL long long #define endl "\n" const int N = 1e5 + 10; void solve() { string s; cin >> s; int a[N], b[N]; vector<vector<int>> v = {{1, 2, 3}, {1, 5, 9}, {1, 4, 7}, {2, 5, 8}, {3, 6, 9}, {4, 5, 6}, {7, 8, 9}, {3, 5, 7}}; for (int i = 0; i < s.size(); i ++ ) { if (i & 1) { b[s[i] - '0'] = 2; } else { a[s[i] - '0'] = 1; } } for (int i = 0; i < v.size(); i ++ ) { if (a[v[i][0]] == 1 and a[v[i][1]] == 1 and a[v[i][2]] == 1) { cout << "xiaoa wins." << endl; return; } if (b[v[i][0]] == 2 and b[v[i][1]] == 2 and b[v[i][2]] == 2) { cout << "uim wins." << endl; return; } } cout << "drew." << endl; } int main() { ios::sync_with_stdio(false); cin.tie(0); solve(); return 0; } ```
by Roger_Spencer @ 2023-02-19 09:47:55


|