#include <bits/stdc++.h>
using namespace std;
int main()
{
	long long a,b,sa=0,sb=0;
	cin>>a;
	if(a<0) a*=-1;
	while(a>9)
	{
		a/=10;
		sa++;
	}
	cin>>b;
	if(b<0) b*=-1;
	while(b>9)
	{
		b/=10;
		sb++;
	}
	if(sa>sb) cout<<"first";
	else if(sa<sb) cout<<"second";
	else if(sa==sb)
	{
		if(a>b) cout<<"first";
		else if(a<b) cout<<"second";
		else cout<<"same";
	}
	return 0;
}

2 comments

  • @ 2025-1-11 7:53:20

    ??????????

    • @ 2024-12-24 17:29:20

      你把 a,ba,b 都变成正数了还比较什么呢?

      对于 100%100\% 的数据,10100a,b10100-10^{100} \le a,b \le 10^{100}。保证给定的数符合正常数的书写规范。

      • 子任务 1(30 分):109a,b109-10^9\le a,b\le 10^9
      • 子任务 2(30 分):0a,b101000\le a,b\le 10^{100}
      • 子任务 3(40 分):没有特殊限制。
    • 1

    Information

    ID
    1591
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    7
    Tags
    (None)
    # Submissions
    48
    Accepted
    10
    Uploaded By