【CodinGame】趣味算法(教学用) CLASH OF CODE -20240802
创始人
2024-11-13 22:38:21
0

@[toc]


正文

最大最小值

image-20240802110206848

image-20240802110230914

import math import sys  # Auto-generated code below aims at helping you parse # the standard input according to the problem statement.  a = int(input()) b = int(input()) c = int(input()) d = int(input())  mylist = [] mylist.append(a) mylist.append(b) mylist.append(c) mylist.append(d)  print(max(mylist) - min(mylist)) 

移动距离

image-20240802110804575

image-20240802110825104

import sys import math  # Auto-generated code below aims at helping you parse # the standard input according to the problem statement.  n = int(input())  x,y = 0,0 for step in input().split():     if step == "L":         x -= 1     elif step == "R":         x += 1     elif step == "F":         y += 1     elif step == "B":         y -= 1     pass  print(int(math.sqrt(x**2+y**2)))  

简单判断


image-20240802111120225

import sys import math  # Auto-generated code below aims at helping you parse # the standard input according to the problem statement.  p = int(input()) h = int(input()) r = int(input())  if p*h>r:     print('YES') elif p*h==r:     print('BARELY') else:     print('NO') 

奇数平方和


image-20240802111415673

import sys import math  # Auto-generated code below aims at helping you parse # the standard input according to the problem statement.  n = int(input())  x = 1 sum = 0 for i in range(n):     sum += x**2     x += 2     pass print(sum) 

写在最后

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


END

本文由博客一文多发平台 OpenWrite 发布!

相关内容

热门资讯

迎来新发展!新天道怎么看底牌(... 迎来新发展!新天道怎么看底牌(辅助)切实是有辅助挂(有挂总结)-哔哩哔哩1)新天道怎么看底牌有没有挂...
详细透视!wpk官网下载链接,... 详细透视!wpk官网下载链接,wepokerplus万能挂,指南教程(有挂详细)-哔哩哔哩1、首先打...
分享透视!wepoker轻量版... 分享透视!wepoker轻量版透视方法,小程序微乐辅助器免费版,教材教程(揭秘有挂)-哔哩哔哩1、进...
来一盘!混沌休闲有没有挂,we... 来一盘!混沌休闲有没有挂,wepoker怎么获得好牌,窍要教程(有挂头条)-哔哩哔哩1、许多玩家不知...
出现新变化!心悦填大坑辅助器下... 出现新变化!心悦填大坑辅助器下载(辅助)本来真的是有辅助工具(确实有挂)-哔哩哔哩1、点击下载安装,...
关于透视!hhpoker透视脚... 关于透视!hhpoker透视脚本,wepoker怎么设置房间,指引教程(有挂讲解)-哔哩哔哩1、游戏...
了解透视!hhpoker软件可... 了解透视!hhpoker软件可以玩吗,微信小程序微乐家乡辅助器,操作教程(有挂方针)-哔哩哔哩1、h...
今日头条!!哈糖菠萝怎么挂,w... 今日头条!!哈糖菠萝怎么挂,wepoker辅助真的假的,诀窍教程(有挂透视)-哔哩哔哩;1、该软件可...
揭幕透视!hhpoker有辅助... 揭幕透视!hhpoker有辅助吗,德州hhpoker是真的吗,课程教程(有挂方式)-哔哩哔哩1、下载...
随着!呗兔挂透视挂开挂(辅助)... 随着!呗兔挂透视挂开挂(辅助)一直是真的辅助app(有挂技巧)-哔哩哔哩1、首先打开呗兔挂透视挂开挂...