Submission #1700844


Source Code Expand

Copy
#include <iostream>
using namespace std;
long long int c(int a, int b){
  long long int ret = 1;
  for(int i = 0; i < b; ++i){
    ret *= (a - i);
  }
  for(int i = 0; i < b; ++i){
    ret /= (b + 1);
  }
  return ret;
}
int main(){
  int N;
  cin >> N;
  int A[N];
  for(int i = 0; i < N; ++i) cin >> A[i];
  int n = 0;
  for(int i = 0; i < N; ++i){
    if(A[i]%2 == 0) ++n;
  }
  long long int ans = 1;
  for(int i = 0; i < N; ++i){
    ans *= 3;
  }
  long long int t = 1;
  for(int i = 0; i < n; ++i){
    t *= 2;
  }
  cout << ans-t << endl;
  return 0;
}

Submission Info

Submission Time
Task B - Similar Arrays
User TAB
Language C++14 (GCC 5.4.1)
Score 200
Code Size 593 Byte
Status
Exec Time 1 ms
Memory 256 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 subtask0_0.txt, subtask0_1.txt, subtask0_2.txt, subtask0_3.txt
All 200 / 200 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 1 ms 256 KB
02.txt 1 ms 256 KB
03.txt 1 ms 256 KB
04.txt 1 ms 256 KB
05.txt 1 ms 256 KB
06.txt 1 ms 256 KB
07.txt 1 ms 256 KB
subtask0_0.txt 1 ms 256 KB
subtask0_1.txt 1 ms 256 KB
subtask0_2.txt 1 ms 256 KB
subtask0_3.txt 1 ms 256 KB