QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#549357 | #9223. Data Determination | puppet# | WA | 0ms | 3696kb | C++14 | 933b | 2024-09-06 14:44:31 | 2024-09-06 14:44:31 |
Judging History
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+i,num+1+n,b)-num;
//cout<<u<<"\n";
if(u==i)
{
u+=1;
}
if(u<=n&&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: 3696kb
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'