首页 > 其他分享 > 『AtCoder做题记录』I

『AtCoder做题记录』I

时间:2023-11-05 18:24:27浏览次数:37  
标签:AtCoder 记录 int maxm 做题 between antennas define

放假之后回机房第一天,后面洛谷永久封了,第一次尝试AT

随便打打,先试试

不知道那场比赛

T1

  • 题面:

In AtCoder city, there are five antennas standing in a straight line. They are called Antenna
\(A,B,C,D\) and \(E\) from west to east, and their coordinates are \(a,b,c,d\) and \(e\), respectively.
Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than \(k\).
Determine if there exists a pair of antennas that cannot communicate directly.
Here, assume that the distance between two antennas at coordinates \(p\) and \(q (p<q)\) is \(q−p\).Constraints

\(a,b,c,d,e\) and \(k\) are integers between \(0\) and \(123\) (inclusive).

\(a<b<c<d<e\)

  • 翻译:

就是问在\(ABCDE\)五个里有没有两个天线距离大于 \(k\)

  • 代码:
#include<bits/stdc++.h>
#define int long long
#define maxm 0x66ccff
#define endl "/n"
int a[maxm],k,Luo[maxm];
signed main(){
    for(int i=1;i<=5;i++)
        std::cin>>a[i];
    std::cin>>k;
    if(k<(a[5]-a[1]))
        std::cout<<":("
    else 
        std::cout<<"Yay!";
}
  • 备注:这怎么打了endl还会WA啊

T2

标签:AtCoder,记录,int,maxm,做题,between,antennas,define
From: https://www.cnblogs.com/LuoTianYi66ccff/p/17810844.html

相关文章

  • AtCoder Beginner Contest(abc) 317
    B-MissingNo.难度:⭐题目大意给定n个数,这n个数中最小值到最大值之间缺一个数,输出这个数;解题思路数据不大,暴力即可;神秘代码#include<bits/stdc++.h>#defineintlonglong#defineIOSios::sync_with_stdio(false),cin.tie(0),cout.tie(0)#defineendl......
  • cuda安装记录
    1、显卡驱动程序更新      2、安装cuda https://developer.nvidia.com/cuda-toolkit-archive          3、安装cudann重启电脑cuDNNArchive|NVIDIADeveloper    ......
  • 【杂题乱写】AtCoder-ARC115
    AtCoder-ARC115_FMigration*把问题转化成在某个限制\(mid\)下求初始局面和最终局面能到达的最小代价局面,如果相等则说明可达。比较局面的方式是比较权值,如果相等按字典序比较。对每个节点\(u\)求出权值比\(u\)小或权值与\(u\)相等且编号比\(u\)小的节点中,与\(u\)......
  • 11.5 做题记录
    [ABC167D]Teleporter一眼有循环节,然后就秒了。#include<bits/stdc++.h>#defineintlonglongusingnamespacestd;constintN=2e5+10;intn,k,a[N],vis[N],xhj=0;pair<int,int>bs[N];signedmain(){ cin>>n>>k; for(inti=1;......
  • 杂题记录
    杂题记录记录一些没啥分类的妙妙题[ABC225F]StringCardsdate:2023.10.23初看题目,感觉直接排序,但是发现,\(k\)其实是影响的,也就是直接排序并不一定最优简单的反例22babbba>bab但是b在ba之前不能快排了但是我们发现数据很小返回排序的源头选择排序每次交换两个......
  • HHKB Programming Contest 2023(AtCoder Beginner Contest 327) 赛后总结
    HHKBProgrammingContest2023(AtCoderBeginnerContest327)赛后总结又没来得及写题解。。。赛时A-ab查找ab和ba,只要其中一者存在就行。#include<bits/stdc++.h>usingnamespacestd;intn;strings;intmain(){cin>>n>>s;cout<<(s.find("a......
  • Japan Registry Services (JPRS) Programming Contest 2023 (AtCoder Beginner Contes
    JapanRegistryServices(JPRS)ProgrammingContest2023(AtCoderBeginnerContest324)赛后总结可悲的是:我没来得及写题解。TaskASame秒切。直接输入排一遍序再遍历即可。#include<bits/stdc++.h>usingnamespacestd;intn,a[101];intmain(){cin>>n;......
  • Java小白学习记录--------常见的一维数组遍历方法
    一维数组:for循环遍历:int[]myArray={1,2,3,4,5};for(inti=0;i<myArray.length;i++){System.out.println("myArray["+i+"]="+myArray[i]);//输出数组中的每个元素} for-each循环遍历数组(增强for循环遍历)int[]myArray={1,2,3,4,5};......
  • conda配置虚拟环境相关记录
    #教程创建虚拟环境创建condacreate--nameyourEnvpython=3.7.51--name:也可以缩写为-n,【yourEnv】是新创建的虚拟环境的名字,创建完,可以装anaconda的目录下找到envs/yourEnv目录python=3.7.5:是python的版本号。也可以指定为【python=3.6】,若未指定,默认为是装anaconda时pytho......
  • Linux记录(根文件系统NFS挂载失败)
    简单说明一下:我们测试跟文件系统的时候不是直接烧写到EMMC里面,这样测试效率太低了,Ubuntu的rootfs目录已经保存了根文件系统,我们只需要在开发板上通过nfs挂载Ubuntu下的rootfs目录即可。也就是说,根文件系统一直在Ubuntu下,开发板通过网络在使用这个根文件系统,这样方......