PAT A1055. The World's Richest (25)

L3 级自动驾驶 2025:法规突破与车企技术路线竞争 2025年L3级自动驾驶迎来规模化商业落地关键期。全球主要经济体在法规、技术、市场三方面取得突破:中国通过《北京市自动驾驶汽车条例》明确责任划分,欧盟设立严格技术认证标准。技术路线呈现"多传感器融合为主流,纯视觉为补充"格局,华为、特斯拉等企业展开硬件军备竞赛与算法架构革新。中国车企在技术验证和规模化应用方面领先,而欧美车企侧重生态整合。尽管面临成本控制、责任认定和用户信任等挑战,随着技术进步和车路协同发展,L3自动驾驶正从高端选配向大众化普及迈进,为L4级奠定基础。 阅读详情

题目链接

Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world's wealthiest people. Now you are supposed to simulate this job, but concentrate only on the people in a certain range of ages. That is, given the net worths of N people, you must find the M richest people in a given range of their ages.

Input Specification:

Each input file contains one test case. For each case, the first line contains 2 positive integers: N (<=105) - the total number of people, and K (<=103) - the number of queries. Then N lines follow, each contains the name (string of no more than 8 characters without space), age (integer in (0, 200]), and the net worth (integer in [-106, 106]) of a person. Finally there are K lines of queries, each contains three positive integers: M (<= 100) - the maximum number of outputs, and [Amin, Amax] which are the range of ages. All the numbers in a line are separated by a space.

Output Specification:

For each query, first print in a line "Case #X:" where X is the query number starting from 1. Then output the M richest people with their ages in the range [Amin, Amax]. Each person's information occupies a line, in the format

Name Age Net_Worth
The outputs must be in non-increasing order of the net worths. In case there are equal worths, it must be in non-decreasing order of the ages. If both worths and ages are the same, then the output must be in non-decreasing alphabetical order of the names. It is guaranteed that there is no two persons share all the same of the three pieces of information. In case no one is found, output "None".
Sample Input:
12 4
Zoe_Bill 35 2333
Bob_Volk 24 5888
Anny_Cin 95 999999
Williams 30 -22
Cindy 76 76000
Alice 18 88888
Joe_Mike 32 3222
Michael 5 300000
Rosemary 40 5888
Dobby 24 5888
Billy 24 5888
Nobody 5 0
4 15 45
4 30 35
4 5 95
1 45 50
Sample Output:
Case #1:
Alice 18 88888
Billy 24 5888
Bob_Volk 24 5888
Dobby 24 5888
Case #2:
Joe_Mike 32 3222
Zoe_Bill 35 2333
Williams 30 -22
Case #3:
Anny_Cin 95 999999
Michael 5 300000
Alice 18 88888
Cindy 76 76000
Case #4:
None

本题虽然简单,但是不能忽视其陷阱。

在第二审查点的时候,运行时间会提高,到达207ms,但不会超时(<=400ms)。原代码如下:

#include<cstdio>
#include <algorithm>
#include<cstring>
using namespace std;
struct Del {
    char name[10];
    int age, worth;
};
Del del[100005];
bool cmp(Del a, Del b) {
    int s = strcmp(a.name, b.name);
    if(a.worth!=b.worth)return a.worth > b.worth;
    else if (a.age != b.age)return a.age < b.age;
    else return s < 0;
}
int main() {
    int n, k;
    scanf("%d %d", &n, &k);
    for (int i = 0; i < n; i++) {
        scanf("%s %d %d", del[i].name, &del[i].age, &del[i].worth);
    }
    sort(del, del + n, cmp);
    for (int i = 0; i < k; i++) {
        int m, amin, amax;
        scanf("%d %d %d", &m, &amin, &amax);
        int cnt = 0,age;
        printf("Case #%d:\n", i + 1);
        for (int j = 0; j < n; j++) {
            if (cnt == m)break;
            age = del[j].age;
            if (age >= amin&&age <= amax) {
                printf("%s %d %d\n", del[j].name, age, del[j].worth);
                cnt++;
            }
        }
        if (cnt == 0)printf("None\n");
    }
    return 0;
}

但是算法笔记上面运行时间要求在200ms以内。所以按照书上的思想,将数组进行了预处理,复杂度得到降低,结果在检查点2所得到的结果是150ms,其余各检查点也都有所降低,代码修改如下:

#include<cstdio>
#include <algorithm>
#include<cstring>
using namespace std;
struct Del {
    char name[10];
    int age, worth;
};
int age[100005];
Del del[100005],ano[100005];
bool cmp(Del a, Del b) {
    int s = strcmp(a.name, b.name);
    if(a.worth!=b.worth)return a.worth > b.worth;
    else if (a.age != b.age)return a.age < b.age;
    else return s < 0;
}
int main() {
    int n, k;
    scanf("%d %d", &n, &k);
    for (int i = 0; i < n; i++) {
        scanf("%s %d %d", del[i].name, &del[i].age, &del[i].worth);
    }
    sort(del, del + n, cmp);
    int num = 0;
    for (int i = 0; i < n; i++) {
        if (age[del[i].age] <= 100) {
            age[del[i].age]++;
            ano[num++] = del[i];
        }
    }
    for (int i = 0; i < k; i++) {
        int m, amin, amax;
        scanf("%d %d %d", &m, &amin, &amax);
        int cnt = 0,age;
        printf("Case #%d:\n", i + 1);
        for (int j = 0; j < num; j++) {
            if (cnt == m)break;
            age = ano[j].age;
            if (age >= amin&&age <= amax) {
                printf("%s %d %d\n", ano[j].name, age, ano[j].worth);
                cnt++;
            }
        }
        if (cnt == 0)printf("None\n");
    }
    return 0;
}

增加了控制每个年龄个数的数组age。由于m<=100,所以,只需要将每个年龄上的前100名计入ano结构体数组中即可。此时,当n到达100000时,代码在经过检查点的时候,不会像第一个代码那样,遍历100000次,而是遍历20000次,有效降低了查询时的复杂度,同时也让我得到了宝贵的经验。


RT-DETR改进策略【注意力机制篇】| 2024 PPA 并行补丁感知注意模块,提高小目标关注度 本文记录的是利用改进检测精度,详细说明了优化原因,注意事项等。原论文在红外小目标检测任务中,小目标在多次下采样操作中容易丢失关键信息。通过替代编码器和解码器基本组件中的传统卷积操作,更好地保留小目标的重要信息。HCF-Net: Hierarchical Context Fusion Network for Infrared Small Object Detection采用多分支特征提取策略,通过不同分支提取不同尺度和层次的特征。利用局部、全局和串行卷积分支,对输入特征张量进行处理。通过控制 patch si 阅读详情

相关推荐

WKWebView 白屏问题,WKWebView request body丢失问题

1,WKWebView 白屏问题 WKWebView 自诩拥有更快的加载速度,更低的内存占用,但实际上 WKWebView 是一个多进程组件,Network Loading 以及 UI Rendering 在其它进程中执行。初次适配 WKWebView 的时候,我们也惊讶于打开 WKWebView 后,App 进程内存消耗反而大幅下降,但是仔细观察会发现,Other Process 的内存占用会...

weixin_37543822的博客 738

PAT A1055(运行超时)

只要减少sort函数的使用即可通过测试点2,如下 只使用一次sort()函数。 #include<iostream> #include<algorithm> #include<cstring> #include<vector> using namespace std; const int maxn = 100010; struct Person{ char name[10]; int age, worth; }person[maxn]; vector.

学习笔记,不喜勿喷! 136

低供电电压CMOS偏置电路分析(有些类似于三支路电流源)

