UOJ Logo

NOI.AC

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#183609#3294. 分配huyf1048100466ms1408kbC++111.7kb2023-08-09 12:07:182023-08-09 12:39:01

answer

#include<bits/stdc++.h>
#define ll long long
#define inf 0x3f3f3f3f3f3f3f3fLL
using namespace std;
ll n,x,a[1005],f[1005][2],dp[2][5005],flag;
vector<ll> s[1005];
void dfs(ll rt)
{
	if(!s[rt].size())
	{
		f[rt][0] = f[rt][1] = 0;
		return;
	}
	f[rt][0] = f[rt][1] = inf;
	for(ll i = 0;i < s[rt].size();i++)
	    dfs(s[rt][i]);
	for(ll i = 0;i <= a[rt];i++)
	    dp[0][i] = dp[1][i] = inf;
	dp[1][0] = 0;
	for(ll i = 0;i < s[rt].size();i++)
	{
	    for(ll j = 0;j <= a[rt];j++)
	    {
	    	dp[i & 1][j] = inf;
	    	if(j >= f[s[rt][i]][1])
	            dp[i & 1][j] = min(dp[i & 1][j],dp[(i & 1) ^ 1][j - f[s[rt][i]][1]] + a[s[rt][i]]);
	    	if(j >= a[s[rt][i]])
	            dp[i & 1][j] = min(dp[i & 1][j],dp[(i & 1) ^ 1][j - a[s[rt][i]]] + f[s[rt][i]][0]);
		}
	}
	for(ll i = 0;i <= a[rt];i++)
    	f[rt][0] = min(f[rt][0],dp[(s[rt].size() - 1) & 1][i]);
	for(ll i = 0;i <= a[rt];i++)
	    dp[0][i] = dp[1][i] = inf;
	dp[1][0] = 0;
	for(ll i = 0;i < s[rt].size();i++)
	{
	    for(ll j = 0;j <= a[rt];j++)
	    {
	    	dp[i & 1][j] = inf;
	    	if(j >= f[s[rt][i]][0])
	            dp[i & 1][j] = min(dp[i & 1][j],dp[(i & 1) ^ 1][j - f[s[rt][i]][0]] + a[s[rt][i]]);
	    	if(j >= a[s[rt][i]])
	            dp[i & 1][j] = min(dp[i & 1][j],dp[(i & 1) ^ 1][j - a[s[rt][i]]] + f[s[rt][i]][1]);
		}
	}
	for(ll i = 0;i <= a[rt];i++)
    	f[rt][1] = min(f[rt][1],dp[(s[rt].size() - 1) & 1][i]);
    if(f[rt][0] == inf || f[rt][1] == inf)
        flag = 1;
}
int main()
{
	scanf("%lld",&n);
	for(ll i = 2;i <= n;i++)
	    scanf("%lld",&x),s[x].push_back(i);
	for(ll i = 1;i <= n;i++)
	    scanf("%lld",&a[i]);
	dfs(1);
	if(flag)
	    printf("IMPOSSIBLE\n");
	else
	    printf("POSSIBLE\n");
    return 0;
}

Details

小提示:点击横条可展开更详细的信息

Subtask #1:

score: 20
Accepted

Test #1:

score: 20
Accepted
time: 0ms
memory: 1268kb

input:

20
1 2 1 3 2 4 6 7 6 4 10 11 8 4 14 3 5 10 11
8 21 13 15 10 1 0 8 12 17 15 0 12 0 0 2 13 1 3 4

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #2:

score: 0
Accepted
time: 1ms
memory: 1272kb

input:

20
1 1 3 4 4 6 3 3 4 5 2 12 4 11 9 4 4 5 9
37 0 21 29 11 0 4 0 0 6 12 8 0 0 0 0 0 7 10 6

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #3:

score: 0
Accepted
time: 0ms
memory: 1276kb

input:

20
1 1 3 2 1 1 1 7 3 4 4 2 9 13 14 5 7 10 12
42 13 17 13 8 0 15 15 2 13 6 5 10 0 0 0 0 8 2 0

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #4:

score: 0
Accepted
time: 0ms
memory: 1272kb

input:

20
1 2 1 3 5 1 4 3 2 4 6 7 5 14 5 7 15 15 11
63 0 26 25 26 0 14 0 0 0 9 0 14 0 0 13 7 0 11 6

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #5:

score: 0
Accepted
time: 1ms
memory: 1268kb

input:

20
1 2 1 1 1 1 3 2 5 8 5 7 4 5 12 9 11 18 2
9 2 0 8 13 0 7 7 2 0 0 0 0 8 0 0 0 0 0 9

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #6:

score: 0
Accepted
time: 0ms
memory: 1268kb

input:

20
1 1 2 3 4 3 7 6 4 1 6 8 13 6 8 11 14 5 1
17 24 6 4 4 2 6 6 9 0 0 0 3 6 2 15 0 3 4 7

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #7:

score: 0
Accepted
time: 0ms
memory: 1276kb

input:

20
1 1 3 4 1 3 3 2 3 2 9 9 5 14 14 12 13 10 11
44 13 31 1 15 0 15 0 22 1 0 0 4 17 1 0 0 9 0 1

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #8:

score: 0
Accepted
time: 0ms
memory: 1276kb

input:

20
1 2 3 2 5 3 7 6 1 2 10 10 1 1 9 14 4 13 10
52 4 15 12 16 13 0 1 13 15 9 13 9 12 2 0 7 2 15 0

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #9:

score: 0
Accepted
time: 1ms
memory: 1268kb

input:

20
1 2 3 3 4 3 5 2 1 9 1 11 11 3 7 15 3 1 1
16 10 22 3 10 0 9 1 0 0 3 0 0 0 0 0 0 0 0 0

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #10:

score: 0
Accepted
time: 1ms
memory: 1272kb

input:

20
1 1 3 1 4 3 2 6 9 10 4 5 3 10 13 1 10 6 19
47 21 47 20 0 0 0 15 17 17 9 0 0 15 8 0 0 0 0 0

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Subtask #2:

score: 30
Accepted

Test #11:

score: 30
Accepted
time: 0ms
memory: 1280kb

input:

100
1 1 2 2 3 2 7 7 1 6 5 10 3 10 11 12 4 3 14 11 19 15 22 10 14 7 5 13 8 1 7 10 10 30 15 17 24 18 3...

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #12:

score: 0
Accepted
time: 0ms
memory: 1280kb

input:

100
1 1 2 2 3 6 5 2 2 9 3 11 5 2 12 9 14 13 9 4 10 17 22 15 16 23 5 27 10 20 16 29 1 1 18 16 28 30 3...

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #13:

score: 0
Accepted
time: 0ms
memory: 1280kb

input:

100
1 2 3 2 2 2 3 1 3 1 5 7 6 2 13 16 8 11 4 14 7 1 11 10 23 6 6 3 29 17 10 29 21 21 2 19 36 10 18 1...

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #14:

score: 0
Accepted
time: 0ms
memory: 1280kb

input:

100
1 1 3 3 3 2 5 3 8 4 10 2 5 14 10 1 1 1 4 13 2 20 1 2 19 2 18 5 5 21 5 1 23 21 7 7 34 32 26 22 35...

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #15:

score: 0
Accepted
time: 0ms
memory: 1280kb

input:

100
1 2 1 4 2 2 2 8 6 3 2 11 9 1 5 2 17 4 14 3 15 4 15 18 6 18 13 9 10 2 24 8 28 27 19 10 4 8 16 30 ...

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #16:

score: 0
Accepted
time: 0ms
memory: 1276kb

input:

100
1 1 2 2 1 2 3 4 8 10 1 3 13 14 15 14 10 14 1 3 10 1 12 4 14 24 26 25 12 22 29 27 17 11 32 26 35 ...

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #17:

score: 0
Accepted
time: 0ms
memory: 1268kb

input:

100
1 1 3 3 4 2 7 8 8 8 4 5 9 8 6 16 9 9 19 1 16 17 4 12 1 14 14 1 19 7 19 3 22 26 35 30 19 36 11 25...

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #18:

score: 0
Accepted
time: 1ms
memory: 1272kb

input:

100
1 2 3 1 4 2 5 4 7 9 6 10 5 3 8 1 16 5 10 7 21 1 19 4 7 12 9 5 24 27 7 10 26 6 4 5 27 12 2 33 11 ...

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #19:

score: 0
Accepted
time: 0ms
memory: 1272kb

input:

100
1 1 3 2 3 4 2 1 6 6 8 11 9 4 15 3 6 10 17 17 13 19 17 12 19 2 14 9 7 12 27 18 31 20 16 16 22 6 9...

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #20:

score: 0
Accepted
time: 0ms
memory: 1276kb

input:

