Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
960 yy040 果壳游戏 C++ 通过 0 MS 252 KB 381 2022-05-28 09:52:33

Tests(10/10):


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


测评信息: