随笔分类 - 排序
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 30; string a[N]; bool cmp(const string &a, const string &b) { //自定义排序函数,这一步非常巧妙,假设a=
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 110; struct Student { string Name; int year, month, day, num; } a[N]; bool cmp(const
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 50010; struct Point { int x, y, z; } a[N]; bool cmp(const Point &a, const Point &b)
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 5010; struct Person { int k; int s; } a[N]; bool cmp(const Person &a, const Person &
阅读全文
摘要:题目传送门 一、原始方法 #include<bits/stdc++.h> using namespace std; const int N = 1010; int a[N], c[N]; int main() { int n; scanf("%d", &n); for (int i = 1; i <
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 10010; int a[N]; int n, cnt; int main() { cin >> n; for (int i = 1; i <= n; i++) cin
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 20010; int a[N]; int main() { int n, b; cin >> n >> b;//b是书架的高度 for (int i = 1; i <=
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; int n; const int N = 30; struct Node { string x; int num; } a[N]; bool cmp(const Node &A, const No
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 310; int n; struct Student { int id, chinese, total; } a[N]; bool cmp(const Student
阅读全文
摘要:题目传送门 #include<bits/stdc++.h> using namespace std; const int N = 110; int a[N]; int main() { int n; cin >> n; for (int i = 0; i < n; i++) cin >> a[i];
阅读全文
摘要:题目传送门 #include<bits/stdc++.h> using namespace std; const int N = 5000010; int a[N]; void quick_sort(int q[], int l, int r, int k) { if (l >= r)return;
阅读全文
摘要:题目传送门 #include<bits/stdc++.h> using namespace std; const int N = 100010; int a[N]; void quick_sort(int q[], int l, int r) { if (l >= r) return; int i
阅读全文
摘要:题目传送门 //P1271.cpp #include <bits/stdc++.h> using namespace std; const int N = 1010; int a[N]; int n, m, tmp; int main() { cin >> n >> m; for (int i =
阅读全文