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
n = int(input()) | |
nums = list(map(int, input().split())) | |
h = [0 for _ in range(2005)] | |
for i in nums: | |
h[i] += 1 | |
cnt = 0 | |
for i in range(2005): | |
if h[i] >= 3: |
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
n = int(input()) | |
nums = list(map(int, input().split())) | |
h = [0 for _ in range(10)] | |
for num in nums: | |
for j in str(num): #123 "1" "2" "3" | |
h[int(j)] += 1 | |
print(*h) |
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
n = int(input()) | |
nums = list(map(int, input().split())) | |
h = [0 for _ in range(n+5)] | |
for i in nums: | |
h[i] += 1 | |
q = int(input()) | |
for _ in range(q): | |
x = int(input()) |
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
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
string s; | |
cin >> s; | |
int sum = 0; | |
for(int i = 0; i < s.length(); i++) | |
{ |
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
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
string s; | |
cin >> s; | |
for(int i = 0; i < s.length(); i++) | |
{ | |
if(islower(s[i])) |
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
n = int(input()) | |
list1 = list(map(int, input().split())) | |
list1.sort(); | |
cnt = 0 | |
for i in range(1, n): | |
if i == n-1: | |
if list1[i] == list1[i-1]: | |
cnt += 1 | |
else: | |
if list1[i] == list1[i-1] and list1[i] != list1[i+1]: |
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
n = int(input()) | |
list1 = list(map(int, input().split())) | |
sumList = 0 | |
for i in list1: | |
sumList += i | |
print(sumList) |
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
import math | |
n, k = map(int, input().split()) | |
nums = list(map(int, input().split())) | |
x = abs(sum(nums)) | |
print(math.ceil(x / k)) |
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
n = int(input()) | |
# 1 3 2 3 | |
list1 = list(map(int, input().split())) | |
x = int(input()) | |
cnt = 0 | |
for i in range(n): | |
for j in range(i + 1, n): | |
if list1[i] + list1[j] == x: | |
cnt += 1 | |
# print("Found:", list1[i], list1[j]) |
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
n = int(input()) | |
# 1 3 2 3 | |
list1 = list(map(int, input().split())) | |
x = int(input()) | |
cnt = 0 | |
for i in range(n): | |
for j in range(i + 1, n): | |
if list1[i] + list1[j] == x: | |
cnt += 1 | |
# print("Found:", list1[i], list1[j]) |