Submission #3607129
Source Code Expand
#include <cstdio> #include <vector> #include <algorithm> #define MOD 1000000007 typedef long long ll; using namespace std; int main() { ll n, ans = 1; scanf("%lld", &n); vector<ll> a(n); for (ll i = 0; i < n; ++i) scanf("%lld", a.begin() + i); sort(a.begin(), a.end()); for (ll i = n - 1; i >= 0; --i) { if (a.at(i) != (i + n % 2) / 2 * 2 + (n - 1) % 2) { printf("0\n"); return 0; } } for (ll i = 0; i < n / 2; ++i) ans = ans * 2 % MOD; printf("%lld\n", ans); return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Lining Up |
User | kyuko_haboro |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 582 Byte |
Status | AC |
Exec Time | 17 ms |
Memory | 1024 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:15:59: warning: format ‘%lld’ expects argument of type ‘long long int*’, but argument 2 has type ‘__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >’ [-Wformat=] for (ll i = 0; i < n; ++i) scanf("%lld", a.begin() + i); ^ ./Main.cpp:13:22: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%lld", &n); ^ ./Main.cpp:15:60: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] for (ll i = 0; i < n; ++i) scanf("%lld", a.begin() + i); ^
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 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 | 14 ms | 896 KB |
subtask_1_invalid_02.txt | AC | 4 ms | 384 KB |
subtask_1_max_01.txt | AC | 17 ms | 1024 KB |
subtask_1_max_02.txt | AC | 17 ms | 1024 KB |
subtask_1_max_valid_01.txt | AC | 17 ms | 1024 KB |
subtask_1_max_valid_02.txt | AC | 17 ms | 1024 KB |
subtask_1_min_valid_01.txt | AC | 1 ms | 256 KB |
subtask_1_rand_01.txt | AC | 10 ms | 768 KB |
subtask_1_rand_02.txt | AC | 16 ms | 896 KB |
subtask_1_valid_01.txt | AC | 10 ms | 640 KB |
subtask_1_valid_02.txt | AC | 4 ms | 384 KB |