QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#779302#9541. Expanding ArrayoumashuWA 4ms29504kbC++17851b2024-11-24 18:18:352024-11-24 18:18:35

Judging History

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

  • [2024-11-24 18:18:35]
  • 评测
  • 测评结果:WA
  • 用时:4ms
  • 内存:29504kb
  • [2024-11-24 18:18:35]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
#define ios ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
using namespace std;
const int N=1e6+10,mod=998244353;
typedef pair<int,int> pii;
int T;
int n,q,k,m,t;
int a[N],b[N];
vector<pii>g[N];
void solve()
{
    set<int>s;
    cin>>n;
    for(int i=1;i<=n;i++)cin>>a[i];
    // s.insert(0);
    for(int i=1;i<=n-1;i++)
    {
        int x=a[i]^a[i+1],y=a[i]&a[i+1],z=a[i]|a[i+1];
        s.insert(a[i]);s.insert(a[i+1]);
        s.insert(x);s.insert(y);s.insert(z);
        s.insert(a[i]^y);s.insert(a[i+1]^y);
        s.insert(a[i]^z);s.insert(a[i+1]^z);
        s.insert(a[i]&y);s.insert(a[i]|y);
        s.insert(a[i+1]&z);s.insert(a[i+1]|z);
    }
    cout<<s.size();
}
signed main()
{
    ios;
    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: 29504kb

input:

2
2 3

output:

4

result:

ok single line: '4'

Test #2:

score: 0
Accepted
time: 4ms
memory: 29380kb

input:

2
3 4

output:

4

result:

ok single line: '4'

Test #3:

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

input:

2
3 5

output:

7

result:

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