hihoCoder 1236 Scores(2015北京赛区网络赛)

HihoCoder 1236 Scores (五维偏序bitset+分块) 题意: 五维偏序问题,在给出的五维向量中,m次询问有多少个是完全偏序看了qsc大牛的代码才知道偏序问题还可以这样做… 大概是这么回事,对于每一维我们这样预处理它: 1.排序,分块 2.bitset存储下标状态,每个块的bitset存储前缀状态(方便后面询问处理结果) 对于每次询问,二分查找每一维对应的下标,那么这个下标前面所有的块都是答案,这样的得到的五个答案用bitset &操作一下就可 阅读详情
时间限制:4000ms
单点时限:4000ms
内存限制:256MB

描述

Kyle is a student of Programming Monkey Elementary School. Just as others, he is deeply concerned with his grades.

Last month, the school held an examination including five subjects, without any doubt, Kyle got a perfect score in every single subject.

There are n students took part in this examination(not including Kyle), and everyone got an integer between 1 to m as the score of one subject.

Now, looking at the grade table of these n students, Kyle wants to know how many students still did no better than him even if his scores are something else – Here, “no better” means there is no subject in which the student got strictly greater score than Kyle.

输入

There are multiple test cases.

The first line of the input contains an integer T (T <= 3) which means the number of test cases.

The first line of each test case contains two integers, n, m(n, m≤ 50,000), which are the number of students and the perfect score of each subject.

In the next n lines, each line consists of five integers, indicating a student’s scores.

Then one line follows. This line contains an integer q(q≤ 50,000) indicating the number of queries.

In the next q lines, each line contains five integers as well, representing a query. Each query indicates a set of scores, and for each query, you should figure out that if Kyle's grade is this set of scores, how many students still did no better than him. But for the sake of security, only the first query is in its original form, and other queries are encrypted. To decrypt a query, you must let each integer in the query do xor operation with the answer of last query. It's guaranteed that all the decrypted queries contain integers between 1 and 50000.

输出

For each test case, you should output q lines as the answer for all queries.

提示

In case 1, there are two students with different scores and the scores of the first student (1, 1, 1, 1, 1) are not larger than the first query (1 1 1 1 1) in every subject, so the answer for this query is 1.

After having xor operation with the last answer 1, the second query (3,3,3,3,3) will be decrypted into (2, 2, 2, 2, 2). Because both students’ scores are no better than  (2, 2, 2, 2, 2), so the answer for query 2 is 2.

样例输入

2
2 3
1 1 1 1 1
2 2 2 2 2 
2
1 1 1 1 1
3 3 3 3 3
3 5
1 1 1 1 1
1 1 1 1 1
1 2 3 4 5
2
1 1 1 1 1
1 1 1 1 1

样例输出

1
2
2
2


题目大意:
    
     给n个人,每人有5科成绩,给出q个成绩查询,输出5科都比要查询的这5科低的数目,还有最重要的一点,查询

的成绩是与上次查询结果相异或的值。

解题思路:

     首先题目说要5科都要要比查询的小,于是我们把比要查询的都找出来,用二进制标记一下,于是5科都比要查询

小就转化成5位相与,结果是真就为真,可以用bitset来做。但是这题的n和q比较大,直接算复杂度有点高,可以用分

块来做,对每一科,排好序后,分成sqrt(n)块,由于是排好序的,每块继承前面比它小的,这样就不用查询前面比它

小的,只需要查询它所在的那一块就可以了。

代码:

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <bitset>
using namespace std;
const int maxn=50000+100;
struct node
{
    int v,cur;
    bool operator<(const node& sc)const{
        if(v==sc.v)return cur<sc.cur;
        return v<sc.v;
    }
    node(int v,int cur):v(v),cur(cur){
    }
    node(){
    }
}a[6][maxn];
bitset<maxn> b[6][500];
bitset<maxn> ans;
bitset<maxn> temp;
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int n,m;
        scanf("%d%d",&n,&m);
        for(int i=1;i<=n;i++)
        {
            for(int j=1;j<=5;j++)
            {
                scanf("%d",&a[j][i].v);
                a[j][i].cur=i;
            }
        }
        for(int i=1;i<=5;i++)
        sort(a[i]+1,a[i]+n+1);
        int sqrn=sqrt(n);
        for(int i=1;i<=5;i++)
        {
            for(int j=1;(j-1)*sqrn<n;j++)
            {
                b[i][j].reset();
                b[i][j]=b[i][j-1];
                int st=(j-1)*sqrn;
                for(int k=1;k<=sqrn&&st+k<=n;k++)
                {
                    b[i][j].set(a[i][st+k].cur);
                }
            }
        }
        int q;
        scanf("%d",&q);
        int pre=0;
        int bq[6];
        while(q--)
        {
            for(int i=1;i<=5;i++)
            {
                scanf("%d",&bq[i]);
                bq[i]^=pre;
            }
            ans.reset();
            for(int i=1;i<=5;i++)
            {
                int tmp=lower_bound(a[i]+1,a[i]+n+1,node(bq[i],n+1) )-(a[i]+1);
               // cout<<tmp<<endl;
                tmp=tmp/sqrn;
                temp=b[i][tmp];
                for(int j=tmp*sqrn+1;a[i][j].v<=bq[i]&&j<=n;j++)
                {
                    temp.set(a[i][j].cur);
                }
                if(i==1)
                ans=temp;
                else
                ans &= temp;
            }

            int cou=ans.count();
            pre=cou;
            printf("%d\n",cou);
        }
    }
    return 0;
}



