AtCoder Beginner Contest 234 A~D

本次AtCoder Beginner Contest 234包括四道题目:A题要求解一个奇特的函数;B题涉及二维平面上点的最长距离计算;C题是一个关于0和2组成的数列问题,需要找出第n个数的值;D题是一个寻找前k大数的动态问题,通过优先队列实现。每道题目都涉及到不同的算法思想和数学技巧。
摘要由CSDN通过智能技术生成

A - Weird Function

题意:给一个方程,求值
在这里插入图片描述

#include<bits/stdc++.h>
#define ios ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
const int mod=1000000007;
const double eps=1e-8;
ll f(ll x)
{
   
	return x*x + 2 * x + 3;
}
ll t;
int main(){
   
	cin>>t;
	cout<<f(f(f(t) + t) + f(f(t)));
	return 0;
}

B - Longest Segment

题意:给一些二维平面的点,求两点间的最长距离

#include<bits/stdc++.h>
#define ios ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
const int mod=1000000007;
const double eps=1e-8;
struct node
{
   
	double x,y;
}no[110];
double dis(double a,double b,double a1,double b1)
{
   
	return pow((a-a1)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值