ss_

https://inf-ege.sdamgia.ru/test?theme=416

ss_
Apr 29th, 2021
756
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import numpy as np
  2.  
  3. # file_in = '27-demo.txt'  # 32
  4. file_in = '27-B_demo.txt'  # 399762080
  5. # file_in = '27-A_demo.txt'  # 127127
  6.  
  7. x = np.fromfile(file_in, sep=' ', dtype=np.int16)
  8. count = x[0]
  9. array = x[1:].reshape(count, 2)
  10. array = np.sort(array)
  11. sum_ = array[:, 1].sum()
  12.  
  13. array = np.array(sorted(array.tolist(), key=lambda x: x[1] - x[0])).reshape(count, 2)
  14.  
  15. for elem in array:
  16.     if (sum_ - elem[1] + elem[0]) % 3 != 0:
  17.         break
  18. print(sum_ - elem[1] + elem[0])
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×