QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#864955 | #9541. Expanding Array | Poole_tea | WA | 0ms | 3584kb | C++14 | 628b | 2025-01-21 12:00:54 | 2025-01-21 12:00:54 |
Judging History
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'