Keil环境下单片机串口通信实战:如何用printf发送中文(附完整代码) 本文详细解析了在Keil开发环境下,单片机通过串口通信发送中文信息时产生乱码的根本原因及解决方案。核心在于理解并统一编码(如GB2312或UTF-8),并正确重定向printf函数。文章提供了针对STC89C52和STM32F103的完整代码示例,涵盖工程配置、编码设置、调试技巧,帮助开发者实现稳定可靠的中文串口输出。 阅读详情

相关推荐

Unity通用Buff系统,Buff编辑器(1,理论篇)(技能系统之Buff篇)

逻辑层根据游戏的规则和设计,控制Buff的生命周期、影响目标对象的属性或行为,以及处理Buff的交互和冲突。Buff堆叠和冲突:有些游戏中允许同类型的Buff叠加,以增加效果的强度,而有些游戏中可能不允许Buff叠加,只能由更强力的Buff来覆盖较弱的Buff。灵活个性化:每个游戏对象拥有自己的BuffManager,可以实现个体对象的独特Buff效果,增加游戏的多样性和个性化。自由控制:每个对象独立管理自己的Buff,可以自由地激活、更新和移除Buff效果,提供更精细的控制和逻辑实现。

u010082265的博客 4699

hihoCoder 1236 Scores(bitset+分块)

题目链接:hihoCoder 1236 Scores解题思路将5维分开考虑,对于每一维,将n分成sqrt(n)长度为一块,用bitset维护,S[i]表示0~i这些中包含的元素id。对于每次查询,用二分找到对应为值,处理出对应的二进制位。然后5维结果取且。代码#include <cstdio> #include <cstring> #include <cmath> #include <bitset>

不慌不忙、不急不躁 1133

Changer: Feature Interaction Is What You Need forChange Detection

还有“交换“交互是一种完全不需要参数和计算的操作,它是通过交换空间或通道维度上的双时态特征映射来实现的,交换的特征在经过后续的卷积或令牌混合时进行混合。方法二:提出了两种简单的交互策略,AD和特征“交换”,大量的实验表明,它们可以极大地提高MetaChanger的性能,特别是特征“交换”,即使嵌入到复杂的网络中或应用于具有挑战性的数据集。在这里,我们用虚线勾勒本文的重点。这是变化检测任务的基本问题,双时相图像提供了同一地区在不同时间点的图像数据,通过对比这两个时间点的图像,我们可以检测出该地区的变化。

yokon的博客 1632

hihocoder #1236 : Scores

高维bitset.... #include using namespace std; typedef long long LL; const int maxn = 50005; struct node { int val, id; node(int val = 0, int id = 0) : val(val), id(id) {} bool operator < (const no

yysys 796

【AI面试】 Python 的装饰器

Python装饰器是一种高阶函数,用于在不修改原函数代码的情况下增强其功能。它通过@语法糖接收目标函数作为参数,并返回一个包含额外逻辑(如日志、缓存、权限验证等)的新函数。装饰器的核心价值在于代码复用和解耦,符合开闭原则,典型应用包括性能分析、权限控制等场景。例如,@timer_decorator可自动为函数添加耗时统计功能。本质上,@decorator等价于func = decorator(func),实际调用的是装饰器返回的包装函数。进阶技巧包括使用@functools.wraps保留原函数元信息。装饰

钱多多先森 195

Ubuntu-22.04安装VMware虚拟机并安装Windows10

