QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#864955#9541. Expanding ArrayPoole_teaWA 0ms3584kbC++14628b2025-01-21 12:00:542025-01-21 12:00:54

Judging History

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

  • [2025-01-21 12:00:54]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3584kb
  • [2025-01-21 12:00:54]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std ;
const int MAXN = 2e5 + 10 ;
int a[MAXN] ;
int main () {
    int n ;
    cin >> n ;
    for (int i = 1 ; i <= n ; i++) cin >> a[i] ;
    set<int> s ;
    for (int i = 1 ; i <= n - 1 ; i++) {
        int x = a[i] | a[i + 1] ;
        s.insert(x) ;
        x = a[i] & a[i + 1] ;
        s.insert(x) ;
        x = a[i] ^ a[i + 1] ;
        s.insert(x) ;
        x = (a[i] | a[i + 1]) ^ (a[i]) ;
        s.insert(x) ;
        x = (a[i] | a[i + 1]) ^ (a[i + 1]) ;
        s.insert(x) ;
    }
    s.insert(0) ;
    s.insert(a[n]) ;
    cout << s.size() << '\n' ;
}

詳細信息

Test #1:

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

input:

2
2 3

output:

4

result:

ok single line: '4'

Test #2:

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

input:

2
3 4

output:

4

result:

ok single line: '4'

Test #3:

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

input:

2
3 5

output:

7

result:

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