当前位置:网站首页>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
边栏推荐
- Strong, weak, soft and virtual references of ThreadLocal
- Référence forte, faible, douce et virtuelle de threadlocal
- 我想买固收+产品,但是不了解它主要投资哪些方面,有人知道吗?
- 優雅的自定義 ThreadPoolExecutor 線程池
- What are the characteristics of fixed income + products?
- SQL parsing practice of Pisa proxy
- Programming skills: script scheduling
- Using redis skillfully to realize the like function, isn't it more fragrant than MySQL?
- ERROR L104: MULTIPLE PUBLIC DEFINITIONS
- Atomic operation class
猜你喜欢

What kind of experience is it to read other people's code

基于SSM的Web网页聊天室系统

AutoCAD - line width setting

2022-2-15 learning the imitated Niuke project - Section 5 shows comments
![Beginner level Luogu 1 [sequence structure] problem list solution](/img/60/5e151ba31eb00374c73be52e3bfa7e.png)
Beginner level Luogu 1 [sequence structure] problem list solution

PSS: you are only two convolution layers away from the NMS free+ point | 2021 paper

Computer screen splitting method

Leetcode 724. Find the central subscript of the array (yes, once)

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

洛谷入门2【分支结构】题单题解
随机推荐
[digital signal processing] discrete time signal (analog signal, discrete time signal, digital signal | sampling leads to time discrete | quantization leads to amplitude discrete)
2022-2-16 learning the imitated Niuke project - Section 6 adding comments
Design of digital video signal processor based on FPGA (with main code)
Elegant custom ThreadPoolExecutor thread pool
Multithreading Basics (III)
可变参数模板 Variadic Templates
Design of electronic calculator system based on FPGA (with code)
Knightctf 2022 web section
基于WEB平台的阅读APP设计与实现
Design and implementation of food recipe and ingredients website based on vue+node+mysql
Massive data! Second level analysis! Flink+doris build a real-time data warehouse scheme
Design of CAN bus controller based on FPGA (with main codes)
I want to buy fixed income + products, but I don't know what its main investment is. Does anyone know?
Pisa-Proxy 之 SQL 解析实践
Gin general logging Middleware
Why can't the start method be called repeatedly? But the run method can?
我想买固收+产品,但是不了解它主要投资哪些方面,有人知道吗?
ThreadLocal之强、弱、軟、虛引用
ERROR L104: MULTIPLE PUBLIC DEFINITIONS
Handling methods for NVIDIA deepstream running delay, jamming and crash