-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
78e3688
commit 7b8d819
Showing
13 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
A, B = map(int, input().split()) | ||
|
||
print(A+B) | ||
print(A-B) | ||
print(A*B) | ||
print(A//B) | ||
print(A%B) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
T = int(input()) | ||
for i in range(T): | ||
A, B = map(int, input().split()) | ||
print(A+B) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
while True: | ||
try: | ||
A, B = map(int, input().split()) | ||
print(A+B) | ||
except: | ||
break | ||
|
||
# import sys | ||
|
||
# for line in sys.stdin: | ||
# A, B = map(int, line.split()) | ||
# print(A+B) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
while True: | ||
A, B = map(int, input().split()) | ||
if A+B==0: | ||
break | ||
else: | ||
print(A+B) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import sys | ||
input = sys.stdin.readline | ||
|
||
T = int(input()) | ||
|
||
for _ in range(T): | ||
ox = list(input().rstrip()) | ||
cnt = 1 | ||
sum = 0 | ||
for index, i in enumerate(ox): | ||
if i == 'O': | ||
sum += cnt | ||
cnt += 1 | ||
else: | ||
cnt = 1 | ||
print(sum) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
str = input() | ||
print(ord(str)) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import sys | ||
input = sys.stdin.readline | ||
|
||
N = int(input()) | ||
|
||
for i in range(1, 10): | ||
print(f'{N} * {i} = {N*i}') |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import sys | ||
input = sys.stdin.readline | ||
|
||
N = int(input()) | ||
nums = list(map(int, input().split())) | ||
|
||
min = 1000000 | ||
max = -1000000 | ||
|
||
for num in nums: | ||
if num <= min: | ||
min = num | ||
for num in nums: | ||
if num >= max: | ||
max = num | ||
print(f'{min} {max}') |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
N = int(input()) | ||
nums = list(map(int, str(input()))) | ||
print(sum(nums)) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import sys | ||
input = sys.stdin.readline | ||
|
||
scale = list(map(int, input().split())) | ||
|
||
if scale == sorted(scale): | ||
print('ascending') | ||
elif scale == sorted(scale, reverse=True): | ||
print('descending') | ||
else: | ||
print('mixed') |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import sys | ||
input = sys.stdin.readline | ||
|
||
T = int(input()) | ||
for i in range(T): | ||
answer = '' | ||
R, S = map(str, input().split()) | ||
word = list(S) | ||
for w in word: | ||
answer += str(w)*int(R) | ||
print(answer) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from collections import defaultdict | ||
|
||
word = list(input().lower()) | ||
|
||
cnt_dict = defaultdict(int) | ||
for w in word: | ||
cnt_dict[w] += 1 | ||
|
||
answer = max(cnt_dict.keys(),key=lambda x: cnt_dict[x]) | ||
print(answer.upper()) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
words = input().split() | ||
print(len(words)) |