当前位置:网站首页>Luogu_ P1007 single log bridge_ thinking
Luogu_ P1007 single log bridge_ thinking
2022-06-27 15:30:00 【This question AC sleep again】
Luogu _P1007 Single-plank bridge _ thinking

//
#include<bits/stdc++.h>
using namespace std;
int main()
{
int L,n,x,y,maxa,mina;
while( cin>>L>>n )
{ // Special judgement
if( !n ) { cout<<0<<" "<<0<<endl; continue; }
mina=maxa=-1;
while( n-- )
{
cin>>x; y=L-x+1;
if( x>y ) swap( x,y );
mina=max( mina,x );
maxa=max( maxa,y );
}
cout<<mina<<" "<<maxa<<endl;
}
return 0;
}
// There is no point in turning around We all have the same speed There is no difference between individuals It can be considered as a straight line
边栏推荐
- PSS:你距离NMS-free+提点只有两个卷积层 | 2021论文
- 【kotlin】第二天
- Design of spread spectrum communication system based on FPGA (with main code)
- PSS: you are only two convolution layers away from the NMS free+ point | 2021 paper
- Eolink 推出面向中小企业及初创企业支持计划,为企业赋能!
- Computer screen splitting method
- AbortController的使用
- Strong, weak, soft and virtual references of ThreadLocal
- [MySQL] query valid data based on time
- I want to buy fixed income + products, but I don't know what its main investment is. Does anyone know?
猜你喜欢

保留有效位数;保留小数点后n位;

PSS: vous n'êtes qu'à deux niveaux du NMS Free + Lifting point | 2021 Paper

All you want to know about large screen visualization is here

CentOS8-postgresql初始化时报错:initdb: error: invalid locale settings; check LANG and LC_* environment

Pisa-Proxy 之 SQL 解析实践

2022年最新《谷粒学院开发教程》:8 - 前台登录功能

Fundamentals of software engineering (I)

CAS之比较并交换

Teach you how to package and release the mofish Library

2022-2-16 learning the imitated Niuke project - Section 6 adding comments
随机推荐
Handling methods for NVIDIA deepstream running delay, jamming and crash
老师能给我说一下固收+产品主要投资于哪些方面?
[interview questions] common interview questions (I)
专家:让你低分上好校的都是诈骗
Design of direct spread spectrum communication system based on FPGA (with main code)
CAS comparison and exchange
Piblup test report 1- pedigree based animal model
优雅的自定义 ThreadPoolExecutor 线程池
[WUSTCTF2020]girlfriend
Using redis skillfully to realize the like function, isn't it more fragrant than MySQL?
Pychart installation and setup
基于Vue+Node+MySQL的美食菜谱食材网站设计与实现
優雅的自定義 ThreadPoolExecutor 線程池
洛谷_P1008 [NOIP1998 普及组] 三连击_枚举
AI begets the moon, and thousands of miles share the literary heart
CV领域一代宗师黄煦涛教授86岁冥诞,UIUC专设博士奖学金激励新锐
Knowledge map model
Programming skills: script scheduling
PR second training notes
Google tool splits by specified length