首页 > 其他分享 >B. Amr and Pins( Codeforces Round #287 (Div. 2))

B. Amr and Pins( Codeforces Round #287 (Div. 2))

时间:2023-09-27 16:33:02浏览次数:38  
标签:aa lf% x1 Codeforces x2 y1 Pins Div y2

B. Amr and Pins(  Codeforces Round #287 (Div. 2))_#include

B. Amr and Pins(  Codeforces Round #287 (Div. 2))_数据_02

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>

int main()
{
    double r,x1,y1,x2,y2;
    while(scanf("%lf%lf%lf%lf%lf",&r,&x1,&y1,&x2,&y2)!=EOF)
    {
        double aa = sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
        int tt = 0;
        if(aa==0)
        {
            printf("0\n");
        }
        else if(aa<=2*r)
        {
            printf("1\n");
        }
        else
        {
            while(aa>2*r)
            {
                aa=aa-2*r;
                tt++;
            }
            printf("%d\n",tt+1);
        }
    }
    return 0;
}

B. Amr and Pins(  Codeforces Round #287 (Div. 2))_数据_03

B. Amr and Pins(  Codeforces Round #287 (Div. 2))_ci_04

B. Amr and Pins(  Codeforces Round #287 (Div. 2))_数据_05

B. Amr and Pins(  Codeforces Round #287 (Div. 2))_ci_06

B. Amr and Pins(  Codeforces Round #287 (Div. 2))_#include_07

B. Amr and Pins(  Codeforces Round #287 (Div. 2))_数据_08

B. Amr and Pins(  Codeforces Round #287 (Div. 2))_数据_09

B. Amr and Pins(  Codeforces Round #287 (Div. 2))_数据_10

B. Amr and Pins(  Codeforces Round #287 (Div. 2))_ci_11

B. Amr and Pins(  Codeforces Round #287 (Div. 2))_数据_12

B. Amr and Pins(  Codeforces Round #287 (Div. 2))_ci_13

B. Amr and Pins(  Codeforces Round #287 (Div. 2))_#include_14

B. Amr and Pins(  Codeforces Round #287 (Div. 2))_#include_15

B. Amr and Pins(  Codeforces Round #287 (Div. 2))_#include_16

标签:aa,lf%,x1,Codeforces,x2,y1,Pins,Div,y2
From: https://blog.51cto.com/u_14834528/7626404

相关文章

  • C. Anya and Ghosts(Codeforces Round #288 (Div. 2))
    #include<iostream>#include<algorithm>#include<stdio.h>#include<string.h>#include<stdlib.h>usingnamespacestd;structnode{intx;inty;}q[3010];inta[3001];intn,m,k;intmain(){while(scanf("......
  • C. Anya and Ghosts( Codeforces Round #288 (Div. 2))
    #include<iostream>#include<algorithm>#include<stdio.h>#include<string.h>#include<stdlib.h>usingnamespacestd;structnode{intx;inty;}q[3010];inta[3001];intn,m,k;intmain(){while(scanf("......
  • Codeforces Round 900 (Div. 3)
    昨天晚上生病,没比(血亏)A:就是看k有没有在序列里B:随便放一个大的号码然后加i,应该就可以过了C:就是我们最少要拿k*(k+1)/2,最多可以拿k*(n+n-k+1)/2。啊,你问我怎么证明在这两个值里就一定可以拿到(当然是猜的!!)D:让f[x]表示当前出了多少次。然后就没个k看l[i],r[i]和j有没......
  • Codeforces Round 742 Div2 A-D题解
    CodeforcesRound742Div2A-D题解A.DominoDisaster这题就是说给出一些2x1tile,然后给出2xn的第一行构造,问第二行这个刚开始想着是啥dp,一看那么多人过了果断改思路,发现这题就是个模拟题,就是把U换成D,D换成U,L和R不影响,然后输出就行了代码#include<bits/stdc++.h>using......
  • Codeforces Round 899 (Div. 2)
    Preface好久没现场打CF了(玩CC玩的.jpg),但这场久违的打的还不错,把Kusanagi_Misuzu这个小号也打上橙了虽然开场的时候状态不佳写的巨慢,但后面还是靠着ztc带我做出E1成功题数反超上大分接下来要考虑启动第三个小号了,只敢打Div2的FW是这样的A.IncreasingSequence比赛时候降智了......
  • Codeforces Round 738 (Div. 2) A. Mocha and Math
    给一个数组\(a_1,a_2,\cdots,a_n\)。可以执行以下操作任意次:选择\(l,r(1\leql<r\leqn)\),对于任意\(l\leqi\leqr\),同时执行所有\(a_{l+i}=a_{l+i}\&a_{r-i}\)。希望经过若干次操作后,\(a\)的最小的最大值。性质:\(x\&y\leqmin(x,y)\)。......
  • Codeforces Round 898 (Div. 4)
    这是我的vp,不是正真的contest. A:不想多说,读者应该可以做到的!!! B:让g=product(移除掉0的a):如果有多过1个0答案肯定是0。如果只是有1个0答案就是g。没有0,答案就是max(g/a[i]*(a[i]+1))任何i。 C:没有仔细想那个profit的formula.手打表,sum就可以了。 D:就是双......
  • Codeforces Round 899 (Div. 2)
    赛后四题B题直接枚举不存在的元素即可C题的trick有点像之前abc的某道题,对于奇数位置它一定可以贡献,对于偶数位置,如果它有数选了,那么它就能够贡献。\(f[i]\)表示到前i个且至少选了一个的最大答案。#include<cstdio>#include<algorithm>#include<cstring>#include<cmath>#de......
  • Codeforces Round 738 (Div. 2) B. Mocha and Red and Blue
    给一个字符串,包含字符\(B\),\(R\),\(?\)。其中\(?\)可能为\(B\)或\(R\)。规定不完美数为字符串中相同字符连续出现的次数,询问一个字符串的最少可能不完美数。观察到\(BR\)或\(RB\)需要尽可能多,于是考虑尽可能让相邻字符不同。容易证明从左往右扫和从右往左扫贡献......
  • Codeforces Round 750 (Div. 2) B. Luntik and Subsequences
    给一个数组\(a_1,a_2,\cdots,a_n\),定义\(s=\sum_{i=1}^{n}a_i\)。询问有多少个\(a\)的子序列满足\(\suma_{i_k}=s-1\)。显然要选出一个\(1\)不加入子序列,任意一个\(0\)可以加入或不加入子序列。于是\(ans=\binom{cnt1}{1}\cdot2^{cnt0}\)。vi......