QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#723205#8339. Rooted TreejokerTWA 0ms3804kbC++201.2kb2024-11-07 21:25:202024-11-07 21:25:21

Judging History

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

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

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;
}
/*


*/

詳細信息

Test #1:

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

input:

6 2

output:

2
2
2
2
2
2

result:

wrong answer 1st numbers differ - expected: '18', found: '2'