QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#727050#9541. Expanding Arrayssx#WA 0ms3752kbC++20710b2024-11-09 11:11:092024-11-09 11:11:11

Judging History

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

  • [2024-11-09 11:11:11]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3752kb
  • [2024-11-09 11:11:09]
  • 提交

answer


#include<bits/stdc++.h>

using namespace std;

#define pll pair<ll, ll>
#define ll long long
const int mod = 1e9 + 7;
const int N = 2e5 + 50;


void solve()
{
    int n;
    cin>>n;
    vector<int> v(n);
    for(auto &i:v){
        cin>>i;
    }
    map<int,bool> mp;
    for(int i=1;i<n;i++){
        int a=v[i-1],b=v[i];
        mp[a]=1;
        mp[b]=1;
        mp[a&b]=1;
        mp[a|b]=1;
        mp[a^b]=1;
        mp[0]=1;
        mp[a&(!b)]=1;
        mp[b&(!a)]=1;
    }
    cout<<mp.size();
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll T = 1;
    //cin >> T;
    while (T --)
    {
        solve();
    }
    
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3752kb

input:

2
2 3

output:

4

result:

ok single line: '4'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

2
3 4

output:

4

result:

ok single line: '4'

Test #3:

score: -100
Wrong Answer
time: 0ms
memory: 3620kb

input:

2
3 5

output:

6

result:

wrong answer 1st lines differ - expected: '8', found: '6'