暑假集训之——sort+结构体练习

智能农业大棚 目 录 摘要 1.绪论 2.系统概述及单片机介绍 2.1整体方案设计思想 2.2系统组成 2.2.1主控芯片的选择 2.2.2传感器模块选择 2.2.3电机驱动模块 2.3 单片机介绍 2.3.1 AT89C51单片机的基本组成 2.3.2AT89C51主要特性 2.3.3管脚说明 2.3.4 AT89C51单片机的存储器 2.3.4.1 程序存储器 2.3.4.2 数据存储器 2.3.5 振荡电路和时钟 2.3.6 AT89C51的中断 阅读详情

虽然有很多题以前有做过,可这次做还是WA了好几发,有些东西看来还是没有掌握透彻。

A - A

来源:HDU1234

每天第一个到机房的人要把门打开,最后一个离开的人要把门关好。现有一堆杂乱的机房签 
到、签离记录,请根据记录找出当天开门和关门的人。 

Input

测试输入的第一行给出记录的总天数N ( > 0 )。下面列出了N天的记录。 
每天的记录在第一行给出记录的条目数M ( > 0 ),下面是M行,每行的格式为 

证件号码 签到时间 签离时间 

其中时间按“小时:分钟:秒钟”(各占2位)给出,证件号码是长度不超过15的字符串。 

Output

对每一天的记录输出1行,即当天开门和关门人的证件号码,中间用1空格分隔。 
注意:在裁判的标准测试输入中,所有记录保证完整,每个人的签到时间在签离时间之前, 
且没有多人同时签到或者签离的情况。 

Sample Input

3
1
ME3021112225321 00:00:00 23:59:59
2
EE301218 08:05:35 20:56:35
MA301134 12:35:45 21:40:42
3
CS301111 15:30:28 17:00:10
SC3021234 08:00:00 11:25:25
CS301133 21:45:00 21:58:40

Sample Output

ME3021112225321 ME3021112225321
EE301218 MA301134
SC3021234 CS301133

 思路:将时间都处理为以秒为单位的,开门人来的时间是最早的,关门人走的时间是最晚的,对于每一个人来说,都有与之对应的到达时间和离开时间。两个排序可以找到

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;

struct node{
	char name[100];
	int sh,sm,ss,eh,em,es;
	int st,et;
}a[10000];
bool cmp1(node x,node y)
{
	return x.st<y.st;
}
bool cmp2(node x,node y)
{
	return x.et>y.et;
}
int main()
{
	int n,m;
	scanf("%d",&m);
	while(m--)
	{
		scanf("%d",&n);
		for(int i=0;i<n;i++)
		{
			scanf("%s %d:%d:%d %d:%d:%d",a[i].name,&a[i].sh,&a[i].sm,&a[i].ss,&a[i].eh,&a[i].em,&a[i].es);
			a[i].st=a[i].sh*3600+a[i].sm*60+a[i].ss;
			a[i].et=a[i].eh*3600+a[i].em*60+a[i].es;
		}
		sort(a,a+n,cmp1);
		printf("%s",a[0].name);
		sort(a,a+n,cmp2);
		printf(" %s\n",a[0].name);
		
	}
	return 0;
}

 


B - B

Excel可以对一组纪录按任意指定列排序。现请你编写程序实现类似功能。

Input

测试输入包含若干测试用例。每个测试用例的第1行包含两个整数 N (<=100000) 和 C,其中 N 是纪录的条数,C 是指定排序的列号。以下有 N 
行,每行包含一条学生纪录。每条学生纪录由学号(6位数字,同组测试中没有重复的学号)、姓名(不超过8位且不包含空格的字符串)、成绩(闭区间[0, 100]内的整数)组成,每个项目间用1个空格隔开。当读到 N=0 时,全部输入结束,相应的结果不要输出。 

Output

对每个测试用例,首先输出1行“Case i:”,其中 i 是测试用例的编号(从1开始)。随后在 N 行中输出按要求排序后的结果,即:当 C=1 时,按学号递增排序;当 C=2时,按姓名的非递减字典序排序;当 C=3 
时,按成绩的非递减排序。当若干学生具有相同姓名或者相同成绩时,则按他们的学号递增排序。 

