-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
221 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//#include <algorithm> | ||
//#include <iostream> | ||
//#include <vector> | ||
//#include <string> | ||
//#include <utility> | ||
//using namespace std; | ||
//bool cmp(const pair<int, string>& p1, const pair<int, string>& p2) { | ||
// if (p1.first == p2.first) { | ||
// return false; | ||
// } | ||
// else { | ||
// return p1.first < p2.first; | ||
// } | ||
//} | ||
//int main10814() { | ||
// int n; | ||
// cin >> n; | ||
// vector <pair<int, string>> v(n); | ||
// for (int i = 0; i < n; i++) { | ||
// cin >> v[i].first >> v[i].second; | ||
// } | ||
// stable_sort(v.begin(), v.end(), cmp); | ||
// for (int i = 0; i < n; i++) { | ||
// cout << v[i].first << " " << v[i].second << "\n"; | ||
// } | ||
// return 0; | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//#include <iostream> | ||
//#include <algorithm> | ||
//#include <string> | ||
//#include <vector> | ||
//#include <tuple> | ||
//using namespace std; | ||
//struct Score | ||
//{ | ||
// string name; | ||
// int k, e, m; | ||
//}; | ||
//bool cmp(const Score& s1, const Score& s2) { | ||
// return make_tuple(-s1.k, s1.e, -s1.m, s1.name) < make_tuple(-s2.k, s2.e, -s1.m, s2.name); | ||
//} | ||
//int main10825() { | ||
// int n; | ||
// cin >> n; | ||
// vector <Score> v(n); | ||
// for (int i = 0; i < n; i++) { | ||
// cin >> v[i].name >> v[i].k >> v[i].e >> v[i].m; | ||
// } | ||
// sort(v.begin(), v.end(), cmp); | ||
// for (int i = 0; i < n; i++) { | ||
// cout << v[i].name << "\n"; | ||
// } | ||
// return 0; | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//#include <cstdio> | ||
//#include <algorithm> | ||
//#include <utility> | ||
//using namespace std; | ||
//int main10989() { | ||
// int n, temp; | ||
// scanf("%d", &n); | ||
// int cnt[10001] = { 0, }; | ||
// while (n--) { | ||
// scanf("%d", &temp); | ||
// cnt[temp]++; | ||
// } | ||
// for (int i = 1; i <= 10000; i++) { | ||
// if (cnt[i] > 0) { | ||
// for (int j = 0; j < cnt[i]; j++) { | ||
// printf("%d\n", i); | ||
// } | ||
// } | ||
// } | ||
// return 0; | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/*#include <cstdio> | ||
#include <algorithm> | ||
using namespace std; | ||
const int MAX = 5000000; | ||
long long a[MAX]; | ||
int main() { | ||
int n, k; | ||
scanf("%d %d", &n, &k); | ||
for (int i = 0; i < n; i++) { scanf("%lld", &a[i]); } | ||
sort(a, a + n); | ||
printf("%lld", a[k - 1]); | ||
return 0; | ||
}*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
//#include <iostream> | ||
//#include <algorithm> | ||
//#include <vector> | ||
//#include <utility> | ||
//using namespace std; | ||
// | ||
//bool compare(pair <int, int> p1, pair <int, int> p2) { | ||
// if (p1.first == p2.first) { | ||
// return p1.second < p2.second ; | ||
// } | ||
// else { | ||
// return p1 < p2; | ||
// } | ||
//} | ||
// | ||
//int main11650() { | ||
// int N; | ||
// cin >> N; | ||
// pair <int, int> p; | ||
// vector <pair <int, int>> v; | ||
// int a, b; | ||
// for (int i = 0; i < N; i++) { | ||
// cin >> a >> b; | ||
// p = make_pair(a, b); | ||
// v.push_back(p); | ||
// } | ||
// | ||
// sort(v.begin(), v.end(), compare); | ||
// for (int i = 0; i < N; i++) { | ||
// cout << v[i].first << " " << v[i].second << "\n"; | ||
// } | ||
// return 0; | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
//#include <iostream> | ||
//#include <algorithm> | ||
//#include <vector> | ||
//using namespace std; | ||
//struct Point | ||
//{ | ||
// int x, y; | ||
// bool operator < (const Point& v) const { | ||
// if (y < v.y) { | ||
// return true; | ||
// } | ||
// else if (y == v.y) { | ||
// return x < v.x; | ||
// } | ||
// else { | ||
// return false; | ||
// } | ||
// } | ||
//}; | ||
//int main11651() { | ||
// int n; | ||
// cin >> n; | ||
// vector <Point> v(n); | ||
// for (int i = 0; i < n; i++) { | ||
// cin >> v[i].x >> v[i].y; | ||
// } | ||
// sort(v.begin(), v.end()); | ||
// for (int i = 0; i < n; i++) { | ||
// cout << v[i].x << " " << v[i].y << "\n"; | ||
// } | ||
// return 0; | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/*#include <cstdio> | ||
#include <vector> | ||
#include <utility> | ||
#include <algorithm> | ||
const int MAX = 1000000; | ||
using namespace std; | ||
long long cnt[MAX]; | ||
int main11652() { | ||
int n; | ||
scanf("%d", &n); | ||
for (int i = 0; i < n; i++) { | ||
scanf("%lld", &cnt[i]); | ||
} | ||
sort(cnt, cnt + n); | ||
for (int i = 0; i < n; i++) { | ||
printf("%d ", cnt[i]); | ||
} | ||
printf("\n"); | ||
int ans = 1, maxAns = 1; | ||
long long num = cnt[0]; | ||
for (int i = 1; i < n; i++) { | ||
if (cnt[i] == cnt[i - 1]) { | ||
ans++; | ||
if (maxAns < ans) { | ||
maxAns = ans; | ||
num = cnt[i]; | ||
} | ||
} | ||
else { | ||
ans = 1; | ||
} | ||
} | ||
printf("%lld", num); | ||
}*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
//#include <algorithm> | ||
//#include <cstdio> | ||
//#include <vector> | ||
//using namespace std; | ||
//int main1377() { | ||
// int n; | ||
// scanf("%d", &n); | ||
// vector <pair<int, int>> v(n); | ||
// for (int i = 0; i < n; i++) { | ||
// scanf("%d", &v[i].first); | ||
// v[i].second = i; | ||
// } | ||
// sort(v.begin(), v.end()); | ||
// int ans = 0; | ||
// for (int i = 0; i < n; i++) { | ||
// if (ans < v[i].second - i) { | ||
// ans = v[i].second - i; | ||
// } | ||
// } | ||
// printf("%d", ans+1); | ||
// return 0; | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//#include <algorithm> | ||
//#include <iostream> | ||
//using namespace std; | ||
//int main2751() { | ||
// int n; | ||
// cin >> n; | ||
// int* num = new int[n]; | ||
// for (int i = 0; i < n; i++) { cin >> num[i]; } | ||
// sort(num, num + n); | ||
// for (int i = 0; i < n; i++) { cout << num[i] << "\n"; } | ||
// return 0; | ||
//} |