Hackpads are smart collaborative documents. Join Hackpad Now.
2498 days ago
Unfiled. Edited by 百千.IO 2498 days ago
  • def there_is_repeat_in_(a_list):
  •   return True if len(set(a_list)) < 9 else False
  • while True:
  •   try:
  •     matrix_9x9 = [ input().split() for _ in range(9) ]
  •     for row in matrix_9x9:
  •       if there_is_repeat_in_(row):
  •         print('no')
  •         break
2510 days ago
Unfiled. Edited by 百千.IO 2510 days ago
  • while True:
  •   try:
  •     a,b,N=input().split()
  •     a,b,N=int(a),int(b),int(N)
  •     answer=str(10**N*a//b)
  •     n=len(answer)
  •     if N>=n:
  •       print('0.'+'0'*(N-n)+answer[-N:])
  •     else:
2544 days ago
Unfiled. Edited by 百千.IO 2544 days ago
A串用index方法搜尋最多2*len(B)次 => TLE
  • 當每個b都是A[-1]
  • input()
  • A = input().split()
  • B = input().split()
  • for b in B:
  •   if b in A:
  •     print(A.index(b)+1)
  •   else:
2611 days ago
Unfiled. Edited by 百千.IO 2611 days ago
  • while True:
  •     try:
  •         n=int(input())
  •         lines=[]
  •         for _ in range(n):
  •             lines.append([int(x) for x in input().split()])
  •         lines.sort()
  •  
  •         length=0
2614 days ago
Unfiled. Edited by 陳靖 2614 days ago
  • while True:
  •   try:
  •     sequence=[int(i) for i in input().split()]
  •     n=sequence[0]
  •     d=list(range(1,n))
  •     for i in range(1,n):
  •       try:
  •         d.remove(abs(sequence[i]-sequence[i+1]))
  •       except:
2614 days ago
Unfiled. Edited by 嚼嚼 2614 days ago
  • def is_happy(n):
  •   if n==1:
  •     return True
  •   if count>100:
  •     return False
  •   global count
  •   count+=1
  •   N=0
  •   for i in str(n):

Stop sharing the collection with ?

This pad is open to "", so will still be able to access it.
Cancel
Feed

Contact Support



Please check out our How-to Guide and FAQ first to see if your question is already answered! :)

If you have a feature request, please add it to this pad. Thanks!


Log in / Sign up