Sample Input

3 1
000007 James 85
000010 Amy 90
000001 Zoe 60
4 2
000007 James 85
000010 Amy 90
000001 Zoe 60
000002 James 98
4 3
000007 James 85
000010 Amy 90
000001 Zoe 60
000002 James 90
0 0

Sample Output

Case 1:
000001 Zoe 60
000007 James 85
000010 Amy 90
Case 2:
000010 Amy 90
000002 James 98
000007 James 85
000001 Zoe 60
Case 3:
000001 Zoe 60
000007 James 85
000002 James 90
000010 Amy 90

姓名或者成绩相同的时候按学号递增排序,注意一下这点就好了

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
const int maxn=100000+9;
struct node{
	int id,score;
	char name[10];
}a[maxn];

bool cmp1(node x,node y)
{
	return x.id<y.id;
}
bool cmp2(node x,node y)
{
	return strcmp(x.name,y.name)==0?x.id<y.id:strcmp(x.name,y.name)<0;
}
bool cmp3(node x,node y)
{
	return x.score==y.score?x.id<y.id:x.score<y.score;
}

int main()
{
	int n,c;
	int t=0;
	while(~scanf("%d %d",&n,&c)&&n)
	{
		for(int i=0;i<n;i++)
			cin>>a[i].id>>a[i].name>>a[i].score;
		switch (c)
		{
			case 1:sort(a,a+n,cmp1);break;
			case 2:sort(a,a+n,cmp2);break;
			case 3:sort(a,a+n,cmp3);break;
		}
		printf("Case %d:\n",++t);
		for(int i=0;i<n;i++)
		printf("%06d %s %d\n",a[i].id,a[i].name,a[i].score);
	}
	return 0;
}

C - C

还记得Gardon给小希布置的那个作业么?(上次比赛的1005)其实小希已经找回了原来的那张数表,现在她想确认一下她的答案是否正确,但是整个的答案是很庞大的表,小希只想让你把答案中最大的M个数告诉她就可以了。 
给定一个包含N(N<=3000)个正整数的序列,每个数不超过5000,对它们两两相加得到的N*(N-1)/2个和,求出其中前M大的数(M<=1000)并按从大到小的顺序排列。

Input

输入可能包含多组数据,其中每组数据包括两行: 
第一行两个数N和M, 
第二行N个数,表示该序列。 
 

Output

对于输入的每组数据,输出M个数,表示结果。输出应当按照从大到小的顺序排列。

Sample Input

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

Sample Output

7 6 5 5
11 10 9 9 8

暴力出奇迹。

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
const int maxn=3002;
int a[maxn];
int b[maxn*maxn];

bool cmp(int x,int y)
{
	return x>y;
}

int main()
{
	int n,m;
	while(~scanf("%d %d",&n,&m))
	{
		for(int i=0;i<n;i++)
			scanf("%d",&a[i]);
		int z=0;
		for(int i=0;i<n;i++)
			for(int j=i+1;j<n;j++)
				b[z++]=a[i]+a[j];
		sort(b,b+z,cmp);
		for(int i=0;i<m;i++)
		{
			if(i)	printf(" ");
			printf("%d",b[i]);
		}
		printf("\n");
	}
	return 0;
}

D - D

读入N名学生的成绩,将获得某一给定分数的学生人数输出。 

Input

测试输入包含若干测试用例,每个测试用例的格式为 


第1行:N 
第2行:N名学生的成绩,相邻两数字用一个空格间隔。 
第3行:给定分数 

当读到N=0时输入结束。其中N不超过1000,成绩分数为(包含)0到100之间的一个整数。 

Output

对每个测试用例,将获得给定分数的学生人数输出。 

Sample Input

3
80 60 90
60
2
85 66
0
5
60 75 90 55 75
75
0

Sample Output

1
0
2


        
  
Huge input, scanf is recommended.

数量比较小的话用桶排序比较方便

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int score[105];
int main()
{
	int n,m;	int x;
	while(~scanf("%d",&n)&&n)
	{
		memset(score,0,sizeof(score));
		for(int i=0;i<n;i++)
		{
			scanf("%d",&x);
			score[x]++;
		}
		scanf("%d",&m);
		printf("%d\n",score[m]);
	 } 
	return 0;
}

E - E

大家都知道,快速排序是不稳定的排序方法。 
如果对于数组中出现的任意a[i],a[j](i<j),其中a[i]==a[j],在进行排序以后a[i]一定出现在a[j]之前,则认为该排序是稳定的。 

某高校招生办得到一份成绩列表,上面记录了考生名字和考生成绩。并且对其使用了某排序算法按成绩进行递减排序。现在请你判断一下该排序算法是否正确,如果正确的话,则判断该排序算法是否为稳定的。 

Input

本题目包含多组输入,请处理到文件结束。 
对于每组数据,第一行有一个正整数N(0<N<300),代表成绩列表中的考生数目。 
接下来有N行,每一行有一个字符串代表考生名字(长度不超过50,仅包含'a'~'z'),和一个整数代表考生分数(小于500)。其中名字和成绩用一个空格隔开。 
再接下来又有N行,是上述列表经过某排序算法以后生成的一个序列。格式同上。

Output

对于每组数据,如果算法是正确并且稳定的,就在一行里面输出"Right"。如果算法是正确的但不是稳定的,就在一行里面输出"Not Stable",并且在下面输出正确稳定排序的列表,格式同输入。如果该算法是错误的,就在一行里面输出"Error",并且在下面输出正确稳定排序的列表,格式同输入。 

注意,本题目不考虑该排序算法是错误的,但结果是正确的这样的意外情况。

Sample Input

3
aa 10
bb 10
cc 20
cc 20
bb 10
aa 10
3
aa 10
bb 10
cc 20
cc 20
aa 10
bb 10
3
aa 10
bb 10
cc 20
aa 10
bb 10
cc 20

Sample Output

Not Stable
cc 20
aa 10
bb 10
Right
Error
cc 20
aa 10
bb 10

WA了好几次,因为没有注意题意。。。

这道题要注意如果成绩相同的话,姓名是按照输入的顺序排列的,这点比较坑

需要记录下输入顺序

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
const int maxn=300+9;
struct node{
	char name[55];
	int score,m;
}a[maxn];

bool cmp(node x,node y)
{
	return x.score==y.score?x.m<y.m:x.score>y.score;//成绩相同的话按照输入顺序从小到大排列 
}

int main()
{
	int n;
	node b[maxn];
	while(~scanf("%d",&n))
	{
		for(int i=0;i<n;i++)
		{
			cin>>a[i].name>>a[i].score;
			a[i].m=i;//记录输入的顺序 
		}
		for(int i=0;i<n;i++)
			cin>>b[i].name>>b[i].score;
		sort(a,a+n,cmp);
		int x=0,y=0;
		for(int i=0;i<n;i++)
			if(a[i].score!=b[i].score)
			{
				y=1;//Error
				break;
			 } 
		for(int i=0;i<n;i++)
			if(strcmp(a[i].name,b[i].name)!=0)	
			{
				x=1;//Not Stable
				break;
			}
		if(x==0&&y==0)	
		{
			printf("Right\n");
			continue;
		}
		if(y==1)
		{
			printf("Error\n");
			for(int i=0;i<n;i++)
				printf("%s %d\n",a[i].name,a[i].score);
			continue;
		}
		if(x==1)
		{
			printf("Not Stable\n");
			for(int i=0;i<n;i++)
				printf("%s %d\n",a[i].name,a[i].score);
		}
	}
	return 0;
}

F - F

“Point, point, life of student!” 
This is a ballad(歌谣)well known in colleges, and you must care about your score in this exam too. How many points can you get? Now, I told you the rules which are used in this course. 
There are 5 problems in this final exam. And I will give you 100 points if you can solve all 5 problems; of course, it is fairly difficulty for many of you. If you can solve 4 problems, you can also get a high score 95 or 90 (you can get the former(前者) only when your rank is in the first half of all students who solve 4 problems). Analogically(以此类推), you can get 85、80、75、70、65、60. But you will not pass this exam if you solve nothing problem, and I will mark your score with 50. 
Note, only 1 student will get the score 95 when 3 students have solved 4 problems. 
I wish you all can pass the exam! 
Come on! 

Input

