AcWing 1695. 果壳游戏(模拟)

时间:2025-01-19 13:41:12
#include<bits/stdc++.h> #define x first #define y second using namespace std; typedef long long LL; typedef pair<int ,int> PII; const int N=1e5+10; const int mod=100000007; int n; int main(){ int a[5]={0,1,2,3}; int cnt[5]={0}; cin>>n; for(int i=0;i<n;i++){ int x,y,g; cin>>x>>y>>g; swap(a[x],a[y]); cnt[a[g]]++; } cout<<max(cnt[1],max(cnt[2],cnt[3])); return 0; }