100
1 1 3 3 5 4 5 5 5 8 11 8 6 12 6 4 6 15 8 15 19 12 9 4 6 26 10 21 14 23 15 25 3 8 14 27 30 20 38 ...

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Subtask #3:

score: 50
Accepted

Test #21:

score: 50
Accepted
time: 0ms
memory: 1300kb

input:

1000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #22:

score: 0
Accepted
time: 40ms
memory: 1372kb

input:

1000
1 1 1 4 3 6 4 4 4 4 4 2 3 10 10 2 6 9 6 13 14 19 13 17 4 13 14 17 6 22 25 9 29 19 18 15 32 7 4 ...

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #23:

score: 0
Accepted
time: 52ms
memory: 1404kb

input:

1000
1 1 2 3 4 5 5 7 8 9 10 11 12 12 14 14 15 16 18 19 20 19 20 23 24 24 25 27 28 29 30 31 32 32 32 ...

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #24:

score: 0
Accepted
time: 0ms
memory: 1320kb

input:

1000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #25:

score: 0
Accepted
time: 7ms
memory: 1356kb

input:

1000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2...

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #26:

score: 0
Accepted
time: 11ms
memory: 1360kb

input:

1000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #27:

score: 0
Accepted
time: 11ms
memory: 1348kb

input:

1000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2...

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #28:

score: 0
Accepted
time: 26ms
memory: 1372kb

input:

1000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2...

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #29:

score: 0
Accepted
time: 19ms
memory: 1376kb

input:

1000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2...

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #30:

score: 0
Accepted
time: 28ms
memory: 1408kb

input:

1000
1 1 2 2 4 5 6 7 7 8 9 11 12 13 13 15 16 17 17 19 20 20 21 23 23 24 26 26 28 29 29 30 31 33 33 3...

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #31:

score: 0
Accepted
time: 29ms
memory: 1372kb

input:

1000
1 1 1 3 3 2 6 8 4 2 6 3 1 13 8 14 17 2 17 18 16 16 3 13 23 21 24 17 5 23 20 22 1 33 5 36 12 30 ...

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #32:

score: 0
Accepted
time: 11ms
memory: 1360kb

input:

500
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #33:

score: 0
Accepted
time: 5ms
memory: 1356kb

input:

1000
1 1 1 2 4 5 4 7 7 9 9 10 12 13 14 13 14 17 17 18 20 21 22 21 23 25 26 25 28 28 30 31 32 33 34 3...

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #34:

score: 0
Accepted
time: 0ms
memory: 1300kb

input:

1000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #35:

score: 0
Accepted
time: 3ms
memory: 1356kb

input:

1000
1 1 2 3 4 4 6 7 8 9 8 10 11 13 13 14 15 16 17 19 19 21 22 23 24 25 26 27 27 29 29 30 31 32 33 3...

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #36:

score: 0
Accepted
time: 0ms
memory: 1324kb

input:

1000
1 1 2 1 3 2 1 2 4 8 3 2 9 10 3 14 2 16 18 14 12 4 2 15 19 15 5 21 8 11 10 23 23 13 17 4 8 12 18...

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #37:

score: 0
Accepted
time: 6ms
memory: 1356kb

input:

1000
1 1 2 3 4 4 6 5 8 8 10 11 11 13 14 15 16 17 18 19 20 20 22 23 24 24 25 27 27 26 30 31 32 32 33 ...

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #38:

score: 0
Accepted
time: 7ms
memory: 1356kb

input:

1000
1 1 1 3 3 4 6 6 8 9 10 11 12 13 13 15 16 17 18 18 20 21 21 23 23 23 25 27 28 29 30 30 32 33 34 ...

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #39:

score: 0
Accepted
time: 3ms
memory: 1324kb

input:

1000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2...

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #40:

score: 0
Accepted
time: 0ms
memory: 1324kb

input:

1000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #41:

score: 0
Accepted
time: 35ms
memory: 1376kb

input:

1000
1 2 1 3 4 1 1 8 2 7 1 2 4 12 10 6 6 15 12 4 2 11 20 3 4 21 5 11 15 13 27 31 26 10 34 21 29 19 1...

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #42:

score: 0
Accepted
time: 33ms
memory: 1404kb

input:

1000
1 1 1 2 3 5 6 5 7 9 10 11 11 11 14 15 16 16 18 19 20 20 21 21 24 25 25 26 26 29 30 30 31 33 33 ...

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #43:

