Posts

Showing posts from March, 2021

Codechef29 :

https://www.codechef.com/JUNE20B/problems/EOEO for _ in range(int(input())):     n=int(input())     count=0              if n%2 == 0:             a=n             count1=0             while a%2==0:                 a=a//2                 count1+=1             l=2 ** (count1+1)             count=n//l                      else:         count=n//2                       print(count)     

Codechef 30 :

https://www.codechef.com/JUNE20B/problems/CHFICRM for _ in range(int(input())):     n=int(input())     a=[int(i) for i in input().split()]     flag=0     dict={5:0,10:0,15:0}     if a[0]<=5:         for i in a:             if i==5:                 dict[5]+=1                 flag=1             elif i==10:                 if dict[5]>0:                     dict[10]+=1                     dict[5]-=1                     flag=1                 else:                     flag=0         ...

Codechef 28:

 https://www.codechef.com/CHNT2021/problems/CDHNT1 for _ in range(int(input())):     arr=input()          sum1=0     for i in arr :         if i =="#":             sum1+=1     print(sum1)          

Codechef 27:

 https://www.codechef.com/START1C/problems/COUPON2 for _ in range(int(input())):     d,c=input().split()     d=int(d)     c=int(c)          arr=[int(i) for i in input().split()]     arr1=[int(i) for i in input().split()]          sum1=0     sum2=0     for i in range(3):         sum1+= arr[i]         sum2+= arr1[i]          if sum1 >=150 and sum2>=150:         if sum1+sum2+c < sum1+sum2+ 2*d :             print("Yes")                      else:             print("No")     elif (sum1>=150 or  sum2>=150):         if sum1+sum2+d+c < sum1+sum2+d+d:             print("Yes")         ...

Codechef 26

 https://www.codechef.com/LTIME93C/problems/SMOL for _ in range(int(input())):     n,k=input().split()     n=int(n)     k=int(k)          if k==0:         print(n)     else:         print(n%k)                          

Codechef 25

 https://www.codechef.com/LTIME93C/problems/DIV03 for _ in range(int(input())):     arr=[int(i) for i in input().split()]     k=int(input())     flag=1          for i in range(9,-1,-1):         if flag==1:             r=k-arr[i]             arr[i]=r                  if r<0:             flag=0             if arr[i]>0:                 print(i+2)                 break         elif r==0:             flag=0             if arr[i]>0:                 print(i+1)                 break        ...