QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#244521 | #5744. Palindromic Differences | ucup-team870# | WA | 1ms | 3404kb | C++14 | 567b | 2023-11-09 11:08:54 | 2023-11-09 11:08:55 |
Judging History
answer
#include <bits/stdc++.h>
#define rep(i,l,r) for(int i=l; i<=r; i++)
#define per(i,r,l) for(int i=r; i>=l; i--)
#define IOS {cin.tie(0);cout.tie(0);ios::sync_with_stdio(0);}
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int mod=1e9+9;
int a[2<<20];
ll cal(int l,int r){
if(l==r)return a[l];
int mid=(l+r)>>1;
ll v0=cal(l,mid),v1=cal(mid+1,r);
return ((v0*v1-v1*v1)%mod+mod)%mod;
}
int main() {
IOS
int n; cin>>n;
rep(i,0,(1<<n)-1)cin>>a[i];
cout<<cal(0,(1<<n)-1)<<"\n";
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3404kb
input:
5 3 2 3 1 4 1 1 1 1 3 1 2 4 7 0 200 0 200 50 100 150 14 -1 0 1 2 3 4 5 6 7 8 9 10 11 12
output:
611494699
result:
wrong answer 1st numbers differ - expected: '2', found: '611494699'