QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#553866 | #8332. Two in One | Hog_Dawa_IOI | WA | 0ms | 1628kb | C++14 | 588b | 2024-09-08 21:37:52 | 2024-09-08 21:37:53 |
Judging History
answer
#include<stdio.h>
int t,n,s,ci[100005];
int main()
{
scanf("%d",&t);
while(t--)
{
for(int i=1;i<=n;i++) ci[i]=0;
scanf("%d",&n);
for(int i=1;i<=n;i++) scanf("%d",&s),ci[s]++;
int k1=0,k2=0;
for(int i=1;i<=n;i++) if(ci[i]>=ci[k1]) k1=i;
for(int i=1;i<=n;i++) if(ci[i]>=ci[k2]&&i!=k1) k2=i;
int ans=ci[k1]|ci[k2],dq=ci[k1]&ci[k2],mi=1,nono=1;
while(mi<=dq)
{
if(mi&dq) nono=mi;
mi*=2;
}
printf("%d\n%d %d\n%d %d\n",ans|(nono-1),1,1,1,1);
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 1628kb
input:
1 7 1 2 3 4 3 2 1
output:
3 1 1 1 1
result:
wrong answer Output contains longer sequence [length = 5], but answer contains 1 elements