Created
April 10, 2019 16:43
-
-
Save autolyticus/46009b2eaa13bad28b69ce7b45a24bb6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # vim:fenc=utf-8 | |
| # | |
| # Copyright © 2019 g <g@host> | |
| # | |
| # Distributed under terms of the MIT license. | |
| # 11 - 1 | |
| n, m = map(int, input().split()) | |
| a = list(sorted((map(int, input().split())))) | |
| print(list(sorted([a[i+m-1] - a[i] for i in range(0, len(a)-m)]))[0], end='') | |
| # 11 - 2 | |
| print(*sorted(input().split(',')), sep=',', end='') | |
| # 11 - 3 | |
| a = input().split() | |
| print(*filter(lambda x: x != '0', a), *filter(lambda x: x == '0', a), end='') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment