QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#723205 | #8339. Rooted Tree | jokerT | WA | 0ms | 3804kb | C++20 | 1.2kb | 2024-11-07 21:25:20 | 2024-11-07 21:25:21 |
Judging History
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'