Submission #1215875
Source Code Expand
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <functional>
#include <array>
#include <map>
#include <queue>
#include <limits.h>
#include <set>
#include <stack>
#include <random>
#include <time.h>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#define rep(i,s,n) for(int i = (s); (n) > i; i++)
#define REP(i,n) rep(i,0,n)
#define RANGE(x,a,b) ((a) <= (x) && (x) <= (b))
#define DUPLE(a,b,c,d) (RANGE(a,c,d) || RANGE(b,c,d) || RANGE(c,a,b) || RANGE(d,a,b))
#define INCLU(a,b,c,d) (RANGE(a,c,d) && (b,c,d))
#define PW(x) ((x)*(x))
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MODU 1000000007
#define bitcheck(a,b) ((a >> b) & 1)
#define bitset(a,b) ( a |= (1 << b))
#define bitunset(a,b) (a &= ~(1 << b))
#define MP(a,b) make_pair((a),(b))
#define Manh(a,b) (abs((a).first-(b).first) + abs((a).second - ((b).second))
#define pritnf printf
#define scnaf scanf
#define itn int
#define PI 3.141592653589
#define izryt bool
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T &val) {
std::fill((T*)array, (T*)(array + N), val);
}
int mod_pow(int x, int n, int mod) {
ll res = 1;
while (n > 0) {
if (n & 1) res = res * x %mod;
x = x*x%mod;
n >>= 1;
}
return res;
}
signed main() {
int n;
scanf("%d", &n);
map<int, int> cou, cor;
REP(i, n) {
int a;
scanf("%d", &a);
cou[a]++;
cor[abs(i - (n - i - 1))]++;
}
if (cor != cou)
printf("0\n");
else
printf("%d\n", mod_pow(2, n/2, MODU));
return 0;
}
Submission Info
Submission Time |
|
Task |
C - Lining Up |
User |
Gear |
Language |
C++14 (GCC 5.4.1) |
Score |
0 |
Code Size |
1792 Byte |
Status |
WA |
Exec Time |
51 ms |
Memory |
5504 KB |
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:62:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n);
^
./Main.cpp:68:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &a);
^
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
0 / 300 |
Status |
|
|
Set Name |
Test Cases |
Sample |
sample_01.txt, sample_02.txt, sample_03.txt |
All |
sample_01.txt, sample_02.txt, sample_03.txt, subtask_1_invalid_01.txt, subtask_1_invalid_02.txt, subtask_1_max_01.txt, subtask_1_max_02.txt, subtask_1_max_valid_01.txt, subtask_1_max_valid_02.txt, subtask_1_min_valid_01.txt, subtask_1_rand_01.txt, subtask_1_rand_02.txt, subtask_1_valid_01.txt, subtask_1_valid_02.txt |
Case Name |
Status |
Exec Time |
Memory |
sample_01.txt |
AC |
1 ms |
256 KB |
sample_02.txt |
AC |
1 ms |
256 KB |
sample_03.txt |
AC |
1 ms |
256 KB |
subtask_1_invalid_01.txt |
AC |
39 ms |
4224 KB |
subtask_1_invalid_02.txt |
AC |
8 ms |
1024 KB |
subtask_1_max_01.txt |
AC |
50 ms |
5504 KB |
subtask_1_max_02.txt |
AC |
51 ms |
5504 KB |
subtask_1_max_valid_01.txt |
WA |
49 ms |
4992 KB |
subtask_1_max_valid_02.txt |
WA |
50 ms |
4992 KB |
subtask_1_min_valid_01.txt |
AC |
1 ms |
256 KB |
subtask_1_rand_01.txt |
AC |
29 ms |
3456 KB |
subtask_1_rand_02.txt |
AC |
47 ms |
5120 KB |
subtask_1_valid_01.txt |
WA |
25 ms |
2816 KB |
subtask_1_valid_02.txt |
WA |
9 ms |
1152 KB |