当前位置:网站首页>洛谷_P1007 独木桥_思维
洛谷_P1007 独木桥_思维
2022-06-27 15:23:00 【这题AC再睡.】

//
#include<bits/stdc++.h>
using namespace std;
int main()
{
int L,n,x,y,maxa,mina;
while( cin>>L>>n )
{ // 特判
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;
}
// 掉头是没有意义的 大家速度都一样 个体之间没有差异 可以认为是直行
边栏推荐
- Excuse me, is it cost-effective to insure sunshine Optimus Prime term life insurance No. 7? What are the advantages of this product?
- ReentrantLock、ReentrantReadWriteLock、StampedLock
- AQS Abstract queue synchronizer
- [advanced mathematics] from normal vector to surface integral of the second kind
- Abnormal analysis of pcf8591 voltage measurement data
- Overseas warehouse knowledge popularization
- [digital signal processing] discrete time signal (analog signal, discrete time signal, digital signal | sampling leads to time discrete | quantization leads to amplitude discrete)
- Fundamentals of software engineering (I)
- Je veux acheter des produits à revenu fixe + mais je ne sais pas quels sont ses principaux investissements.
- CAS comparison and exchange
猜你喜欢

Leetcode 724. 寻找数组的中心下标(可以,一次过)

基于WEB平台的阅读APP设计与实现

At a time of oversupply of chips, China, the largest importer, continued to reduce imports, and the United States panicked

Pycharm安装与设置

AQS抽象队列同步器

Integration of entry-level SSM framework based on XML configuration file

Great God developed the new H5 version of arXiv, saying goodbye to formula typography errors in one step, and the mobile phone can easily read literature

Unity3d best practices: folder structure and source control

隱私計算FATE-離線預測

Interview question: rendering 100000 data solutions
随机推荐
Abnormal analysis of pcf8591 voltage measurement data
2022-2-15 learning the imitated Niuke project - Section 5 shows comments
Reflection learning summary
The global chip market may stagnate, and China's chip expansion accelerates to improve its self-sufficiency rate against the trend
Synchronized与锁升级
图书管理系统
我想买固收+产品,但是不了解它主要投资哪些方面,有人知道吗?
隱私計算FATE-離線預測
522. 最长特殊序列 II / 剑指 Offer II 101. 分割等和子集
【高等数学】从法向量到第二类曲面积分
What are the characteristics of fixed income + products?
[digital signal processing] discrete time signal (discrete time signal knowledge points | signal definition | signal classification | classification according to certainty | classification according t
Use GCC to generate an abstract syntax tree "ast" and dump it to Dot file and visualization
Can the teacher tell me what the fixed income + products are mainly invested in?
Teach you how to package and release the mofish Library
Programming skills: script scheduling
Interview question: rendering 100000 data solutions
易周金融 | Q1手机银行活跃用户规模6.5亿;理财子公司布局新兴领域
How to change a matrix into a triple in R language (i.e. three columns: row, col, value)
I want to buy fixed income + products, but I don't know what its main investment is. Does anyone know?