QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#244521#5744. Palindromic Differencesucup-team870#WA 1ms3404kbC++14567b2023-11-09 11:08:542023-11-09 11:08:55

Judging History

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

  • [2023-11-09 11:08:55]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3404kb
  • [2023-11-09 11:08:54]
  • 提交

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'