QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#563226 | #8517. Interesting Paths | qwqwf# | WA | 0ms | 7768kb | C++14 | 1.1kb | 2024-09-14 08:12:20 | 2024-09-14 08:12:20 |
Judging History
answer
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2")
//#pragma GCC optimize("Ofast","unroll-loops","inline")
#include<bits/stdc++.h>
#define ll long long
#define int ll
#define pb push_back
#define pii pair<int,int>
#define MP make_pair
#define fi first
#define se second
using namespace std;
const int N=5e5+10,M=1e6+10,mod=1e9+7;
inline void Add(int &x,int y){x+=y;if(x>=mod) x-=mod;}
inline void Del(int &x,int y){x-=y;if(x<0) x+=mod;}
inline int del(int x,int y){x-=y;return x<0?x+mod:x;}
inline int add(int x,int y){x+=y;return x>=mod?x-mod:x;}
int n,f[N],a[N],s[N],v[62][2];
void solve(){
cin>>n;
for(int i=1;i<=n;i++) cin>>a[i],s[i]=s[i-1]^a[i];
f[0]=1;
for(int i=0;i<62;i++) v[i][0]=1;
for(int i=1;i<=n;i++){
int res=0;
for(int j=0;j<62;j++) Add(res,(1ll<<j)%mod*v[j][(s[i]>>j&1)^1]%mod);
// cout<<i<<' '<<res<<'\n';
f[i]=res;
for(int j=0;j<62;j++) Add(v[j][s[i]>>j&1],f[i]);
}
cout<<f[n]<<'\n';
}
signed main(){
// freopen("a.in","r",stdin);
// freopen("a.out","w",stdout);
ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
solve();
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 7768kb
input:
5 7 1 3 3 5 1 2 2 3 3 4 4 5 2 4
output:
1379
result:
wrong answer 1st numbers differ - expected: '4', found: '1379'