数列有序! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 59240 Accepted Submission(s): 25564 Problem Description 有n(n<=100)个整数,已经按照从小到大顺序排列好,现在另外给一个整数x,请将该数插入到序列中,并使新的序列仍然有序. Input 输入数据包含多个测试实例
http://acm.hdu.edu.cn/showproblem.php?pid=2019 数列有序! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 44844 Accepted Submission(s): 19451 Problem Description 有n(n<=100)个整数,已经按照从小到大顺序排列好,现在另外给
#include<vector> #include<iostream> #include<algorithm> #include<cstdio> using namespace std; bool cmp(int a, int b) { return a < b; } bool cmp2(int a, int b) { return a > b; } int main() { int n, m; while (cin >> n &am