#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<cmath>
using namespace std;
const int maxn = 1000010;
int value[maxn];
int money[maxn];
int n,m;
int main()
{
    scanf("%d",&n);
    for(int i=0;i<n;i++)
        scanf("%d",&value[i]);
    scanf("%d",&m);
    for(int i=0;i<m;i++)
        scanf("%d",&money[i]);
    sort(value,value+n);
    for(int i=0;i<m;i++)
    {
        int pos = upper_bound(value,value+n,money[i])-value;
        cout<<pos<<endl;
    }
}

  

CodeForces - 706B 二分stl的更多相关文章

  1. Bridging signals(二分 二分+stl dp)

    欢迎参加——每周六晚的BestCoder(有米!) Bridging signals Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 6 ...

  2. 【二分】Codeforces 706B Interesting drink

    题目链接: http://codeforces.com/problemset/problem/706/B 题目大意: n (1 ≤ n ≤ 100 000)个商店卖一个东西,每个商店的价格Ai,你有m ...

  3. Codeforces - 706B - Interesting drink - 二分 - 简单dp

    https://codeforces.com/problemset/problem/706/B 因为没有看见 $x_i$ 的上限是 $10^5$ ,就用了二分去做,实际上这道题因为可乐的价格上限是 $ ...

  4. codeforces 706B B. Interesting drink(二分)

    题目链接: B. Interesting drink 题意: 给出第i个商店的价钱为x[i],现在询问mi能在多少个地方买酒; 思路: sort后再二分; AC代码: #include <ios ...

  5. CodeForces - 706B Interesting drink(二分查找)

    Interesting drink Problem Vasiliy likes to rest after a hard work, so you may often meet him in some ...

  6. CodeForces 706B Interesting drink (二分查找)

    题意:给定 n 个数,然后有 m 个询问,每个询问一个数,问你小于等于这个数的数有多少个. 析:其实很简单么,先排序,然后十分查找,so easy. 代码如下: #pragma comment(lin ...

  7. Can you find it?(二分 二分+STL set map)

    Can you find it? Time Limit : 10000/3000ms (Java/Other)   Memory Limit : 32768/10000K (Java/Other) T ...

  8. CodeForces - 363D --二分和贪心

    题目:CodeForces - 363D 题意:给定n个学生,其中每个学生都有各自的私己钱,并且自己的私己钱只能用在自己买自行车,不能给别人. 给定m个自行车,每个自行车都有一个价格. 给定公有财产a ...

  9. Codeforces Round #425 (Div. 2) Problem C Strange Radiation (Codeforces 832C) - 二分答案 - 数论

    n people are standing on a coordinate axis in points with positive integer coordinates strictly less ...

随机推荐

  1. vue练手小项目--眼镜在线试戴

    最近看到了一个眼镜在线试戴小项目使用纯js手写的,本人刚学习vue.js没多久,便试试用vue做做看了,还没完善. 其中包括初始图片加载,使用keywords查找,父子组件之间传递信息,子组件之间传递 ...

  2. stdafx.h 的作用

    stdafx.h VC工程里面经常见到stdafx.h这个头文件,以前也没有特别注意,但是这个文件用不好经常会出错. stdafx的英文全称为:Standard Application Framewo ...

  3. Dynamic Inversions 50个树状数组

    Dynamic Inversions Time Limit: 30000/15000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others ...

  4. 当前页面的url未注册 微信支付

    原因1:公众号支付授权目录或测试授权目录设置不正确. 原因2:微信SDK"WxPay.JsApiPay.php"文件中GetOpenid方法中$baseUrl的拼接的结果与支付授权 ...

  5. Python3常用学习网站总结(随时更新)

    Python资源大全 http://python.jobbole.com/84464/ https://github.com/jobbole/awesome-python-cn   scrapy: h ...

  6. Sublime Text保存文件时自动去掉行末空格

    修改一个Sublime Text的用户配置,其中这个配置就是"保存文件时自动去掉每行结束后多余的空格",具体操作如下: 在Sublime Text菜单栏中找到preferences ...

  7. 最近做的floyd的题目

    基础:    HDU1596    HDU2112     HDU1874     HDU1869     HDU2066     HDU2094    HDU2544  稍加复杂: HDU1217 ...

  8. zoj1871steps 数学 水

                                                                                            zoj1871 题目大意 ...

  9. java web Servlet学习笔记-2 请求重定向和请求转发的区别

    请求转发与请求重定向的区别 请求重定向和转发 1.请求重定向:浏览器的行为(通过响应对象HttpServletResponse来执行) 特点:可以重新定向访问其他Web应用下的资源 浏览器发出了2次请 ...

  10. Jquery 多选全选/取消 选项卡切换 获取选中的值

    <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...