Submission #7998188


Source Code Expand

#include <iostream>
#include <cstdio>
#include <string>

//ranker
using namespace std;

#define REPS(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (int i = (a); i >= n; --i)
#define DEP(i, n) DEPS(i, n, 0)


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int N;
  cin >> N;

  int N2, N0;
  N2 = N/2;
  N0 = N%2;

  int A[N];

  int c[N]={0};
  int temp;
  REP(i, N){
  cin >> temp;
  c[temp]++;
}

  int ans = 0;
  if(N0==0){
    for(int i=1; i<N; i += 2){
      if(c[i] != 2){
        cout << 0 << endl;
        return 0;
      }
    }
  }

  if(N0==1){
      if(c[0] != 1){
        cout << 0 << endl;
        return 0;
      }
    for(int i=2; i<N; i += 2){
      if(c[i] != 2){
        ans = 0;
        cout << 0 << endl;
        return 0;
      }
    }
  }


  long long int tot = 1;
  REP(i, N2) (tot *= 2) %= 1000000000+7;
  cout << tot << endl;

  return 0;
}

Submission Info

Submission Time
Task A - Addition and Subtraction Easy
User alter0sss
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1036 Byte
Status RE
Exec Time 248 ms
Memory 97792 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 100
Status
WA × 2
WA × 3
RE × 7
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All sample_01.txt, sample_02.txt, subtask_1_01.txt, subtask_1_02.txt, subtask_1_03.txt, subtask_1_04.txt, subtask_1_05.txt, subtask_1_06.txt, subtask_1_07.txt, subtask_1_08.txt
Case Name Status Exec Time Memory
sample_01.txt WA 1 ms 256 KB
sample_02.txt WA 1 ms 256 KB
subtask_1_01.txt RE 97 ms 256 KB
subtask_1_02.txt WA 248 ms 97792 KB
subtask_1_03.txt RE 96 ms 256 KB
subtask_1_04.txt RE 97 ms 256 KB
subtask_1_05.txt RE 96 ms 256 KB
subtask_1_06.txt RE 96 ms 256 KB
subtask_1_07.txt RE 96 ms 256 KB
subtask_1_08.txt RE 96 ms 256 KB