【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 发布!

相关内容

热门资讯

玩家必知教程!!浙江游戏大厅透... 您好,浙江游戏大厅这款游戏可以开挂的,确实是有挂的,需要了解加微【136704302】很多玩家在这款...
免费测试版开挂脚本!KELE多... 免费测试版开挂脚本!KELE多功能开挂脚本,KELE切实存在有开挂脚本KELE辅助器是一种具有地方特...
新手必备!凯旋麻将开挂脚本软件... 新手必备!凯旋麻将开挂脚本软件工具,凯旋麻将一直有开挂曝光APP(有挂攻略);凯旋麻将简单的透视挂控...
技巧知识分享外挂app!胡乐竞... 技巧知识分享外挂app!胡乐竞技多功能外挂app,胡乐竞技一直真的有外挂app1、很好的工具软件,可...
重大来袭!上游炸金花辅助器脚本... 重大来袭!上游炸金花辅助器脚本软件工具,上游炸金花最初有辅助器科普APP(果真有挂);上游炸金花是一...
技术分享辅助器工具!微乐江西麻... 技术分享辅助器工具!微乐江西麻将多功能辅助器工具,微乐江西麻将确实真的是有辅助器工具1、完成微乐江西...
实测教程!湖北雅苑麻将辅助挂脚... 实测教程!湖北雅苑麻将辅助挂脚本软件工具,湖北雅苑麻将起初是真的有辅助挂分享APP(有挂工具)是一款...
盘点几款外挂软件!大宝麻将多功... 盘点几款外挂软件!大宝麻将多功能外挂软件,大宝麻将原来存在有外挂软件大宝麻将脚本下载中分为三种模型:...
AI教程!微乐四川麻将辅助挂脚... AI教程!微乐四川麻将辅助挂脚本软件工具,微乐四川麻将果然有辅助挂分享APP(真实有挂);一、微乐四...
专业讨论辅助器技巧!开心娱乐多... 专业讨论辅助器技巧!开心娱乐多功能辅助器技巧,开心娱乐一贯真的是有辅助器技巧1、下载好开心娱乐透视辅...