QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#226647#5748. Determinant, or...?piaoyunWA 1ms3848kbC++20787b2023-10-26 12:35:452023-10-26 12:35:45

Judging History

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

  • [2023-10-26 12:35:45]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3848kb
  • [2023-10-26 12:35:45]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
#define otto auto
const int MAXN=1e6+10;
const int INF=1ll*1e7*1e9;
const int MOD = 1e9 + 9;

int T,N,M,K,P,Q;
int a[MAXN];

void solve(int l,int r){
	if(l == r) return;
	int mid = (l + r) >> 1;
	int len = mid - l + 1;
	for(int i = l;i <= mid; i++){
		a[i] -= a[i+len];
	}
	solve(l,mid);
	solve(mid+1,r);
}

void prepare(){
	scanf("%lld",&N);
	for(int i = 1;i <= (1<<N);i++){
		scanf("%lld",&a[i]);
	}
	solve(1,1<<N);
	int ans = 1;
	for(int i = 1;i <= (1<<N); i++){
		ans = ans * ((a[i] + MOD) % MOD) % MOD;
	}
	printf("%lld\n",ans);
}

signed main(){
	//ios::sync_with_stdio(0);
	T=1;
	//scanf("%lld",&T);
	while(T--){
	    prepare();
	}
	return 0;
}


詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3844kb

input:

1
5 2

output:

6

result:

ok 1 number(s): "6"

Test #2:

score: 0
Accepted
time: 1ms
memory: 3848kb

input:

2
3 1 5 4

output:

999999997

result:

ok 1 number(s): "999999997"

Test #3:

score: 0
Accepted
time: 1ms
memory: 3812kb

input:

3
53 37 42 42 84 37 66 8

output:

47229676

result:

ok 1 number(s): "47229676"

Test #4:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

3
762493332 721658786 22070969 135208254 466384641 652280022 979534282 601978718

output:

281502235

result:

ok 1 number(s): "281502235"

Test #5:

score: 0
Accepted
time: 0ms
memory: 3668kb

input:

3
129388930 489520730 263815343 315708585 263026886 153021985 251231378 649675390

output:

346896861

result:

ok 1 number(s): "346896861"

Test #6:

score: -100
Wrong Answer
time: 0ms
memory: 3596kb

input:

4
354170434 589724459 964138381 855919536 741407874 653645432 210017100 9041114 623557907 889004048 499789082 377902011 20698775 389133769 126649035 441324014

output:

-525742899

result:

wrong answer 1st numbers differ - expected: '474257110', found: '-525742899'