主题链接:点击打开链接 #include<stdio.h> #include<iostream> #include<string.h> #include<set> #include<vector> #include<map> #include<math.h> #include<queue> #include<string> #include<stdlib.h> #include<a…
codeforces 12D Ball 这道题有两种做法 一种用树状数组/线段树维护区间最值,一种用map维护折线,昨天我刚遇见了一道类似的用STL维护折线的题目: 392D Three Arrays 参考题解:http://blog.csdn.net/rzo_kqp_orz/article/details/70666174 参考代码:http://codeforces.com/contest/392/submission/8930531 现在来谈谈这道题: (借一下另一题题解的图) 假设现在图…
N ladies attend the ball in the King's palace. Every lady can be described with three values: beauty, intellect and richness. King's Master of Ceremonies knows that ladies are very special creatures. If some lady understands that there is other lady…
裸的cdq, 没啥好说的, 要注意mid左边和mid右边的a相同的情况. #include<bits/stdc++.h> #define LL long long #define fi first #define se second #define mk make_pair #define PLL pair<LL, LL> #define PLI pair<LL, int> #define PII pair<int, int> #define SZ(x) (…
CodeForces.158A Next Round (水模拟) 题意分析 校赛水题的英文版,坑点就是要求为正数. 代码总览 #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <sstream> #include <set> #include <map> #include <queue>…
PTA数据结构与算法题目集(中文)  7-37 模拟EXCEL排序 (25 分) 7-37 模拟EXCEL排序 (25 分)   Excel可以对一组纪录按任意指定列排序.现请编写程序实现类似功能. 输入格式: 输入的第一行包含两个正整数N(≤) 和C,其中N是纪录的条数,C是指定排序的列号.之后有 N行,每行包含一条学生纪录.每条学生纪录由学号(6位数字,保证没有重复的学号).姓名(不超过8位且不包含空格的字符串).成绩([0, 100]内的整数)组成,相邻属性用1个空格隔开. 输出格式: 在…
如何使用phantomJS来模拟一个HTML元素的鼠标悬停 (How to use phantomJS to simulate mouse hover on a HTML element) 转 http://www.it1352.com/343039.html     问 题 I have the phantomJS code below to fetch the HTML code: var page = require('webpage').create(); var url = 'http…
题目链接:https://cn.vjudge.net/problem/CodeForces-12D 题目大意:给你一个人的三个信息,如果存在一个人比当前人的这三个信息都大,那么这个人就会退出,问你最终有多少人退出. 具体思路:首先按照x的大小排序,大的在前面,然后对y进行离散化,其次就该使用线段树了,将y表示成区间,每一次更新的是y当前的到最大节点,然后线段树中储存的是z值,这样的话,每一次查询,在保证x变大的同时,通过对当前y+1->siz的区间的z值的最大值,就能判断了. AC代码: #in…
传送门 N ladies attend the ball in the King's palace. Every lady can be described with three values: beauty, intellect and richness. King's Master of Ceremonies knows that ladies are very special creatures. If some lady understands that there is other l…
A str.substr(i,j) 从str[i]开始起取j个字符作为返回的字符串 /* Huyyt */ #include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { string a, b; cin >> a >> b; string ans = "zzzzzzzzzzzzzzzzzzzzzzzzzz"; string now; ; i <=…