score: 0
Accepted
time: 22ms
memory: 1368kb

input:

1000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2...

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #44:

score: 0
Accepted
time: 19ms
memory: 1368kb

input:

1000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3...

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #45:

score: 0
Accepted
time: 11ms
memory: 1372kb

input:

1000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2...

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #46:

score: 0
Accepted
time: 4ms
memory: 1352kb

input:

1000
1 1 2 3 3 4 6 7 8 8 9 9 12 13 14 15 15 17 17 18 20 21 22 23 24 24 26 26 28 28 30 29 32 33 34 34...

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #47:

score: 0
Accepted
time: 2ms
memory: 1352kb

input:

1000
1 1 2 3 3 4 5 7 6 9 10 11 12 12 14 15 15 17 18 18 19 20 21 23 23 24 25 27 27 29 29 31 32 33 34 ...

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #48:

score: 0
Accepted
time: 3ms
memory: 1356kb

input:

1000
1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 15 17 17 18 20 20 22 23 24 25 25 27 28 29 29 29 32 33 34 ...

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #49:

score: 0
Accepted
time: 8ms
memory: 1360kb

input:

1000
1 1 1 3 4 5 6 6 8 9 10 10 12 12 14 15 16 17 18 19 20 21 22 23 24 25 26 26 28 29 30 30 31 33 34 ...

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #50:

score: 0
Accepted
time: 7ms
memory: 1360kb

input:

1000
1 1 2 3 4 4 6 7 8 9 9 11 12 13 13 15 16 16 18 19 20 20 21 22 23 24 26 26 27 28 30 31 32 32 34 3...

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #51:

score: 0
Accepted
time: 8ms
memory: 1352kb

input:

1000
1 1 2 3 4 3 6 6 8 9 10 10 12 12 14 15 16 17 18 18 20 21 21 23 24 24 26 25 28 29 30 31 31 33 34 ...

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #52:

score: 0
Accepted
time: 8ms
memory: 1356kb

input:

1000
1 1 2 2 4 5 6 7 8 7 9 11 12 12 14 15 15 17 17 18 20 21 22 22 24 25 26 27 28 28 29 31 31 32 34 3...

output:

POSSIBLE

result:

ok single line: 'POSSIBLE'

Test #53:

score: 0
Accepted
time: 8ms
memory: 1352kb

input:

1000
1 1 2 2 4 5 5 6 8 9 10 11 12 13 14 15 16 17 18 19 20 20 21 23 24 24 26 26 27 29 30 31 32 32 34 ...

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #54:

score: 0
Accepted
time: 7ms
memory: 1356kb

input:

1000
1 1 2 3 4 5 6 7 8 8 10 11 11 13 14 15 15 17 17 19 20 21 22 23 24 24 25 27 28 28 30 31 31 32 33 ...

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #55:

score: 0
Accepted
time: 7ms
memory: 1356kb

input:

1000
1 1 1 3 4 4 5 7 7 9 10 11 12 13 13 15 16 15 17 19 18 21 21 22 23 25 26 27 28 29 30 31 32 32 34 ...

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #56:

score: 0
Accepted
time: 7ms
memory: 1356kb

input:

1000
1 1 1 2 3 5 5 7 8 9 9 10 12 13 14 15 16 16 18 18 19 19 22 22 23 24 26 26 26 28 30 30 32 32 33 3...

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #57:

score: 0
Accepted
time: 7ms
memory: 1360kb

input:

1000
1 1 1 3 3 5 6 7 8 8 10 11 11 12 12 15 16 17 18 19 20 20 22 22 23 25 25 25 27 28 30 31 32 33 34 ...

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #58:

score: 0
Accepted
time: 3ms
memory: 1356kb

input:

1000
1 1 2 3 4 4 5 6 8 8 8 11 11 13 14 15 16 17 18 18 20 20 22 23 24 25 25 27 28 29 29 30 31 33 34 3...

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #59:

score: 0
Accepted
time: 4ms
memory: 1356kb

input:

1000
1 1 2 3 3 5 5 6 7 9 10 11 11 12 14 15 16 16 18 18 19 21 22 21 23 24 26 27 26 29 30 31 32 32 34 ...

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #60:

score: 0
Accepted
time: 0ms
memory: 1360kb

input:

1000
1 1 1 3 3 4 6 7 8 8 9 11 12 13 14 15 16 17 18 19 20 21 22 23 23 25 25 27 28 29 30 30 31 33 33 3...

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'