Attempted codeforces Div-2 Round 248 couldn't even solve a single problem :'( very sad though I managed to look at other people's solutions on the site and got the concepts, but still my rating will go haywire :(
So problem 1 was basically ad-hoc :- Problem 1 here
algorithm to deal with it :-
BEGIN
input n
for i in range (1,n)
input temp
if(temp==100)
hundredcount++
else
twohundredcount++
[end of loop]
if (hundredcount%2==1) [if hundred count is odd]
print("NO")
else if(hundredcount==0 and twohundredcount%2==1)[hundred count is zero and two hundred count is odd]
print("NO")
else
print("YES")
END
So problem 1 was basically ad-hoc :- Problem 1 here
algorithm to deal with it :-
BEGIN
input n
for i in range (1,n)
input temp
if(temp==100)
hundredcount++
else
twohundredcount++
[end of loop]
if (hundredcount%2==1) [if hundred count is odd]
print("NO")
else if(hundredcount==0 and twohundredcount%2==1)[hundred count is zero and two hundred count is odd]
print("NO")
else
print("YES")
END
No comments:
Post a Comment