Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
27511 King 果壳游戏 C++ 解答错误 0 MS 256 KB 374 2023-08-12 11:07:05

Tests(1/10):


#include <bits/stdc++.h> using namespace std; int a[105],b[105],c[105],g[5],x,maxn; int main() { int n; cin>>n; for(int i=1;i<=n;i++) cin>>a[i]>>b[i]>>c[i]; for(int i=1;i<=3;i++) { x=0; g[i]=1; for(int j=1;j<=n;j++) { swap(g[a[j]],g[b[j]]); if(g[c[j]]==1) x++; } maxn=max(maxn,x); g[i]=0; } cout<<maxn; return 0; }


测评信息: