CodeForce896 B. Ithea Plays With Chtholly
来源:互联网 发布:电脑软件 著作权 专利 编辑:程序博客网 时间:2024/05/23 15:15
#include <bits/stdc++.h>using namespace std;const int maxn = 1050 ;int n , m , c , temp ;int arr[maxn] ;int main(){ int num = 0 ; scanf("%d %d %d" , &n , &m , &c) ; memset(arr , -1 , sizeof(arr)) ; while(m --){ scanf("%d" , &temp) ; if(temp > c / 2){ for(int i = n ; i >= 1 ; i --){ if(arr[i] == -1 || arr[i] < temp){ if(arr[i] == -1) num ++ ; arr[i] = temp ; printf("%d\n" , i) ; fflush(stdout) ; break ; } } }else{ for(int i = 1 ; i <= n ; i ++ ){ if(arr[i] == -1 || arr[i] > temp){ if(arr[i] == -1) num ++ ; arr[i] = temp ; printf("%d\n" , i) ; fflush(stdout) ; break ; } } } if(num == n) return 0 ; } return 0 ;}
阅读全文
0 0
- CodeForce896 B. Ithea Plays With Chtholly
- CodeForce896 B. Ithea Plays With Chtholly
- Codeforces Round #449 (Div. 1) B. Ithea Plays With Chtholly
- Codeforces 896B Ithea Plays With Chtholly 交互/构造
- CodeForce 897 D. Ithea Plays With Chtholly
- codeforces 897 D Ithea Plays With Chtholly(交互)
- B. Chtholly's request
- codeforces 757e Bash Plays with Functions
- Codeforces 757E Bash Plays with Functions
- CF-897B.Chtholly's request
- BJ模拟(1) D2T1 Bash Plays with Functions
- [数论]Codeforces 757E. Bash Plays with Functions
- CF Round# 449 Div2 B. Chtholly's request
- Codeforces Round #449 (Div. 2) B. Chtholly's request
- Codeforces Round #449 (Div. 2) B. Chtholly's request (思维
- Codeforces Round #449 (Div. 2) 897B. Chtholly's request
- Codeforces Round #449 (Div. 2) B. Chtholly's request
- [easy]CodeForces-897B Chtholly's request 模拟/找规律
- demon16.1-16.2
- 关于ext4 buddy bitmap构建分析
- redis-JedisPoolConfig配置
- 第九周项目一__二叉树算法库
- matlab中,GUI窗口位置和大小问题
- CodeForce896 B. Ithea Plays With Chtholly
- 475. Heaters
- javascript连接SQL Server 2014进行增删改查(适用于IE浏览器)
- 一文览尽2017年下半年机器人行业融资大事件
- 编程语言拟人化(1):Java、C++、Python、Ruby、PHP、C#、JS的区别
- JSON基础
- Centos7修改系统语言为中文
- 第九周项目二二叉数遍历的递归算法
- 171216 逆向-.Net的保护和对抗(2)