QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#788891 | #8332. Two in One | aYi_7 | WA | 0ms | 4096kb | C++17 | 696b | 2024-11-27 18:39:17 | 2024-11-27 18:39:17 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int arr[2000009];
int main()
{
int tt=0;
scanf("%d",&tt);
while(tt--)
{
map<int,int>mp;
int n;
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
scanf("%d",&arr[i]);
mp[arr[i]]++;
}
int t=0;
map<int,int>::iterator it=mp.end();
it--;
int cnt1=it->second;
it--;
int cnt2=it->second;
int ans=0;
for(int i=0;i<=cnt1;i++)
{
for(int j=0;j<=cnt2;j++)
{
ans=max(ans,cnt1|cnt2);
}
}
printf("%d\n",ans);
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3816kb
input:
1 7 1 2 3 4 3 2 1
output:
3
result:
ok 1 number(s): "3"
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 4096kb
input:
1 9 1 1 1 1 1 2 2 2 2
output:
5
result:
wrong answer 1st numbers differ - expected: '7', found: '5'