【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

相关推荐
一个不知名程序员www18 分钟前
算法学习入门---前缀和(C++)
c++·算法
jackzhuoa31 分钟前
Rust API 设计的零成本抽象原则:从语言基石到工程实践
算法·rust
Doc.S34 分钟前
【保姆级教程】在AutoDL容器中部署EGO-Planner,实现无人机动态避障规划
人工智能·python·信息可视化·机器人
骚戴36 分钟前
PDF或Word转图片(多线程+aspose+函数式接口)
java·开发语言
姓蔡小朋友38 分钟前
SpringDataRedis
java·开发语言·redis
yuuki23323339 分钟前
【数据结构】双向链表的实现
c语言·数据结构·后端
Predestination王瀞潞1 小时前
Python3:Eighth 函数
开发语言·python
蒋星熠1 小时前
多模态技术深度探索:融合视觉与语言的AI新范式
人工智能·python·深度学习·机器学习·分类·数据挖掘·多分类
夜晚中的人海1 小时前
【C++】分治-快速排序算法习题
开发语言·c++·排序算法
我不是彭于晏丶1 小时前
238. 除自身以外数组的乘积
数据结构·算法