codeforces round#408(div.2) A. Buying A House
来源:互联网 发布:java字符串转json 编辑:程序博客网 时间:2024/06/03 16:50
题意:等距离的一列数组表示房子价格(0为有人居住的),输出距离目标的最近的可以买下的房子。
数据量很小,直接暴搜一遍即可。
#include<bits/stdc++.h>using namespace std;int n,m,k,dis=1e9,x,position;int main(){ cin>>n>>m>>k; for(int i=1;i<=n;i++) { scanf("%d",&x); if(abs(i-m)<dis&&x&&x<=k) { dis=abs(i-m); } } cout<<dis*10; return 0;}
1 0
- Codeforces Round #408 (Div. 2) A Buying A House
- codeforces round#408(div.2) A. Buying A House
- Codeforces Round #408 (Div. 2) A. Buying A House
- Codeforces Round #408 A. Buying A House
- Codeforces Round #408 (Div. 2) A.Buying A House【模拟】水题~
- Codeforces Round #346 (Div. 2) -A. Round House(模拟)
- Codeforces Round #346 (Div. 2)--A. Round House
- Codeforces Round #346 (Div. 2) A.Round House
- Codeforces Round #346 (Div. 2) A. Round House
- Codeforces Round #346 (Div. 2) - A Round House
- Codeforces Round #346 (Div. 2) A. Round House
- Codeforces Round #346 (Div. 2) A. Round House
- CodeForces 796A Buying A House
- 【Codeforces 796 A. Buying A House】
- Buying A House (Codeforces-796A)
- A. Buying A House
- A. Buying A House
- 【CodeForces】[659A]Round House
- MTK SmartPhone Record-(4)
- 第十四章 账号管理
- Deep Learning Face Attributes in the Wild
- 第十四章 主机的细部权限规划:ACL 的使用
- oracle 报未明确定义列
- codeforces round#408(div.2) A. Buying A House
- java 锁对象Lock-同步问题更完美的处理方式(ReadWriteLock)
- 开发编辑电话接口
- java设计模式--状态模式 State
- gensim导入word2vec模型,memory error问题
- InnoDB Insert Buffer(插入缓冲)
- Linux入门学习(一)
- mysql 操作索引FORCE INDEX
- Android按键事件处理流程 -- KeyEvent