【CodinGame】趣味算法(教学用) CLASH OF CODE -20240804

文章目录


正文

python 复制代码
import math
import sys

# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.

n = int(input())
j = 1
h = 0

for i in range(1, n + 1):
    j *= i
    h += i

print(j)
print(h)

python 复制代码
import sys
import math

# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.

h = int(input())

for i in range(6):
    h = h*2

print(h)

python 复制代码
import sys
import math

# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.

a, b = [int(i) for i in input().split()]
n = int(input())
for i in range(n):
    x = int(input())
    print(a*x + b)

python 复制代码
import sys
import math

# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.

time = int(input())
speed = int(input())

# Write an answer using print
# To debug: print("Debug messages...", file=sys.stderr, flush=True)

print(int(time/60*speed))

python 复制代码
import sys
import math

# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.

count = int(input())
for i in input().split():
    n = int(i)
    print(f"[x] {n}" if n % 2 != 0 else f"[ ] {n}")

写在最后

欢迎技术类的问题到这里提出,我会逐个解答


END

相关推荐
会员源码网1 小时前
使用`mysql_*`废弃函数(PHP7+完全移除,导致代码无法运行)
后端·算法
木心月转码ing2 小时前
Hot100-Day10-T438T438找到字符串中所有字母异位词
算法
HelloReader3 小时前
Wi-Fi CSI 感知技术用无线信号“看见“室内的人
算法
颜酱6 小时前
二叉树分解问题思路解题模式
javascript·后端·算法
zone77396 小时前
001:简单 RAG 入门
后端·python·面试
F_Quant6 小时前
🚀 Python打包踩坑指南:彻底解决 Nuitka --onefile 配置文件丢失与重启报错问题
python·操作系统
允许部分打工人先富起来7 小时前
在node项目中执行python脚本
前端·python·node.js
IVEN_7 小时前
Python OpenCV: RGB三色识别的最佳工程实践
python·opencv
qianpeng8977 小时前
水声匹配场定位原理及实验
算法
haosend8 小时前
AI时代,传统网络运维人员的转型指南
python·数据网络·网络自动化