From fe1a61e3695d9e50038aa794b46837531caa1617 Mon Sep 17 00:00:00 2001 From: licsber Date: Tue, 22 Nov 2022 15:20:08 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E5=BC=A0=E6=B3=BDl1.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ct/l1/星之卡比.py | 24 ++++++++++++++++++++++++ ct/l1/求阶乘位数.py | 19 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 ct/l1/星之卡比.py create mode 100644 ct/l1/求阶乘位数.py diff --git a/ct/l1/星之卡比.py b/ct/l1/星之卡比.py new file mode 100644 index 0000000..f08b846 --- /dev/null +++ b/ct/l1/星之卡比.py @@ -0,0 +1,24 @@ +import io +import sys + +sys.stdin = io.StringIO('''4 +5 5 5 +1 2 40 +10 5 41 +7 2 42''') + +# 80% +n = int(input()) + +flag = True +for _ in range(n): + chang, kuan, gao = map(int, input().split()) + if gao >= 41: + continue + + tiji = chang * kuan * gao + flag = False + print(tiji) + +if flag: + print(0) diff --git a/ct/l1/求阶乘位数.py b/ct/l1/求阶乘位数.py new file mode 100644 index 0000000..d6e7e86 --- /dev/null +++ b/ct/l1/求阶乘位数.py @@ -0,0 +1,19 @@ +import io +import sys + +sys.stdin = io.StringIO('''2 +10 +20''') + +from math import pi, e, log10, ceil + +m = int(input()) + +for _ in range(m): + num = int(input()) + if num == 0 or num == 1: + print(1) + continue + + digit = ceil(log10(float(2 * pi * num)) / 2 + num * log10(float(num / e))) + print(digit)