QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#723207#8332. Two in OnejokerTWA 0ms3492kbC++201.2kb2024-11-07 21:25:372024-11-07 21:25:38

Judging History

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

  • [2024-11-07 21:25:38]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3492kb
  • [2024-11-07 21:25:37]
  • 提交

answer

/*
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define sqrt(a) sqrtl(a)
#define abs(a) llabs(a)
#define pow(a) powl(a)
typedef  pair<int,int> pi ;
#define if1(x) for(int i =1 ;i<=x;i++)
#define if0(x) for(int i = 0;i<x;i++)
#define jf0(x) for(int j = 0;j<x;j++)
#define jf1(x) for(int j = 1;j<=x;j++)
#define pb push_back
const int mod = 1e9+7;
const int inf = 0x3f3f3f3f;
const int N = 2e5+10;
void solve(){
    int m,n;
    cin>>n;
    map<int,int> mp;
    int ans = 0;
    vector<int> num;
    if0(n){
        cin>>m;
        num.push_back(m);
        mp[m]++;
        auto  a = mp.rbegin();
        int b=0;
        if(mp.size() >1)
        b = prev(a)->second;
        else b = 0;
        ans = max(ans,(a->second | b));
    }
    mp.clear();
    for(int i = n-1;i>=0;i--){
        mp[m]++;
        auto  a = mp.rbegin();
        int b=0;
        if(mp.size() >1)
        b = prev(a)->second;
        else b = 0;
        ans = max(ans,(a->second | b));
    }

    cout<<ans<<endl;
}
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr); 
    int t=1;
    cin>>t;
    while (t--)
    {
        solve();
    }
    return 0;
}
/*


*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

1
7
1 2 3 4 3 2 1

output:

7

result:

wrong answer 1st numbers differ - expected: '3', found: '7'