首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
Maples
2021年5月26日 10:18
清华上机:成绩排序1151
P1151
回复 2
|
赞 31
|
浏览 10.5k
#include<bits/stdc++.h> using namespace std; int main(){ multimap<int, string> mmap;//构造一个允许键的值重复的map储存(分数,姓名) string name = ""; int score = 0; int num = 0, type = 0;; cin >> num >> type;//输入要排序人的个数及排序方式:0降序 1升序 int i = 0; while(i < num &&...
ZeroQi_404
2026年3月18日 12:07
成绩排序 题解:
P1151
回复 0
|
赞 11
|
浏览 366
#include <iostream> #include <vector> #include <algorithm> using namespace std; bool cmp_up(pair<string,int> a, pair<string,int> b){ return a.second < b.second; } bool cmp_down(pair<string,int> a, pair<string,int> b){ return a.sec...
Adelaide111
2026年3月17日 16:32
成绩排序 题解:
P1151
回复 0
|
赞 4
|
浏览 136
#include <bits/stdc++.h> using namespace std; int main() { int n,type;//个数,排序方法 while(cin>>n>>type){ multimap<int,string> mmap;//key值可以相同 string a;//姓名 int b;//成绩 while(n--){ cin>>a>>b; ...
yauqq
2026年3月15日 16:38
成绩排序 题解:相同成绩按输入顺序排 stable_sort
P1151
回复 0
|
赞 14
|
浏览 189
#include<bits/stdc++.h> using namespace std; struct node{ string name; int score; }; bool cmp(node a,node b){ return a.score < b.score; } bool rcmp(node a,node b){ return a.score > b.score; } int main(){ int n; while(cin >> n){ vector<node> s...
无名吟
2026年3月13日 09:36
成绩排序 C语言题解:qsore排序
P1151
回复 1
|
赞 11
|
浏览 206
#include<stdio.h> #include<stdlib.h> typedef struct cj{ char name[100]; int score; }cj; int sign; int compare(const void* a, const void* b){ const cj *aa=(const cj*)a; const cj *bb=(const cj*)b; return sign==1 ? aa->score-bb->score : bb->score-aa->scor...
Jinx_K
2026年3月9日 23:43
成绩排序 题解:C++ 运用结构体、容器、stable_sort
P1151
回复 0
|
赞 13
|
浏览 153
#include <cstdio> #include <algorithm> #include <string> #include <iostream> #include <vector> using namespace std; typedef struct{ string name; int score; }stu; bool comp_des(stu x,stu y) { return x.score>y.score; } bool comp_asc(const stu &...
New_chapter
2026年2月26日 14:12
成绩排序 题解:最简单,最暴力,最易懂的了
P1151
回复 0
|
赞 13
|
浏览 407
#include<iostream> using namespace std; #include<string> struct info{ string name; int guard; }; int main(){ int num; while(cin>>num){ int choice; cin >> choice; info *std=new info[num]; for(int i=0;i<...
曾不会
2026年2月25日 10:59
成绩排序 题解:
P1151
回复 0
|
赞 1
|
浏览 175
while(1): try: m = int(input()) n = int(input()) s = [] index = 0 for i in range(m): name, score = map(str, input().split()) score = int(score) s.append([name, score, index]) index += 1 ...
牧濑
2026年2月24日 11:56
成绩排序 题解:自定义sort排序
P1151
回复 0
|
赞 6
|
浏览 264
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ struct student{ string name; int score; }; int num; int method; while(cin>>num>>method){ vector<student> stu(num); for(int i=0...
bro
2026年2月8日 20:29
成绩排序 题解:c++,用sort实现稳定
P1151
回复 0
|
赞 19
|
浏览 354
#include <bits/stdc++.h> using namespace std; struct Student{ string name; int score; int id; }; bool cmp(Student a ,Student b){ if(a.score == b.score) return a.id < b.id; return a.score < b.score; } bo...
1
2
3
...
6
题目
成绩排序
题解数量
56
发布题解
在线答疑
热门题解
1
成绩排序 题解:详细注释
2
清华上机:成绩排序1151
3
成绩排序 题解:
4
成绩排序 题解:stablesort
5
成绩排序 题解:c++,用sort实现稳定
6
成绩排序 题解:
7
成绩排序 题解:大佬帮忙看看为什么50%
8
成绩排序 纯C题解:
9
成绩排序 题解:相同成绩按输入顺序排 stable_sort
10
成绩排序 题解: