Advertisement
hsiuyee

B. I'll call him Hanya

Apr 27th, 2023
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. with open("hanya.in") as fd:
  2.     n = int(fd.readline())
  3.     for i in range(n):
  4.         x = int(fd.readline())
  5.         alist = fd.readline().split()
  6.         num = []
  7.         for j in alist:
  8.             num.append(int(j))
  9.         mini = 1
  10.         mini = min(num)
  11.         maxi = -1
  12.         maxi = max(num)
  13.         ans = 0
  14.         if(maxi>0):
  15.             ans = ans +1
  16.         if mini<0:
  17.             ans = ans +1
  18.         print(ans)
  19.            
  20.  
Tags: JCPC 2022
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement