Submission #1477821
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
#define maxn
#define FOR(i, l, r) for (int i=l; i<=r; ++i)
#define FORD(i, r, l) for (int i=r; i>=l; --i)
#define REP(i, r) for (int i=0; i<(int)r; ++i)
#define REPD(i, r) for (int i=(int)r-1; i>=0; --i)
#define fi first
#define se second
#define mk make_pair
#define nil NULL
#define y0 y902
#define y1 y232
#define x0 x92
#define x1 x899
#define next asdfa
#define sz size
#define Debug(X) {cerr << #X << " = " << X << '\n';}
#define PR(A, n) {cerr << #A << " = "; FOR(i, 1, n) cerr << A[i] << ' '; cerr << '\n';}
#define PR0(A, n) {cerr << #A << " = "; REP(i, n) cerr << A[i] << ' '; cerr << '\n';}
typedef long long ll;
typedef double db;
typedef pair<db, db> dd;
typedef pair<int, int> ii;
typedef vector<int> vi;
const int inf = 1e9;
template<class T> int getbit(T x, int pos) {return (x>>(pos-1)) & 1;}
template<class T> void turn_on(T &x, int pos) {x = x | ((T)1<<(pos-1));}
template<class T> void turn_off(T &x, int pos) {x = x & ~((T)1<<(pos-1));}
template<class T> T sqr(T a) {return a*a;}
int main() {
//freopen("biscuit.inp", "r", stdin);
//freopen("", "w", stdout);
//ios::sync_with_stdio(0); cin.tie(0);
int n, p;
bool odd = false;
scanf("%d%d", &n, &p);
FOR(i, 1, n) {
int x; scanf("%d", &x);
if (x%2) odd = true;
}
if (!odd) printf("%lld", p==1 ? 0 : 1LL<<(n));
else printf("%lld", 1LL<<(n-1));
}
Submission Info
Submission Time
2017-08-03 01:44:19+0900
Task
A - Biscuits
User
phong22kk11
Language
C++14 (GCC 5.4.1)
Score
200
Code Size
1466 Byte
Status
AC
Exec Time
1 ms
Memory
256 KB
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:39:26: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d", &n, &p);
^
./Main.cpp:41:31: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
int x; scanf("%d", &x);
^
Judge Result
Set Name
Sample
All
Score / Max Score
0 / 0
200 / 200
Status
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
AC
1 ms
256 KB
in2.txt
AC
1 ms
256 KB
in3.txt
AC
1 ms
256 KB
in4.txt
AC
1 ms
256 KB
in5.txt
AC
1 ms
256 KB
in6.txt
AC
1 ms
256 KB
in7.txt
AC
1 ms
256 KB
in8.txt
AC
1 ms
256 KB
sample1.txt
AC
1 ms
256 KB
sample2.txt
AC
1 ms
256 KB
sample3.txt
AC
1 ms
256 KB
sample4.txt
AC
1 ms
256 KB