私信TA
用户名:uq_54514514336
访问量:6350
签 名:
自我简介:
作者: 算法至美 发表时间:2022-06-25 23:13:40 浏览:110 | 评论:0
#include using namespace std; int main(){ int i; cin>>i; vectorp(1,i),q(1,~i); while(cin>>i){ if(i>p.back())p.push_back(i); else*lower_bound(p.begin(),p.end(),i)=i; i=~i; if(i p = new ArrayList<>(), q = new ArrayList<>(); int i = in.nextInt(); p.add(i); q.add(~i); while (in.hasNext()) { i = in.nextInt(); if (i > p.get(~-p.size())) p.add(i); else p.set(Math.abs(Collections.binarySearch(p, i) << 1 | 1) >> 1, i); i = ~i; if (i < q.get(~-q.size())) q.set(Math.abs(Collections.binarySearch(q, i) << 1 | 1) >> 1, i); else q.add(i); } in.close(); System.out.println(q.size()); System.out.println(p.size()); } } ```
0.0分
0 人评分
看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:
编程语言转换万能编程问答
代码解释器
代码纠错
SQL生成与解释