QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#549330#9223. Data Determinationpuppet#WA 0ms3712kbC++14921b2024-09-06 14:31:462024-09-06 14:31:46

Judging History

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

  • [2024-09-06 14:31:46]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3712kb
  • [2024-09-06 14:31:46]
  • 提交

answer

#include<bits/stdc++.h>
#define ll long long
#define fi first
#define se second
using namespace std;
ll num[200005];
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
int main()
{
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	ll t;
	cin>>t;
	while(t--)
	{
		ll n,k,m;
		cin>>n>>k>>m;
		for(ll i=1;i<=n;i++)
		{
			cin>>num[i];
		}
		sort(num+1,num+1+n);
		ll flag=0;
		if(k&1)
		{
			for(ll i=1;i<=n;i++)
			{
				if(num[i]==m&&i-1>=(k-1)/2&&(n-i)>=(k-1)/2)
				{
					flag=1;
					break;
				}
			}
		}
		else
		{
			for(ll i=1;i<=n;i++)
			{
				ll b=2*m-num[i];
				ll u=lower_bound(num+1,num+1+n,b)-num;
				while(u<=n-1&&u<=i)
				{
					u++;
				}
				if(u!=i&&num[u]==b&&(i-1)>=k/2-1&&n-u>=k/2-1)
				{
					flag=1;
					break;
				}
			} 
		}
		if(flag==1)
		{
			cout<<"TAK"<<"\n";
		}
		else
		{
			cout<<"NTE"<<"\n";
		}
	}
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3712kb

input:

3
6 4 42
41 43 41 57 41 42
4 2 4
1 2 5 8
7 5 57
101 2 42 5 57 7 13

output:

TAK
NTE
NTE

result:

wrong answer 2nd lines differ - expected: 'NIE', found: 'NTE'