【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

相关推荐
gb421528718 分钟前
java中将租户ID包装为JSQLParser的StringValue表达式对象,JSQLParser指的是?
java·开发语言·python
THMAIL22 分钟前
量化股票从贫穷到财务自由之路 - 零基础搭建Python量化环境:Anaconda、Jupyter实战指南
linux·人工智能·python·深度学习·机器学习·金融
~-~%%24 分钟前
从PyTorch到ONNX:模型部署性能提升
人工智能·pytorch·python
一朵梨花压海棠go24 分钟前
html+js实现表格本地筛选
开发语言·javascript·html·ecmascript
蒋星熠29 分钟前
Flutter跨平台工程实践与原理透视:从渲染引擎到高质产物
开发语言·python·算法·flutter·设计模式·性能优化·硬件工程
翻滚丷大头鱼1 小时前
Java 集合Collection—List
java·开发语言
小欣加油1 小时前
leetcode 面试题01.02判定是否互为字符重排
数据结构·c++·算法·leetcode·职场和发展
3Cloudream1 小时前
LeetCode 003. 无重复字符的最长子串 - 滑动窗口与哈希表详解
算法·leetcode·字符串·双指针·滑动窗口·哈希表·中等
王璐WL1 小时前
【c++】c++第一课:命名空间
数据结构·c++·算法
爬虫程序猿1 小时前
《京东商品详情爬取实战指南》
爬虫·python