QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#779281#9541. Expanding ArrayoumashuWA 0ms31096kbC++17738b2024-11-24 18:10:512024-11-24 18:10:51

Judging History

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

  • [2024-11-24 18:10:51]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:31096kb
  • [2024-11-24 18:10:51]
  • 提交

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];
    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);
    }
    cout<<s.size();
}
signed main()
{
    ios;
    T=1;
    // cin>>T;
    while(T--)solve();
    return 0;
}

详细

Test #1:

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

input:

2
2 3

output:

4

result:

ok single line: '4'

Test #2:

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

input:

2
3 4

output:

4

result:

ok single line: '4'

Test #3:

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

input:

2
3 5

output:

7

result:

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