最近在研究虚拟机,主要集中在KVM、Virtualbox和VMware这三种虚拟机上。前面我已经研究了前两种虚拟机的安装和使用方式,这篇文章介绍3兄弟中最后一个虚拟机安装和使用方式。Virtualbox虚拟机安装和使用KVM虚拟机安装和使用相比于前两种,VMware的安装方式最麻烦,但是综合体验下来我感觉流畅度最好。如果你确实有在Linux上使用VMware虚拟机的需求,那不妨跟着我看下去吧。1、gcc版本和内核版本一定要匹配上,否则会出各种错误。

jiexijihe945的博客 4126

hihocoder #1236 Scores (15北京赛区网络赛J) (五维偏序,强制在线,bitset+分块)

链接:http://hihocoder.com/problemset/problem/1236 思路; 有n个五维的向量,给出q个询问,每个询问是一个五维向量,问有多少个向量没有一维比这个向量大。并且答案需要加密,除了第一个答案,其他答案都要和上一个答案异或。 因为是强制在线所以不能用cdq分治写。。我们可以用stl里面的bitset来写这道题,但是因为数据还是太大了,这里我们可以用分块处理...

weixin_30575309的博客 178

【升级U8+】不能将值 NULL 插入列 ‘VT_ID‘,表 ‘VoucherItems‘;列不允许有 Null 值。

不能将值 NULL 插入列 ‘VT_ID’,表 ‘UFDATA_006_2012.dbo.VoucherItems’;列不允许有 Null 值。INSERT 失败。

努力不懈的为广大客户提供优质的产品与真诚、贴心、专业的服务! 525

hihocoder 1236

题意:给出N个人的5个科目分数,给出q个询问~~,每次给你5个科目的具体分数。求一共有多少个人对应的5个科目都小于等于你的科目分数~~ 渣渣了~~~ 做法:分别单独把科目拿来看,看都有具体那些人满足条件。然后合并找出满足这五个条件的个人~~ 首先将单科目的人按照从小到达的顺序排序,然后进行二分查找就可以知道一共有多少个人满足条件。 但是我们需要知道有那些人满足条件而不是数量

wishcxz_acm 713

SQL基础:HQL之常用的行列转换应用总结

行列转换是数据开发者的基本技能,也是面试重点,在数据开发中处处可见,本文对常见的几种情况进行了总结,包括了多行转多列,多行转单列,多列转多行,单列转多行的几种情况,并给出了解决思路和方法,读者可根据本文给出的思路灵活应对业务中遇到的问题。

石榴姐yyds 1806

潜望式长焦模组全解析:结构构造、光路设计与工程实战挑战

随着移动影像能力的不断进化,潜望式长焦模组成为旗舰手机实现 5x 甚至 10x 光学变焦的关键配置。相比传统横向堆叠镜组,潜望式结构通过反射棱镜实现纵向空间上的光路折叠,有效解决了模组厚度与变焦行程的矛盾问题。然而,高倍变焦模组不仅面临复杂的光学路径设计,还涉及反射损耗控制、防抖马达配合、模组热应力管控与 ISP 畸变校正等一系列工程难点。本文将结合主流机型的实战经验,深入解析潜望式长焦模组的结构构造与调试路径,为影像系统工程师提供完整的实战参考。

努力分享一些人工智能、计算机视觉、影像等相关的知识干货! 3156

hihocoder 1236 (分块+bitset乱搞)

Kyle is a student of Programming Monkey Elementary School. Just as others, he is deeply concerned with his grades.Last month, the school held an examination including five subjects, without any doubt,

黑码 517

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

hihoCoder 1236:Scores(bitset+分块)

传送门题意: 求多维偏序下比给定值小的个数。题解:不多说,这种毒瘤题直接bitset+分块吧。。#include<bits/stdc++.h> using namespace std; inline int rd(){ char ch=getchar();int i=0,f=1; while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}

DZYO的博客 366

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

hihoCoder 1236

思路:sqrt(n)分块+bitset优化 第一次写分块,以此纪念 参考代码: #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long LL; cons

丿Smilē 丶晨星灬 614

hihoCoder 1236 Scores 解题报告(bitset + 分段暴力)

#1236 : Scores 时间限制:4000ms 单点时限:4000ms 内存限制:256MB 描述 Kyle is a student of Programming Monkey Elementary School. Just as others, he is deeply concerned with his grades. Last mon

SF-_- 的 ACM 博客 1282

HihoCoder 1236 : Scores【分块+bitset】

题目大意: 给出n个五元组,q次询问,每次询问给出一个五元组,问n个五元组中完全小等于该五元组的有多少个。 解题思路: 很容易想到用bitset[i][j]处理出第i科前j名是那些人,询问直接二分后把5个bitset与到一次即可。 但这样空间开不下,所以分一下块,bitset[i][j]表示第i科前j块是哪些人,询问是单独处理边界上的人即可。 #include&lt;bits/stdc+...

