This file contains 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
N = int(input()) | |
cards = ['1', '2', '3', '4', '5', '6'] | |
for i in range(N % 30): | |
a = cards[i % 5] | |
cards[i % 5] = cards[ i % 5 + 1] | |
cards[ i % 5 + 1] = a | |
print(cards[0] + cards[1] + cards[2] + cards[3] + cards[4] + cards[5]) |
This file contains 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
all = [] | |
for i in range(4): | |
list = input().split() | |
all.append(list) | |
for i in range(4): | |
print(all[3 - i][3] + ' ' + all[3 - i][2] + ' ' + all[3 - i][1] + ' ' + all[3 - i][0]) |
This file contains 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
print(int(input()) * 2) |
This file contains 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
N, K = map(int, input().split()) | |
Rs = map(int, input().split()) | |
Rs = sorted(Rs) | |
rate = 0.0; | |
for i in range(0, K): | |
rate = (rate + Rs[N-K+i])/2.0 | |
print(rate) |
This file contains 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
s = list(input()) | |
t = list(input()) | |
pattern = 'atcoder' | |
check = 0 | |
for i in range(0, len(s)): | |
ss = s[i] | |
tt = t[i] | |
if s[i] == '@' or t[i] == '@': | |
if pattern.find(s[i]) != -1: | |
ss = '@' |
This file contains 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
N = int(input()) | |
ave = (N + 1) * 5000 | |
print(ave) |
This file contains 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
brew install sl |
This file contains 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
import requests | |
def download(image_url): | |
res = requests.get(image_url, stream=True) | |
if res.status_code == 200: | |
image_name = image_url.split("/")[-1] | |
with open(image_name, 'wb') as file: | |
for chunk in res.iter_content(chunk_size=1048576): | |
file.write(chunk) |
This file contains 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
import requests | |
def download(image_url): | |
res = requests.get(image_url) | |
if res.status_code == 200: | |
image_name = image_url.split("/")[-1] | |
with open(image_name, 'wb') as file: | |
file.write(res.content) |
This file contains 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
for i in range(1, 100 + 1): | |
if i % 3 == 0 and i % 5 == 0: | |
print('FizzBuzz') | |
elif i % 3 == 0: | |
print('Fizz') | |
elif i % 5 == 0: | |
print('Buzz') | |
else: | |
print(i) |