Submission #2167718
Source Code Expand
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define rep(i,n) for(int i=0;i<(int)(n);i++) #define rep2(i,n) for(int i=1;i<=(int)(n);i++) #define rep3(i,n) for(int i=0;i<=(int)(n);i++) #define REP(i,m,n) for(int i=m;i<(int)(n);i++) #define repll(i,n) for(ll i=0;i<(ll)(n);i++) #define repll2(i,n) for(ll i=1;i<=(ll)(n);i++) #define REPLL(i,m,n) for(ll i=m;i<(ll)(n);i++) #define INF (int)1e9 // #define LINF (ll)4e18 // #define MOD (int)(1e9)+7 #define MP make_pair #define YES(n) cout << ((n) ? "YES" : "NO" ) << endl #define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl #define PI 3.1415926535898 //------------------------------------------------------ int main() { ll n; cin >> n; ll odd = 1; rep(i, n) { int a; cin >> a; if (a % 2 == 0) odd *= 2; } cout << (ll) pow(3, n) - odd << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Similar Arrays |
User | stoq |
Language | C++14 (GCC 5.4.1) |
Score | 200 |
Code Size | 990 Byte |
Status | AC |
Exec Time | 2 ms |
Memory | 512 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | subtask0_0.txt, subtask0_1.txt, subtask0_2.txt, subtask0_3.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, subtask0_0.txt, subtask0_1.txt, subtask0_2.txt, subtask0_3.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 2 ms | 512 KB |
02.txt | AC | 1 ms | 256 KB |
03.txt | AC | 1 ms | 256 KB |
04.txt | AC | 1 ms | 256 KB |
05.txt | AC | 1 ms | 256 KB |
06.txt | AC | 1 ms | 256 KB |
07.txt | AC | 1 ms | 256 KB |
subtask0_0.txt | AC | 1 ms | 256 KB |
subtask0_1.txt | AC | 1 ms | 256 KB |
subtask0_2.txt | AC | 1 ms | 256 KB |
subtask0_3.txt | AC | 1 ms | 256 KB |