poj-1852
来源:互联网 发布:公司宣传栏软件 编辑:程序博客网 时间:2024/06/05 21:16
转换思想 两只蚂蚁碰头反转时 相当于直接从对方身上走过去 直接前进
#include "stdio.h"#include "string.h"#include "math.h"#include "stdlib.h"#include <iostream>#include <algorithm>#include <stdlib.h>#include <queue>using namespace std;int t;int main(){ cin>>t; while (t--) { int n,m,tt; cin>>n>>tt; int p; int an1=-1000000,an2=-1000000; for (int i=1;i<=tt;i++) { cin>>m; an1=max( an1,min( (n-m) ,(n-(n-m)) ) ); an2=max( an2,max( (n-m) ,(n-(n-m)) ) ); } cout<<an1<<" "<<an2<<endl; } return 0;}
0 0
- poj 1852
- POJ---1852
- POJ-1852
- poj 1852
- poj 1852
- poj 1852
- poj-1852
- POJ 1852
- POJ 1852
- 1852poj
- poj-1852
- POJ 1852
- poj 1852
- poj(1852)
- POJ 1852
- poj 1852 Ants
- POJ 1852 Ants
- poj 1852Ants
- 数据结构第一章思维导图
- bash shell脚本之成员变量
- linux帧缓冲设备驱动的上层建筑Fbmem.c文件
- 【SoftKeyboard研究系列】自己动手做最简单的SoftKeyboard
- wordpress插入bilibili视频
- poj-1852
- HTTP Status Codes含义
- Xcode6.1 发布 出现 The ipa is invalid. It does not include a Payload Directory 错误
- 架构师修炼课程:透过问题看本质
- Excel学习笔记一Excel图表和数据分析
- bash: ./adb: No such file or directory
- 设计模式C++实现(5)——原型模式、模板方法模式
- Ubuntu利用TCP协议来获取服务器时间
- Ubuntu adb device