QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#788891#8332. Two in OneaYi_7WA 0ms4096kbC++17696b2024-11-27 18:39:172024-11-27 18:39:17

Judging History

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

  • [2024-11-27 18:39:17]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:4096kb
  • [2024-11-27 18:39:17]
  • 提交

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'