原题链接https://ac.nowcoder.com/acm/contest/11253/D
模拟把题中胜利的条件模拟出来就行了
#include <bits/stdc++.h>
using namespace std;
int check(int a,int b,int x,int y)
{
if(a==2&&b==8&&x==2&&y==8) return 0;
else if(a==2&&b==8) return 1;
else if(x==2&&y==8) return -1;
if(a==b&&x!=y) return 1;
else if(a!=b&&x==y) return -1;
else if(a==b&&x==y) return 0;
if(((a+b)%10)>((x+y)%10)) return 1;
else if(((a+b)%10)<((x+y)%10)) return -1;
else if(b>y) return 1;
else if(b<y) return -1;
return 0;
}
int main()
{
int n;
cin>>n;
while(n--)
{
int a,b,x,y;
scanf("%d%d%d%d",&a,&b,&x,&y);
if(a>b) swap(a,b);
if(x>y) swap(x,y);
int res=check(a,b,x,y);
if(res==1) cout<<"first"<<endl;
else if(res==-1) cout<<"second"<<endl;
else cout<<"tie"<<endl;
}
return 0;
}