ural 1613 For Fans of Statistics
#include <cstdio>
#include <cstring>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
map<int,vector<int> >t;
vector<int>::iterator it;
int main()
{
int n,x;
scanf("%d",&n);
for(int i=; i<=n; i++)
{
scanf("%d",&x);
t[x].push_back(i);
}
int m,r,l;
scanf("%d",&m);
for(int i=; i<=m; i++)
{
scanf("%d%d%d",&l,&r,&x);
it=lower_bound(t[x].begin(),t[x].end(),l);
if(it==t[x].end()) printf("");
else if((*it)<=r) printf("");
else printf("");
}
printf("\n");
return ;
}
ural 1613 For Fans of Statistics的更多相关文章
- 1613. For Fans of Statistics(STL)
1613 高端的东西 lower_bounder 函数lower_bound()在first和last中的前闭后开区间进行二分查找,返回大于或等于val的第一个元素位置.如果所有元素都小于val,则返 ...
- STL--G - For Fans of Statistics(两个推断条件-二分)
G - For Fans of Statistics Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & ...
- ural1613 For Fans of Statistics
For Fans of Statistics Time limit: 1.0 secondMemory limit: 64 MB Have you ever thought about how man ...
- A过的题目
1.TreeMap和TreeSet类:A - Language of FatMouse ZOJ1109B - For Fans of Statistics URAL 1613 C - Hardwood ...
- AC题目简解-数据结构
A - Japan POJ 3067 要两条路有交叉,(x1,y1)(x2,y2)那么需要满足:(x1-x2)*(y1-y2)<0判断出这是求逆序的问题 树状数组求逆序,先通过自定义的比较器实 ...
- bzoj 1814 Ural 1519 Formula 1 插头DP
1814: Ural 1519 Formula 1 Time Limit: 1 Sec Memory Limit: 64 MBSubmit: 942 Solved: 356[Submit][Sta ...
- ABBA BABA statistics
The ABBA BABA statistics are used to detect and quantify an excess of shared derived alleles, which ...
- SQL Server 的 Statistics 簡介
當你要清空「資料表(table)」,或倒入大量「資料(data;record)」,或公司「資料庫(database)」改用新版本要資料大搬家…等情形,不只是要重建「索引(index)」,還應要重建或更 ...
- SP2-0618: 无法找到会话标识符。启用检查 PLUSTRACE 角色 SP2-0611: 启用 STATISTICS 报告时出错
援引: SP2-0618: 无法找到会话标识符.启用检查 PLUSTRACE 角色 SP2-0611: 启用 STATISTICS 报告时出错 问题描述及解决方法: SQL*Plus: Release ...
随机推荐
- oracle连接进程数设置
SQL> select count(*) from v$session #连接数SQL> Select count(*) from v$session where status='ACTI ...
- struts2校验器规范错误解决
今天struts2的校验器的配置文件文件头出现了错误,配置如下: <!DOCTYPE validators PUBLIC "-//OpenSymphony Group// ...
- 零基础学习IOS开发(二)- 使用cocos2d-x3.0 执行Hello world
关于开发框架,依据网上检索来的信息,感觉cocos2d-x的ios游戏开发框架非常不错,并且有非常强的可移植性,因此打算尝试一下. 截止写下此文章,最新的cocos2d-x的版本号为v3.0稳定版(几 ...
- Android ImageView 点击更换头像
首先搭建布局 主界面布局: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" ...
- hduTHE MATRIX PROBLEM(差分约束)
题目请戳这里 题目大意:给一个n*m的矩阵,求是否存在这样两个序列:a1,a2...an,b1,b2,...,bm,使得矩阵的第i行乘以ai,第j列除以bj后,矩阵的每一个数都在L和U之间. 题目分析 ...
- xml--通过DOM解析XML
此文章通过3个例子表示DOM方式解析XML的用法. 通过DOM解析XML必须要写的3行代码. step 1: 获得dom解析器工厂(工作的作用是用于创建具体的解析器) step 2:获得具体的dom解 ...
- [Flexbox] Using flex-direction to layout content horizontally and vertically
The Flexbox css spec allows for more adjustable layouts. The flex-directionproperty allows you to ea ...
- js禁止浏览器滚屏方法
在有些需求中需要对页面进行限制页面的查看权限,阻止用户滚动浏览器.那么我们就要禁止鼠标的滚动事件,并且如果浏览器的滚动事件一旦触发我们就将滚动条重置为0就可以了.以下是具体代码: //出现滚动值立马归 ...
- Js 正则表达式知识测试
本文对javascript中正则表达式进行了总结汇总,将知识点和注意点都理了一下,并附上2个练习题,供大家参考学习. 正则表达式: 1.什么是RegExp?RegExp是正则表达式的缩写.RegExp ...
- Java基础知识强化72:正则表达式之判断功能(手机号码判断 和 校验邮箱)
1. 判断功能: 使用了String类的matches方法,如下: public boolean matches(String regex): 2. 判断手机号码的案例: package cn.it ...