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

Tests(0/10):


#include <bits/stdc++.h> using namespace std; int a[10500],b[10500],c[10500],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++; cout<<endl<<x<<" "<<endl; for(int i=1;i<=3;i++) cout<<g[i]<<" "; } maxn=max(maxn,x); g[i]=0; } cout<<maxn; return 0; }


测评信息: