2013浙大计算机复试上机题

51单片机IAP在线升级 51单片机IAP在线升级 爱矽半导体E85F3325单片机IAP在线升级教程,此处可查看更新及demo下载 文章目录前言一、ROM资源二、KEIL有关知识1.BL51连接器:2.LX51连接器:三、Keil其他相关项说明:四、MCU启动文件说明:五、例程BOOTLOADER使用说明六、例程使用可更改说明:七、程序使用通信方式:XMODEM八、APP程序说明九、APP代码升级说明十、代码合并烧写 前言 扩展-IAP 主要用于产品出厂后应用程序的更新作用 ,类似于其他引导装载升级程序的方法,在系统中必须始终 阅读详情

The Dominant Color

 

Behind the scenes in the computer's memory, color is always talked about as a series of 24 bits of information for each pixel.  In an image, the color with the largest proportional area is called the dominant color.  A strictly dominant color takes more than half of the total area.  Now given an image of resolution M by N (for example, 800x600), you are supposed to point out the strictly dominant color.

Input Specification:

Each input file contains one test case.  For each case, the first line contains 2 positive numbers: M (<=800) and N (<=600) which are the resolutions of the image.  Then N lines follow, each contains M digital colors in the range [0, 224).  It is guaranteed that the strictly dominant color exists for each input image.  All the numbers in a line are separated by a space.

Output Specification:

For each test case, simply print the dominant color in a line.

Sample Input:

5 3
0 0 255 16777215 24
24 24 0 0 24
24 0 24 24 24

Sample Output:

24
#include <map>
#include <iostream>
using namespace std;

int main() {

    int n, m;
    map<int, int> mp;

    mp.clear();

    cin >> n >> m;

    int i, j;


    int max = -1;

    for(i = 1; i <= m; i ++) {

        for(j = 1; j <= n; j ++) {

            int a;

            cin >> a;

            mp[a] ++;

            if(mp[a] > max) {

                max = a;
            }
        }
    }

    cout << max << endl;
    return 0;
}


 

The World's Richest

 

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

 

#include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;

struct People {

	char name[10];
	int age;
	int wealth;

	bool operator < (const People &A) const {
	
		return age < A.age;
	}

}pl[100010], cl[100010];

bool cmp1(People a, People b) {

	if(a.wealth != b.wealth) {
	
		return a.wealth > b.wealth;
	}

	else if(a.age != b.age) {
	
		return a.age < b.age;
	}

	else {
	
		return strcmp(a.name, b.name) < strcmp(b.name, a.name);
	}
}

int main() {

	int n, k;
	int i, j;

	scanf("%d %d", &n, &k);

	for(i = 1; i <= n; i ++) {
	
		scanf("%s %d %d", pl[i].name, &pl[i].age, &pl[i].wealth);
	}

	sort(pl + 1, pl + n + 1);

	int num, agemin, agemax, count;

	for(i = 1; i <= k; i ++) {
	
		scanf("%d %d %d", &num, &agemin, &agemax);

		count = 1;

		for(j = 1; j <= n; j ++) {
		
			if(pl[j].age < agemin) continue;

			if(pl[j].age >= agemin && pl[j].age <= agemax) {
			
				cl[count ++] = pl[j];
			}

			if(pl[j].age > agemax) break;
		}

		printf("Case #%d:\n", i);

		count --;

		if(count != 0)
		{
			
			sort(cl + 1, cl + count + 1, cmp1);

			num = num <= count ? num : count;

			for(j = 1; j <= num; j ++) {
				
				printf("%s %d %d\n", cl[j].name, cl[j].age, cl[j].wealth);
			}
		}

		else printf("None\n");
	}

	return 0;
}


 


 

PCB仿真软件:Altium Designer_(6).PCB布线设计:自动布线与手工布线 通过以上步骤,我们完成了一个简单的PCB设计案例。在这个过程中,我们使用了自动布线和手工布线的综合策略,确保布线质量符合设计要求。创建PCB项目:在Altium Designer中创建一个新的PCB项目。导入原理图:将原理图文件导入到PCB项目中。设置布线规则:通过设置必要的布线规则,如线宽、间距等。启动自动布线:使用自动布线器进行初步布线。手工优化布线:通过手工布线工具优化关键信号的布线路径。保存和导出PCB文件:保存PCB文件并导出Gerber文件,用于生产。 阅读详情

相关推荐

利用eds editor生成CANOPEN 设备eds文件

通过以上步骤,您可以根据实际设备的功能特性,自动生成一份符合CANopen协议标准的电子数据表(EDS文件),该文件可以被上位机软件或其他CANopen主站设备用于识别、配置和控制您的CANopen从站设备。使用CANopen EDS Editor生成CANOPEN设备的EDS文件是一个系统化的过程,它涉及将设备的具体技术参数和功能映射到CANopen规范定义的对象字典中。

weixin_38604759的博客 6458

PAT甲级--1055 The World‘s Richest (25 分)

1055 The World's Richest (25 分)

codecompasses的博客 548

解密高并发系统的瓶颈:五大解决方案

在互联网应用中,高并发是指在短时间内同时有大量的用户访问一个网站或服务,造成系统压力过大,导致服务器宕机或服务停止响应的情况。高并发是互联网应用面临的一个重要问题,需要采取一系列措施来解决。负载均衡、缓存、数据库优化、异步处理和分布式架构是解决高并发问题的主要方法。在实际应用中,需要根据具体情况选择不同的方法来解决高并发问题。在高并发情况下,使用负载均衡是解决问题的一种常见方法。负载均衡可以通过将请求分配到多个服务器上,从而减少单个服务器的负载。这可以通过硬件设备或软件实现。

BUG制造者:图图 <p>这是一个P标签</p> 3903

【PAT刷题甲级】1055.The World‘s Richest

1055 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 people in a certain range of

C_greenbird的博客 328

优化NEXYS A7开发板(Xilinx Artix-7)Microblaze核的FLASH读写性能实战

本文针对NEXYS A7开发板(Xilinx Artix-7)上Microblaze核读写FLASH速度慢的问题,提供了系统性的优化实战指南。通过深入分析SPI控制器配置、Flash指令模式选择、Microblaze核的Cache与硬件加速器优化,以及程序运行位置(BRAM vs DDR)的调整,有效将FLASH读写性能从“龟速”提升至接近理论峰值。文章结合实测数据,为FPGA嵌入式开发者提供了清晰的性能瓶颈分析与解决方案。

carrot的博客 256

SAP VC实战:用CU01和CS02搞定BOM里的‘智能’对象相关性(附语法避坑指南)

在工业制造领域,产品配置的复杂性往往超出想象。想象一下,当客户需要定制一台工业设备时,可能有数百种配置选项相互影响——从基础材质到动力系统,从控制模块到安全装置。如何在SAP系统中优雅地管理这种复杂性?对象相关性(Object Dependencies)就是解决这一挑战的利器。

weixin_42524824的博客 467

「1055」The World's Richest

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_52435933的博客 216

飞书云文档API操作详细介绍

开通云文档API、python程序调用飞书api、飞书获取app_id和app_secret、

Brother_ning的博客 1万+

PAT甲级-1055 The World‘s Richest

PAT甲级-1055 The World's Richest C++ 排序

weixin_74092648的博客 805

Allegro如何进行四层板板层设计

板层的设计

weixin_42499230的博客 3189

2026年广东省职业院校技能大赛中职组“大数据应用与服务”样题一完整参考答案

2026年广东省职业院校技能大赛中职组“大数据应用与服务”样题一完整参考答案

我是网络安全兼技能大赛工程师,专注网络安全技术学习与技能大赛实战!持续分享最新的技术文章,帮你少走弯路,一起在技术赛道上进步~ 743

1055 The World‘s Richest (有时候不要把问题想得太复杂)

总结教训:其实后面想想,这题的数据范围确实很难达到1e5*1e3,所以这题败在了计算数据范围上了,而且就算是1e5*1e3(1e5个人,1e3次查询,且每次查询都查不到),那也可以先尝试着写个暴力上去拿分的,也花不了多长时间,pat的题目大多其实还是友善的,有时候暴力甚至都能拿不少分。思路:原先看见数据范围,1e5*1e3,嗯,这题肯定不只是排序那么简单,于是优化又优化,把stl的功能尝试了个遍,各种排序,又绞尽脑汁地想二分等等等等费劲心思去优化掉一个复杂度,,最后放弃。

qq_63128300的博客 483

web渗透学习手册

依据多年的渗透测试项目经验及个人理解,对漏洞分类

渗透之路,攻防之间皆学问 1万+

【PAT甲级】1055 The World's Richest

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...

Y_CanFly的小小博客 402

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

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

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

PAT甲级1055: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 people in a certain range of ages. That is, given the net

博客简介 349

SIMATIC S7-1200, S7-1500 PID 控制[手册]

SIMATIC S7-1200, S7-1500 PID 控制[手册]

pat 甲级 1055 The World‘s Richest

【代码】pat 甲级 1055 The World‘s Richest。

weixin_50671259的博客 556

PAT甲级:1055 The World‘s Richest |Python

再写一个自定义排序的函数来将People这个包含所有Person对象的列表按照题目要求的排序方式进行排序。每次读入一个人的三个属性 就把它定义为一个Person的对象 放入People数组中。最后每次都遍历一次People列表 若当前对象的年龄是在范围内 输出即可。首先需要一个Person类 其中包含三个属性:财富、名字、年龄。.........

KS的博客 368

PAT乙级 1023 组个最小数

#include<iostream> #include<string> #include<map> #include<algorithm> #include<bits/stdc++.h> using namespace std; int main(void){ int n; vector<int> vec; for(int i=0; i<10; i++) { cin>&g.

邹九的个人博客 570

【PAT(甲级)】1055 The World‘s Richest

1. 超时的问题,记住一定不要用c++的读取与输出,不然一直超时的!就算你把年龄当作下标也一样会超时。题目要求输出,在要求年龄范围内的按照(钱多(年青(名字按字典排序)))的优先级输出相应的富豪个数。3.在输出的时候添加break,使得程序运行的时候可以更快。1.我们就先定义一个结构用来存储富豪的相关信息;2.用sort对这些信息按照要求快排;

weixin_55202895的博客 399

2025年浙江大学计算机复试考研上机真题

历年浙江大学计算机复试上机真题历年浙江大学计算机复试机试真题2024浙江大学计算机复试上机真题2024浙江大学计算机复试机试真题。

u014339447的博客 1584

1055 The World‘s Richest (25 分) java 题解

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 wor

深街酒徒的博客 511

1055 The World's Richest(25 分)

1055 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, b...

chenyutingdaima的博客 1116

1055. The World's Richest (25)【排序】——PAT (Advanced Level) Practise

题目信息1055. The World’s Richest (25)时间限制400 ms 内存限制128000 kB 代码长度限制16000 BForbes magazine publishes every year its list of billionaires based on the annual ranking of the world’s wealthiest people. Now

1918

PAT甲级刷题记录——1055 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...

一只奋斗中的本科生 422

1055 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...

凡心所向,素履所往,生如逆旅,一苇以航 331

A1055 The World's Richest (25 分)

#include&lt;cstdio&gt; #include&lt;cstring&gt; #include&lt;algorithm&gt; using namespace std; struct person { char name[10]; int age; int worth; }rich[100010]; bool cmp(person a, person b) { if (a...

A_Aria的博客 296
上一篇: HDOJ 1005
下一篇: zoj1204给01串排序
walter1990
博客等级 码龄15年 31粉丝 376原创
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值