From d23c6dcb9c33fd371a7dd2a91300ae11321a0b53 Mon Sep 17 00:00:00 2001 From: Zeheng Li Date: Mon, 7 Oct 2024 10:54:10 -0600 Subject: [PATCH] add examples --- src/callforproblems.py | 3 +++ src/composedrhythms.py | 12 ++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 src/callforproblems.py create mode 100644 src/composedrhythms.py diff --git a/src/callforproblems.py b/src/callforproblems.py new file mode 100644 index 0000000..250f080 --- /dev/null +++ b/src/callforproblems.py @@ -0,0 +1,3 @@ +n = int(input()) +d = [int(input()) for _ in range(n)] +print(sum(v % 2 for v in d)) diff --git a/src/composedrhythms.py b/src/composedrhythms.py new file mode 100644 index 0000000..bf48f43 --- /dev/null +++ b/src/composedrhythms.py @@ -0,0 +1,12 @@ +n = int(input()) +threes = n // 3 +remainder = n % 3 +if remainder == 1: + twos = 2 + threes -= 1 +elif remainder == 2: + twos = 1 +else: + twos = 0 +print(threes + twos) +print(*(threes * ["3"] + twos * ["2"]))