QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#377315#7986. 游戏AChievedreaM#WA 1ms3764kbC++17538b2024-04-05 12:20:522024-04-05 12:20:53

Judging History

你现在查看的是最新测评结果

  • [2024-04-05 12:20:53]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3764kb
  • [2024-04-05 12:20:52]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using db=double;
const ll N=1e6+5;
ll a[N];
int main()
{
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	ll t,n,a,b;
	t=1;
	//cin>>t;
	while(t--)
	{
		map<ll,ll>mp;
		cin>>n;
		for(ll i=1;i<=n-1;i++)
		{
			cin>>a>>b;
			if(a>b)
				swap(a,b);
			mp[a]++;
		}
		ll f=1;
		for(auto s:mp)
		{
			if(s.second==1)
				f=0;
		}
		if(mp[1]==1)
			f=1;
		if(f)
			cout<<"You win, temporarily.";
		else
			cout<<"Wasted.";
	}
	return 0;
}


Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3628kb

input:

6
1 2
2 3
2 4
1 5
5 6

output:

Wasted.

result:

ok single line: 'Wasted.'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3764kb

input:

7
1 2
2 3
2 4
1 5
5 6
5 7

output:

You win, temporarily.

result:

ok single line: 'You win, temporarily.'

Test #3:

score: -100
Wrong Answer
time: 0ms
memory: 3492kb

input:

1

output:

You win, temporarily.

result:

wrong answer 1st lines differ - expected: 'Wasted.', found: 'You win, temporarily.'