Input contains multiple test cases. Each test case contains an integer N (1<=N<=100, the number of students) in a line first, and then N lines follow. Each line contains P (0<=P<=5 number of problems that have been solved) and T(consumed time). You can assume that all data are different when 0<p. 
A test case starting with a negative integer terminates the input and this test case should not to be processed. 

Output

Output the scores of N students in N lines for each case, and there is a blank line after each case. 

Sample Input

4
5 06:30:17
4 07:31:27
4 08:12:12
4 05:23:13
1
5 06:30:17
-1

Sample Output

100
90
90
95

100

有五道题,全做对得100分,做对0道得50(交白卷还给分?)

做对4道可以得95 or90

做对3道可以得85 or80

做对2道可以得75 or70

做对1道可以得65 or60

 

在做对相同题目的人中,排名靠前的一半比排名靠后的多得5分(注意,3个人都做对4道题的话只有一个人能够得到95分)

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;

struct node{
	int score,problems,num,t,h,m,s;
}a[105];

bool cmp1(node x,node y)
{
	return x.problems==y.problems?x.t<y.t:x.problems<y.problems;//按成绩从大到小排列,成绩相同按做题时间从小到大排列 
}
bool cmp2(node x,node y)
{
	return x.num<y.num;
}
int main()
{
	int n;
	while(~scanf("%d",&n)&&(n>0))
	{
		for(int i=0;i<n;i++)
		{
			scanf("%d %d:%d:%d",&a[i].problems,&a[i].h,&a[i].m,&a[i].s);
			a[i].num=i;
			a[i].t=3600*a[i].h+60*a[i].m+a[i].s;
			if(a[i].problems==5)	a[i].score=100;
			if(a[i].problems==0)	a[i].score=50;
		}
		sort(a,a+n,cmp1);
		int two=0;
		int three=0;
		int four=0;
		int one=0;
		for(int i=0;i<n;i++)
		{
			if(a[i].problems==4) four++;
			if(a[i].problems==3) three++;
			if(a[i].problems==2) two++;
			if(a[i].problems==1) one++;
		}
//		printf("\n\nfour:%d\n\n",four);
		int z=four/2;
		int k=0;
		for(int i=0;i<n;i++)
		{
			if(a[i].problems==4)
			{
				if(k<z)	a[i].score=95;
				else		a[i].score=90;
				k++;
			}
		}
	 	z=three/2;
		k=0;
		for(int i=0;i<n;i++)
		{
			if(a[i].problems==3)
			{
				if(k<z)	a[i].score=85;
				else		a[i].score=80;
				k++;
			}
		}
		z=two/2;
		k=0;
		for(int i=0;i<n;i++)
		{
			if(a[i].problems==2)
			{
				if(k<z)	a[i].score=75;
				else		a[i].score=70;
				k++;
			}
		}
		z=one/2;
		k=0;
		for(int i=0;i<n;i++)
		{
			if(a[i].problems==1)
			{
				if(k<z)	a[i].score=65;
				else		a[i].score=60;
				k++;
			}
		}
		sort(a,a+n,cmp2);
		for(int i=0;i<n;i++)
			printf("%d\n",a[i].score);
		printf("\n");
	}
	return 0;
}

 

这里是很久之前的代码,思路基本是一样的:

#include<stdio.h> 
#include<string.h>
#include<algorithm>
using namespace std;
struct node{
    int t,h,m,s;
    int first;
    int grade,score;
}a[101];
int cmp1(node x,node y)
{
    return x.grade!=y.grade?x.grade>y.grade:x.t<y.t;
}
int cmp2(node x,node y)
{
    return x.first<y.first;
}
int main() 
{
    int n;
    while(scanf("%d",&n)!=EOF)
    {
        if(n<0)    break;
        for(int i=0;i<n;i++)
        {
            scanf("%d %d:%d:%d",&a[i].grade,&a[i].h,&a[i].m,&a[i].s);
            a[i].first=i;
            a[i].t=a[i].h*3600+a[i].m*60+a[i].s;
        }
        sort(a,a+n,cmp1);
        int g1=0,g2=0,g3=0,g4=0,c1,c2,c3,c4;
        for(int i=0;i<n;i++)
        {
            if(a[i].grade==5)    a[i].score=100;
            if(a[i].grade==4)    g4++; 
            if(a[i].grade==3)    g3++;
            if(a[i].grade==2)    g2++;
            if(a[i].grade==1)    g1++;
            if(a[i].grade==0)    a[i].score=50;
        }
        c4=g4/2;c3=g3/2;c2=g2/2;c1=g1/2;
        for(int i=0;i<n;i++)
        {
            if(c4>0&&a[i].grade==4)        {a[i].score=95;c4--;}    
            else if(a[i].grade==4)        a[i].score=90;
            if(c3>0&&a[i].grade==3)        {c3--;a[i].score=85;}    
            else if(a[i].grade==3)        a[i].score=80;
            if(c2>0&&a[i].grade==2)        {c2--;a[i].score=75;}    
            else if(a[i].grade==2)        a[i].score=70;
            if(c1>0&&a[i].grade==1)        {c1--;a[i].score=65;}    
            else if(a[i].grade==1)        a[i].score=60;
        }
        sort(a,a+n,cmp2);
        for(int i=0;i<n;i++)
        printf("%d\n",a[i].score);
        printf("\n");
    }
    return 0;
}

 


G - G

Limak is a little polar bear. He has n balls, the i-th ball has size ti.

Limak wants to give one ball to each of his three friends. Giving gifts isn't easy — there are two rules Limak must obey to make friends happy:

  • No two friends can get balls of the same size.
  • No two friends can get balls of sizes that differ by more than 2.

For example, Limak can choose balls with sizes 4, 5 and 3, or balls with sizes 90, 91 and 92. But he can't choose balls with sizes 5, 5 and 6 (two friends would get balls of the same size), and he can't choose balls with sizes 30, 31 and 33 (because sizes 30 and 33 differ by more than 2).

Your task is to check whether Limak can choose three balls that satisfy conditions above.

Input

The first line of the input contains one integer n (3 ≤ n ≤ 50) — the number of balls Limak has.

The second line contains n integers t1, t2, ..., tn (1 ≤ ti ≤ 1000) where ti denotes the size of the i-th ball.

Output

Print "YES" (without quotes) if Limak can choose three balls of distinct sizes, such that any two of them differ by no more than 2. Otherwise, print "NO" (without quotes).

Examples

Input

4
18 55 16 17

Output

YES

Input

6
40 41 43 44 44 44

Output

NO

Input

8
5 972 3 4 1 4 970 971

Output

YES

Note

In the first sample, there are 4 balls and Limak is able to choose three of them to satisfy the rules. He must must choose balls with sizes 18, 16 and 17.

In the second sample, there is no way to give gifts to three friends without breaking the rules.

In the third sample, there is even more than one way to choose balls:

  1. Choose balls with sizes 3, 4 and 5.
  2. Choose balls with sizes 972, 970, 971.

思路:存在三个连续的数就输出YES否则NO

#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;

int a[1005];
int main()
{
	int n;
	while(~scanf("%d",&n))
	{
		int x;
		int k=0;
		memset(a,0,sizeof(a));
		for(int i=0;i<n;i++)
		{
			scanf("%d",&x);
			a[x]++;
		}
		for(int i=1;i<1004;i++)
			if(a[i]&&a[i+1]&&a[i+2])	
			{
				k=1;
				break;
			}
		if(k)	printf("YES\n");
		else	printf("NO\n");	
	}
	return 0;
}

 


H - H

“今年暑假不AC?” 
“是的。” 
“那你干什么呢?” 
“看世界杯呀,笨蛋!” 
“@#$%^&*%...” 

确实如此,世界杯来了,球迷的节日也来了,估计很多ACMer也会抛开电脑,奔向电视了。 
作为球迷,一定想看尽量多的完整的比赛,当然,作为新时代的好青年,你一定还会看一些其它的节目,比如新闻联播(永远不要忘记关心国家大事)、非常6+7、超级女生,以及王小丫的《开心辞典》等等,假设你已经知道了所有你喜欢看的电视节目的转播时间表,你会合理安排吗?(目标是能看尽量多的完整节目) 

Input

输入数据包含多个测试实例,每个测试实例的第一行只有一个整数n(n<=100),表示你喜欢看的节目的总数,然后是n行数据,每行包括两个数据Ti_s,Ti_e (1<=i<=n),分别表示第i个节目的开始和结束时间,为了简化问题,每个时间都用一个正整数表示。n=0表示输入结束,不做处理。 

Output

对于每个测试实例,输出能完整看到的电视节目的个数,每个测试实例的输出占一行。

Sample Input

12
1 3
3 4
0 7
3 8
15 19
15 20
10 15
8 18
6 12
5 10
4 14
2 9
0

Sample Output

5

 

活动安排问题的模板题,按照结束时间早的顺序排序

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;

struct node{
	int st,et;
}a[105]; 

bool cmp(node x,node y)
{
	return x.et<y.et;
}

int main()
{
	int n;
	while(~scanf("%d",&n)&&n)
	{
		for(int i=0;i<n;i++)
			cin>>a[i].st>>a[i].et;
		sort(a,a+n,cmp);
		int z=a[0].et;
		int ans=1;
		for(int i=1;i<n;i++)
			if(a[i].st>=z)
			{
				ans++;
				z=a[i].et;
			}
		cout<<ans<<endl;
	}
	return 0;
}

       

【VibeCoding系列】小白入门指南:模型选择、编辑器选择、项目预定全分析 开箱即用:下载安装就能用,不用配 API Key(也可以自己配)Cmd+K 快速修改:选中代码,按 Cmd+K,直接让 AI 修改Cmd+L 对话:侧边栏聊天,支持引用文件和代码@文件引用:输入 @ 就能引用项目中的文件,AI 自动读取上下文Agent 模式:告诉 AI 一个需求,它自动跨文件修改下载地址cursor.com(免费版有额度限制,足够入门)✅下载 Cursorcursor.com),安装打开✅选一个小项目(个人名片页 or Todo List)✅按照七步工作流开干。 阅读详情

相关推荐

整理笔记——二极管

二极管是一种由半导体材料制成的一种具有单向导电性能的电子元器件,二极管的核心是PN结。加在二极管两端的电压和通关的电流被成为,二极管的伏安特性曲线​​​二极管的正向特性:起初正向电压较小时,正向电流几乎没有,称之为死区,此时二极管处于截止状态。当电压差超过截止电压(0.5V或者0.7V),电流随着电压上升,开始增加缓慢,随后急剧增大,二极管的电阻变小进入导通状态,此时电压变化较小。二极管的反向特性:起初反向电流很小,不随电压二变化,此时成为反向饱和电流;当方向电压达到二极管的反向击穿电压。

#include 811

Element表格---使用sort-method实现的几种排序

html部分 :sort-method="sortNumber" //html部分 <el-table-column sortable :sort-method="sortNumber" label="金额" prop="total" /> js部分 methods:{ sortMethod(a, b) { return a.total - b.total } }

pei_y_y的博客 5577

Unity URP项目里Post Processing死活没效果?别急,这5个坑我帮你踩过了

本文详细解析了Unity URP项目中Post Processing效果不显示的5个常见问题及解决方案,包括管线配置、Volume设置、摄像机选项、Layer冲突和Shader兼容性。通过专业排查步骤和实用代码片段,帮助开发者快速定位并修复后处理效果失效问题,提升项目开发效率。

weixin_28693309的博客 233

HDU——1084 What is your grade?(莫名的Wrong Answer)

Problem Description “Point, point, life of student!” This is a ballad(歌谣)well known in colleges, and you must care about your score in this exam too. How many points can you get? Now, I told you the...

LightOn 378

锐浪报表 Grid++Report 子报表 Delphi

锐浪报表 Grid++Report 是国内较好的报表控件,本人一直使用它,做出很多特色的报表。可以说你的报表设计出来,它基本上能做出来。 但是它帮助文件上,说的不深,近期因为要做一个有关社工的报表,大表中,嵌套2个子表。可以说,一个表到三个数据集,分别打印。 在认真看了帮助的基础上,网上探索,基本无此类,特别是Delphi的帮助,几乎为零。经二天摸索,做出来了。 一、设计思路 1、大表和二个小表,可以设计为三个表,分别使用三个GridppReport控件,取名...

lyhoo163的专栏 9074

DCDC系列(一): COT DCDC基本原理

电流环DCDC属于双环控制模式,根据电流检测的位置,分为峰值电流环控制模式、谷值电流环控制模式和平均电流环控制模式,主要由输出电压反馈环和电流环两个环路来实现控制,其瞬态响应比电压环更好,且有自动限流的功能,但仍需要斜坡补偿网络,且对噪声敏感。Stage3: 在下管NMOS打开阶段,由于后级负载此时间段内消耗的电量较少,所以VFB还未低至Vref,所以此阶段中,上管PMOS和下管NMOS均处于关断状态,此时的电感电流为0mA,此阶段测的VSW上的电压就是Cout上的电压VREG;

weixin_40073649的博客 3941

"巴卡斯杯" 中国大学生程序设计竞赛 - 女生专场(重现)解题思路

"巴卡斯杯" 中国大学生程序设计竞赛 - 女生专场(重现)解题思路

queuelovestack的专栏 1万+

simulink中无迹卡尔曼(UKF)模块使用

simulink的UKF模块简单说明

qq_41059950的博客 2821

HDOJ1872(稳定排序)

稳定排序 Time Limit: 3000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1066Accepted Submission(s): 408 Problem Description 大家都知道,快速排序是不稳定的排序方法。 如果对于...

weixin_30402085的博客 491

告别龟速计算!用Python的fengwo模块5分钟搞定通达信COST/WINNER函数(附完整代码)

本文介绍如何使用Python的fengwo模块高效复现通达信的COST和WINNER函数,解决量化交易中的计算精度和性能问题。通过C++核心算法和多线程优化,计算速度提升显著,误差低于0.5%,并支持与通达信DLL无缝集成,适用于实盘交易策略开发。

weixin_42533751的博客 600

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

sort函数的第三个参数cmp

sort 函数的第三个参数 cmp

风暴计划 6730

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

暑假算法集训(第一周)

算法暑期训练

qq_56356279的博客 1059

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

2019年暑假集训第十一套题

问题 A: 排名 题目描述 在ACM竞赛中,当遇到有两个队伍(人) 解出相同的题目数量的时候,我们需要通过他们解决问题的总时间进行排序。 一共有 N(1<=N<=5,000)条时间被以时(0<=Hours<=99), 分(0<=Minutes<=59),秒(0<=Seconds<=59)的形式记录。 你必须要把他们按时,分,秒排序为 升序,最少的...

算法小猪的博客 774

2019暑假集训第二周tips

1 用reverse() 函数时要加算法头文件 #include<algorithm> 或者直接万能头文件 #include"bits/stdc++.h" 2 sort() 函数排序的范围是 [ first, last ),包括 first,不包括 last sort() 可以用自定义的比较函数进行排 序,也可以用系统的4种排序:less、greater、 less_equal(小...

qq_40409416的博客 187

ACM暑假集训_STL&模拟_B-Where is the Marble?

ACM暑假集训_STL&amp;模拟_B-Where is the Marble? Description Raju and Meena love to play with Marbles. They have got a lot of marbles with numbers written on them. At the beginning, Raju would place the m...

油爆虾的博客 410

ACM暑假培训第二周学习总结----出自南昌理工学院ACM集训队

1.vector与数组的区别 vector是c++标准库中bai定义的类型,是容器du的一种。标准库中容器有很多种,vector只是最基本的一种,vector类型和数组类型的基本功能都是一样的,就是存储同类元素,但是他与数组最大的区别就是可以实现动态存储。 vector相当于动态数组,比如 char str[100];只能存储100个字符。vector可以动态增长。 vector str(10,‘A’); //初始化为zhi包含10个’A’字符的数组 str.push_back(‘B’); // 现在dao

小世儿的博客 341

2021暑假集训-个人赛11

文章目录A.Simply Strange SortB.Charmed by the Game *C.Deep Down BelowD.Up the Strip (simplified version) *E.Up the Strip *F.Bottom-Tier Reversals *G.Top-Notch Insertions * A.Simply Strange Sort 传送门 题目大意:有两种操作,一种是偶数只对偶数和他后面的进行判断,如果前面大,前后就进行交换 ,同理奇数也是这样,奇数跟偶数..

xingzi201的博客 422

