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 ...
随机推荐
- KMP学习
刚才看了(连接)写的翻译,把kmp算法的工作过程讲的很不错,kmp算法的核心是next,next为什么要那么赋值?其实就是前缀和后缀的最大匹配值,用这个值在匹配失败的时候可以跳过一个不必要的匹配. ...
- Alert Views
Alert views display a concise and informative alert message to the user. Alert views convey importan ...
- SAE 搭建 WordPress
WordPress,是国外一款使用PHP语言开发的开源博客平台,用户可以在支持PHP和MySQL 数据库的服务器上架设自己的博客站点,也可以把 WordPress 当作一个内容管理系统(CMS)来使用 ...
- Mysql 5.6主从同步配置与解决方案
主库IP:192.168.1.10 从库IP:192.168.1.11 centos的mysql配置文件在:/etc/my.cnf 1.主库配置编辑my.cnf: # 启用二进制日志 log_bin ...
- 2016 cocoapods的安装和使用以及版本升级遇到的问题
一.CocoaPods是什么? CocoaPods是一个负责管理iOS项目中第三方开源库的工具.CocoaPods的项目源码在Github上管理.该项目开始于2011年8月12日,在这两年多的时间里, ...
- AFNetworking (3.1.0) 源码解析 <四>
这次主要看一下文件夹Security中的类AFSecurityPolicy----安全策略类. AFSecurityPolicy主要的作用是验证HTTPS请求证书的有效性,在iOS9之后,默认不能发送 ...
- 1033 - Merging Maps
Pictures taken from an airplane or satellite of an ar ea to be mapped are often of sufficiently high ...
- .NET注册页面代码
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI ...
- Java基础知识强化87:BigInteger类之BigInteger加减乘除法的使用
1. BigInteger加减乘除法的使用 public BigInteger add(BigInteger val):加 public BigInteger subtract(BigInteger ...
- 常用PC服务器LSI阵列卡配置
通常,我们使用的DELL/HP/IBM三家的机架式PC级服务器阵列卡是从LSI的卡OEM出来的,DELL和IBM两家的阵列卡原生程度较高,没有做太多封装,可以用原厂提供的阵列卡管理工具进行监控:而HP ...