1、偏置电路原理图以及仿真结果 电路电流分析:Ip=Ip1=Ip2=Ip3,那么 Ip=12μnCoxWL(IpR−VTH)2 I_p=\frac{1}{2} μ_nC_{ox}\frac{W}{L} (I_{p}R-V_{TH})^2 Ip​=21​μn​Cox​LW​(Ip​R−VTH​)2 解出方程式即可得到参考电流及参考电压 2、电路电源抑制比PSRR分析 这里为了方便,小信号前都不加△ 首先做一个近似,由于gmRo>>1,直接将VDD变化导致的P3管漏级电压变化与VDD变化量做相等

qq_46579389的博客 2910

PAT——A1055(排序)

题目链接: #include&lt;cstdio&gt; #include&lt;iostream&gt; #include&lt;cmath&gt; #include&lt;cstring&gt; #include&lt;algorithm&gt; using namespace std; #define maxn 100010 struct person{ char name[10...

ZMST的博客 260

qt5.14.2+vs2019配置msvc2017编译器

qt5.14.2+vs2019配置msvc2017编译器 在使用qt编译程序时此前一直使用的是自带的MinGW 32-bit和64-bit,现在想使用msvc编译器。本次使用的是qt5.14.2,vs2019,需要配置msvc2017的32-bit和64-bit编译器。 1、首先安装好qt5.14.2和vs2019,其次在visual studio installer选择修改,然后选择msvc2017对应的组件,本次安装的是这两个 2、打开qt creator的工具–选项–kits–编译器,选择Manu

bangtanhui的博客 1万+

[uboot] (第一章)uboot流程——概述

[uboot] uboot流程系列: [project X] tiny210(s5pv210)上电启动流程(BL0-BL2)建议先看《[project X] tiny210(s5pv210)上电启动流程(BL0-BL2)》,根据例子了解一下上电之后的BL0\BL1\BL2阶段,以及各个阶段的运行位置,功能。==============================================

ooonebook的博客 1万+

PAT 自学题解 A 1055【测试点1,2】

测试点段错误qaq,有没有大佬帮忙看一下 #include<cstdio> #include<iostream> #include<cstring> #include<algorithm> using namespace std; struct ID//人员 { char name[50]={0}; int age=0,worth=0; }id[12000],temp[12000]; struct query//问题 { int .

weixin_54868899的博客 455

Keil MDK-ARM v5.43a 部署 STM32F103 开发环境全流程

嵌入式开发环境是 Cortex-M 微控制器工程落地的基础支撑,其核心在于编译器链、设备支持包(DFP)与调试驱动的协同一致性。Keil MDK-ARM 作为工业级 ARM Cortex-M 开发套件,依托 Arm Compiler 和 CMSIS 标准,提供从代码编译、外设抽象到实时调试的全栈能力。其技术价值体现在对 STM32 等主流 MCU 的深度适配、高可靠性 SWD 调试支持,以及与 HAL 库、CubeMX 工程的无缝集成。典型应用场景涵盖温湿度传感终端、工业 PLC 子模块及低功耗边缘节点开发

weixin_33750664的博客 896

C++题解PAT A1055 The

一定要先排序,然后找到你年龄范围,主要的核心也没啥(j<n) && (num<m)这句话要注意,也就是输出人的数量一定比总人小,统计的数量不能大于输出的数量

执念斩长河 807

caverdock如何使用,一文给你多方案教学!

🏆本文收录于 《全栈 Bug 调优(实战版)》 专栏。专栏聚焦真实项目中的各类疑难 Bug,从成因剖析 → 排查路径 → 解决方案 → 预防优化全链路拆解,形成一套可复用、可沉淀的实战知识体系。无论你是初入职场的开发者,还是负责复杂项目的资深工程师,都可以在这里构建一套属于自己的「问题诊断与性能调优」方法论,助你稳步进阶、放大技术价值。

**My Coding Family** 1390

【WRF-Chem教程第四期上】运行 WRF-Chem 模型

完整介绍运行 WRF-Chem 模型的详细步骤

WW、forever的博客 3114

