Contest Duration: ~ (local time) (110 minutes) Back to Home

Submission #905420

Source Code Expand

Copy
```#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<string>
#include<stack>
#include<cstdio>
#include<cmath>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,P> P1;

#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define rep(i,x) for(int i=0;i<x;i++)
#define rep1(i,x) for(int i=1;i<=x;i++)
#define rrep(i,x) for(int i=x-1;i>=0;i--)
#define rrep1(i,x) for(int i=x;i>0;i--)
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
#define mp1(a,b,c) P1(a,P(b,c))

const int INF=1000000000;
const int dir_4[4][2]={{1,0},{0,1},{-1,0},{0,-1}};
const int dir_8[8][2]={{1,0},{1,1},{0,1},{-1,1},{-1,0},{-1,-1},{0,-1},{1,-1}};

int main(){
int n;
int a[102];
scanf("%d",&n);
rep(i,n)scanf("%d",&a[i]);

int MAX = 0;
rep(i,n)MAX = max ( MAX , a[i] );

int cnt[102] = {};
rep(i,n){
cnt[a[i]] ++;
}

for(int i = 1 ; i*2 < MAX ; i ++){
if(cnt[i] > 0){
puts("Impossible");
return 0;
}
}
if(cnt[MAX/2] > 1){
puts("Impossible");
return 0;
}
puts("Possible");
}
```

#### Submission Info

Submission Time 2016-10-01 21:27:28+0900 C - Tree Restoring yokozuna57 C++14 (GCC 5.4.1) 0 1390 Byte WA 2 ms 384 KB

#### Compile Error

```./Main.cpp: In function ‘int main()’:
./Main.cpp:40:16: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&n);
^
./Main.cpp:41:27: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
rep(i,n)scanf("%d",&a[i]);
^
```

#### Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 example0, example1, example2, example3, example4, example5
All 0 / 700 almostline0, almostline1, almostline2, almostline3, can0, can1, can2, can3, can4, can5, can6, deg0, deg1, deg2, deg3, example0, example1, example2, example3, example4, example5, handmade0, line0, line1, line2, line3, ng10, ng11, ng12, ng13, ng20, ng21, ng22, ng23, plus0, plus1, plus2, plus3, rand0, rand1, rand2, star0, star1, star2, star3
Case Name Status Exec Time Memory
almostline0 2 ms 256 KB
almostline1 2 ms 256 KB
almostline2 2 ms 256 KB
almostline3 2 ms 256 KB
can0 2 ms 256 KB
can1 2 ms 256 KB
can2 2 ms 256 KB
can3 2 ms 256 KB
can4 2 ms 256 KB
can5 2 ms 256 KB
can6 2 ms 256 KB
deg0 2 ms 256 KB
deg1 2 ms 256 KB
deg2 2 ms 256 KB
deg3 2 ms 256 KB
example0 2 ms 256 KB
example1 2 ms 256 KB
example2 2 ms 256 KB
example3 2 ms 256 KB
example4 2 ms 256 KB
example5 2 ms 256 KB
line0 2 ms 256 KB
line1 2 ms 256 KB
line2 2 ms 256 KB
line3 2 ms 256 KB
ng10 2 ms 256 KB
ng11 2 ms 256 KB
ng12 2 ms 256 KB
ng13 2 ms 384 KB
ng20 2 ms 256 KB
ng21 2 ms 256 KB
ng22 2 ms 256 KB
ng23 2 ms 256 KB
plus0 2 ms 256 KB
plus1 2 ms 256 KB
plus2 2 ms 256 KB
plus3 2 ms 256 KB
rand0 2 ms 256 KB
rand1 2 ms 256 KB
rand2 2 ms 256 KB
star0 2 ms 256 KB
star1 2 ms 256 KB
star2 2 ms 256 KB
star3 2 ms 256 KB