Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
1371 woaitutu123 果壳游戏 C++ 解答错误 0 MS 248 KB 552 2022-06-09 15:01:08

Tests(1/10):


#include<iostream> using namespace std; const int N = 100010; int n; struct x{ int a; int b; int g; }q[N]; int a[3][3]={{1,0,0}, {0,1,0}, {0,0,1}, }; int main() { cin >> n; for(int i = 0;i < n; i ++) cin >> q[i].a >> q[i].b >> q[i].g; int mx = -2e9; for(int j = 0; j < 3; j ++){ int m = 0; for(int i = 0; i < n; i ++){ swap(a[j][q[i].a] , a[j][q[i].b]); if(a[j][q[i].g] == 1) m ++; } if(mx < m) mx = m; } cout << mx << endl; return 0; }


测评信息: