Submission #2229550


Source Code Expand

#include <iostream>
#include <climits>
#include <stack>
#include <queue>
#include <string>
#include <random>
#include <utility>
#include <cmath>
#include <string.h>
#include <iomanip>
#include <stdlib.h>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
long long int INF = 1e18;
double Pi = 3.141592653589;
const int mod = 1000000007;
// memset(a,0,sizeof(a)); →全部0にする
 
struct edge{int to,cost;};
vector<int> G[100005];
 
int dx[8]={1,0,-1,0,1,1,-1,-1};
int dy[8]={0,1,0,-1,1,-1,-1,1};
 
std::vector<P> tree[100010];
ll i,j;

ll n,p;
long long int ans=0;
ll a=0,b=0;
//a=guusuu b=kisuu

ll nc(ll x,ll a){
	ll am=1;
	for(j=1;j<=a;j++){
		am *= (x+1-j);
	}
	for(j=1;j<=a;j++){
		am = am/j;
	}
	return am;
	
}



int main(){
	cin>>n>>p;
	
	for(i=1;i<=n;i++){
		cin>>j;
		if(j%2==0)a++;
		else b++;
	}
	for(i=p;i<=b;i+=2){
		ans += nc(b,i);
	}
	for(i=1;i<=a;i++){
		ans *= 2;
	}
	cout<<ans<<endl;
	return 0;
}

Submission Info

Submission Time
Task A - Biscuits
User enjapma
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1041 Byte
Status WA
Exec Time 4 ms
Memory 4992 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 200
Status
AC × 3
WA × 1
AC × 11
WA × 5
Set Name Test Cases
Sample sample1.txt, sample2.txt, sample3.txt, sample4.txt
All sample1.txt, sample2.txt, sample3.txt, sample4.txt, in1.txt, in2.txt, in3.txt, in4.txt, in5.txt, in6.txt, in7.txt, in8.txt, sample1.txt, sample2.txt, sample3.txt, sample4.txt
Case Name Status Exec Time Memory
in1.txt WA 4 ms 4992 KB
in2.txt WA 3 ms 4992 KB
in3.txt AC 3 ms 4992 KB
in4.txt AC 3 ms 4992 KB
in5.txt AC 3 ms 4992 KB
in6.txt WA 3 ms 4992 KB
in7.txt AC 3 ms 4992 KB
in8.txt AC 3 ms 4992 KB
sample1.txt AC 3 ms 4992 KB
sample2.txt AC 4 ms 4992 KB
sample3.txt AC 3 ms 4992 KB
sample4.txt WA 3 ms 4992 KB