PAT a1055题解

#include #include #include using namespace std; int Age[100010] = {0}; struct Person{ int age, worths; char name[10]; }ps[100010], valid[100010]; bool cmp(Person a, Person b){ if(a.worths !=

Tang's学习笔记 785

yolov8 转华为昇腾om脚本

yolov8 转华为昇腾om脚本

jacke121的专栏 1602

PAT A1055 The World's Richest (25 分) 排序

题目大意:给出N个人的姓名、年龄和资产信息,要求输出在指定年龄区间内最富有的M个人的信息。 按照资产排序后,直接暴力遍历所有人的信息,符合年龄要求的输出,并维护已经输出的数量<=M即可。不过这样测试点2耗时会比较长,题目似乎更改了时间限制,按照以前的200ms的时间限制需要换一种思路,即一开始就要将每个年龄的前M个人单独存放到数组里,查询的时候从这个数组里查询。不过既然放宽...

HackingGate的博客 166

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

深度学习工具包 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")

1055 The World's Richest (25 分)——PAT A

1055The World's Richest(25分) Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world's wealthiest people. Now you are supposed to simulate this job, ...

weixin_42769575的博客 150

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

PAT A1055 The World's Richest (25分)

题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805421066272768 题目描述 Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world’s wealthi...

Rhao的博客 266

STM32F407中文手册

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

PAT A 甲级 1055 The World's Richest (25分)

1055 The World’s Richest (25分) 吐槽 又是试了两种办法。然后才知道为啥有两个超时测点。我这两个方法擅长的测点正好不同。 思路 试了两种办法,一个测点1概率过测点2必过,另一个测点1必过测点2一直不过。 前者是一次排序,然后每次遍历所有人找出相应数量的符合年龄大小的人。 后者是先将所有人按年龄排序,然后每次找出那个年龄区间内的人(它们是相邻的),按worth排序/放进新...

虚境的博客 276

PAT_A 1055. The World's Richest (25)

1055. The World’s Richest (25) 排序

longtails的博客 637

PAT甲级A1055 The World's Richest (25 分)

Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world's wealthiest people. Now you are supposed to simulate this job, but concentrate only on the peopl...

vir_lee的博客 289

PAT-A 1055 The World's Richest (25 分)

思路:先将所有的富人按照给定要求进行排序,在每次查询时,遍历富人,如果年龄合适,则输出,并更新已经输出的数量,如果输出的数量达到了要求,则停止输出。

qq_38127801的博客 175

PAT A 1055 The World's Richest (25分)

一、思路 将全部记录按要求排序; 对于每个请求,遍历全表,若年龄符合要求则输出,注意输出不多于M个,且输出为0时输出None; 测试点2超时:使用scanf()、printf()输入输出; 二、代码 #include <cstdio> #include <string> #include <vector> #include <algorithm> u...

Siumai's Blog 137

PAT A1055 The World's Richest (25 分)——排序

Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world's wealthiest people. Now you are supposed to simulate this job, but concentrate only on ...

weixin_30512089的博客 173

PAT A1055 The World's Richest (25)

Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world’s wealthiest people. Now you are supposed to simulate this job, but concentrate only on the peopl...

fried123123的博客 235

PAT A1055 the world's richest(25)

从头到尾遍历 万幸没有超时。晴神书里的写法是有优化 #include #include #include using namespace std; struct man{ char name[10]; int age; int worth; }men[100005]; int cmp(man a,man b){ if(a.worth!=b.worth) ret

momottyy的专栏 342

PAT-A1055. The World's Richest (25)(排序)

整个排序后遍历。#include #include #include #include #include using namespace std; #define MAX 100000+10 struct People { char name[10]; int age; int networth; } people[MAX]; int cmp(const vo

WJ的专栏 362
上一篇: PAT A1028. List Sorting (25)
下一篇: PAT A1075. PAT Judge (25)
DemonInside
博客等级 码龄10年 1粉丝 18原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值