cdsszjj的博客 277

hihocoder编程收割赛30

我又来了!哈哈哈哈,今天说下前几天打的编程收割赛30吧。菜鸡的我只能就打打这简单的比赛了,大佬莫笑话我,我会加油坑难题的。 比赛链接地址:戳这里吧 A题就是一道水题吧,上来就秒了。注意下输入字符串,用gets输入,scanf输入遇到空格就会坑了。 直接把@后面的字母全输出出来,不是字母时直接停止输出,继续往下读,同以上做法,直至结束。 代码如下: #include using n

Challenged2017的博客 437

2015 ACM北京网络赛J题 hiho1236

1236 : Scores时间限制:4000ms 单点时限:4000ms 内存限制:256MB 描述 Kyle is a student of Programming Monkey Elementary School. Just as others, he is deeply concerned with his grades.Last month, the school held an e

仰望天空 1347

hiho博弈游戏·Nim游戏

题目1 : 博弈游戏·Nim游戏 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 今天我们要认识一对新朋友,Alice与Bob。 Alice与Bob总是在进行各种各样的比试,今天他们在玩一个取石子的游戏。 在这个游戏中,Alice和Bob放置了N堆不同的石子,编号1..N,第i堆中有A[i]个石子。 每一次行动,

在风雨中奔跑 764

2015ACM/ICPC亚洲区沈阳站 HDU 5517 Triple (二维线段树)

题意 :略 首先我们先假设出a1,b1和a2,b2分别为(1,2),和(2,2)。那么我们发现,其实(1,2)对于答案是根本没有贡献的。 所以对于b相同的,取a最大的即可。 首先我们定义一个矩阵Map[N][N],Map[c'][d']代表当c=c',d=d'的时候,a所能取到的最大值。 那么对于一个点c',d'假如任何的(c''>=c'&&d''>=d'(不包括点(c',d'))如果都没

tianji_fange_tuhao的博客 660

hihoCoder 1236 Scores(2015 北京网赛 J)

Scores         有n个五维的向量,给q个询问,每个询问是一个五维向量,回答有多少个向量没有一维大于它。对每一维分别排序,然后以若干个[比如sqrt(n)]为一段,压到一个bitset去,对每个询问求每维结果,与运算后count1的个数。         注意这题有个坑人的条件,就是除第一个询问外,之后每个询问都要和前一个结果与一下。。我没看到跪了无数发。 #include

A Cube Master 931

【题解】 2015 ACM-ICPC Asia Regional Beijing Online (3+2)

【hiho 1227】 The Cats' Feeding Spots (二分+暴力枚举) #1227 : The Cats' Feeding Spots 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 In Yan Yuan, the Peking University campus, the

ACMer' 2783

hihocoder#1444 : Push Button II(DP)

hihocoder#1444 : Push Button II(DP)There are N buttons on the console. Each button needs to be pushed exactly once. Each time you may push several buttons simultaneously. Assume there are 4 buttons. You can first push button 1 and button 3 at one time, th

Mitsuha_的博客 447

解题报告:hihoCoder_1236 Scores 分块bitset暴力

#1236 : Scores Time Limit:4000ms Case Time Limit:4000ms Memory Limit:256MB Description Kyle is a student of Programming Monkey Elementary School. Just as others, he is deeply co

Hee的博客~ 505

hihoCoder 1236 Scores 五维偏序 (分块 + bitset)

题目链接:http://hihocoder.com/problemset/problem/1236 分析: 分块处理。 #pragma comment(linker, "/STACK:1024000000,1024000000") #define sspeed ios_base::sync_with_stdio(0);cin.tie(0) #include #include #include

weishengmingerfendou的专栏 1137

hihoCoder #1069 最近公共祖先·三

#1069 : 最近公共祖先·三 Time Limit:10000ms Case Time Limit:1000ms Memory Limit:256MB 描述 上上回说到,小Hi和小Ho使用了Tarjan算法来优化了他们的“最近公共祖先”网站,但是很快这样一个离线算法就出现了问题:如果只有一个人提出了询问,那么小Hi和小Ho很难决定到底是针对这个询...

weixin_30455023的博客 202
上一篇: zoj 3913 Bob wants to pour water(zoj 2015年10月月赛k题)
下一篇: ubuntu 下安装bochs
AC_way
博客等级 码龄12年 55粉丝 248原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值