暑假集训 8.16 数据结构实验之排序三:bucket sort (简单的桶排序)

数据结构实验之排序三:bucket sort Time Limit: 100ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 根据人口普查结果,知道目前淄博市大约500万人口,你的任务是帮助人口普查办公室按年龄递增的顺序输出每个年龄有多少人,其中不满1周岁的按0岁计算,1到2周岁的按1岁计算,依次类推,大于等于100岁的

Welcome ! This is Guanpx's blog. 423

2016HUAS_ACM暑假集训2G - Who's in the Middle

这个题真的没什么好说的。一个排序就能解决的问题。唯一感到不爽的是这道题不是0msAC的,希望各位大神能够给我点指导。 头文件#include<algorithm>,注意一下排序函数的用法就行了。 我在HDU和POJ上测试了很多次,不得不说HDU确实比较坑爹。POJ上一组案例也是可以过的,当然,这不重要。 题意也简单,大致就是给一组数字要你求中位数。而且给的是奇数个数字。...

dianluoxi8545的博客 138

输出前m个最大数(北京大学暑假集训 )

描述 给定一个数组包含n个元素,统计前m大的数并且把这m个数从大到小输 出。 Input 第一行包含一个整数n和一个整数m。m &lt; n。n表示数组的大小,n &lt; 100000,m表示前m位最大的数。 第二行包含n个整数,表示数组的元素,整数之间以一个空格分开 。每个整数的绝对值不超过100000000。 第三行 output 从大到小输出前m大的数 #in...

weixin_42826497的博客 271

[补题]暑假集训day1_Andrew Stankevich Contest 37

一共9道题,做出4道题,其中我写了两道 A. Achromatic Number n个点的环,给每个点染色使得相邻点颜色不同且所有[Math Processing Error]Ck2C_k^2种颜色相邻都出现过 B. Binary Search C. Blind Flibs D. Bubble Sort E. Word Cover F. Permutations with Monot...

秋叶红于二月花 556

【每日一记·2019.7.17】

2019.7.17(361/119) 记录每天自己的新的感受体会亦或者是题目中的坑。 概述 1.暑假集训第七天。今天中午差点迟到。都到2点20了才醒…惊悚… 2.早上背了复习了前面六天的NewwordsNew wordsNewwords。背了23个新单词。 3.今天把分块看了下。把分块入门一二三四AC了。然后见了一些其他的线段树模型。 题目: 【分块】 其实,大部分的分块都可以用其他的数据结构来代...

EPSILON的博客 255

AtCoder Beginner Contest 254

AtCoder Beginner Contest 254

青少年趣味编程 765

3326:练55.1 合影效果

3326:练55.1 合影效果

青少年趣味编程 520

结合poj 2104,对于简单的归并树谈谈个人的理解和做法

题目:poj 2104 大意:给你一个长度为n的数列,每次查询数列下标为[i,j]区间里面升序排序后第k大的数 (我刚刚加入学校集训队暑假acm集训的时候遇到这题直接头铁sort。。。。现在想起来还真是天真) 由此引出归并树(其实这一题用主席树更快,点击传送!) 首先,区间升序排序第k大需要做一个小小的转换,不妨设那个数就是aim,就是区间内比aim小的&lt;k个,小于等于aim的&gt...

forOnward的博客 306

2026UPC夏季训练赛第一场

最后,作为暑假集训的开端,表达一下个人对集训以及自我在学习过程中的感悟:我们常常在意别人的状态,别人的成就,实则对于每个人自己来说,最重要的是相信自己,我们可能在这个过程中自我松懈,但是你一定要给松懈过的自己创造一个能过从头再来的条件,真正努力的人必须是享受努力的过程的,不然无法坚持下去,我今年才18岁,认知浅显,不可否认二十多岁的工作对后半生十分重要,但是人不应该只着眼于未来成就的那一刻,更应当在每次努力的过程中做好劳逸结合,做好对生活的享受,感悟自己的性格。每个板上都有一面是单词,另一面是图片。

g2257612654321的博客 209
上一篇: 2018年HPUACM暑期集训招新赛
下一篇: Bone Collector(01背包问题)
陶鸿杰
博客等级 码龄9年 93粉丝 298原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值