QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#738770 | #9541. Expanding Array | zheng_zijian | WA | 0ms | 3856kb | C++20 | 485b | 2024-11-12 19:53:25 | 2024-11-12 19:53:26 |
Judging History
answer
#include <cstdio>
#include <set>
using namespace std;
void solve()
{
int n, las,now;
set<int> st;
st.insert(0);
scanf("%d",&n);
scanf("%d",&las);
st.insert(las);
for (int i = 2;i <= n;++i){
scanf("%d",&now);
st.insert(now);
st.insert(now | las);
st.insert(now & las);
st.insert(now ^ las);
las = now;
}
printf("%llu\n",st.size());
}
int main()
{
solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3856kb
input:
2 2 3
output:
4
result:
ok single line: '4'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
2 3 4
output:
4
result:
ok single line: '4'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3740kb
input:
2 3 5
output:
6
result:
wrong answer 1st lines differ - expected: '8', found: '6'