parent
79aa3d9ae7
commit
d831152b3e
@ -1,22 +1,30 @@
|
|||||||
#include <bits/stdc++.h>
|
#include <bits/stdc++.h>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
int k;
|
const int N = 110;
|
||||||
string kill(string s) {
|
|
||||||
int p = 0;
|
struct Node {
|
||||||
for (int i = 0; i < s.size() - 1; i++)
|
int id;
|
||||||
if (s[i + 1] > s[i]) {
|
int score;
|
||||||
p = i;
|
const bool operator<(const Node &t) {
|
||||||
break;
|
if (score == t.score) return id < t.id;
|
||||||
}
|
return score > t.score;
|
||||||
string res;
|
|
||||||
for (int i = 0; i < s.size(); i++)
|
|
||||||
if (i != p) res += s[i];
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
} a[N];
|
||||||
|
/*
|
||||||
|
3
|
||||||
|
3 84
|
||||||
|
1 87
|
||||||
|
2 84
|
||||||
|
*/
|
||||||
int main() {
|
int main() {
|
||||||
string s;
|
int n;
|
||||||
cin >> s >> k;
|
cin >> n;
|
||||||
for (int i = 1; i <= k; i++) s = kill(s);
|
for (int i = 1; i <= n; i++)
|
||||||
cout << s;
|
cin >> a[i].id >> a[i].score;
|
||||||
|
|
||||||
|
sort(a + 1, a + 1 + n);
|
||||||
|
|
||||||
|
for (int i = 1; i <= n; i++)
|
||||||
|
cout << a[i].id << " " << a[i].score << endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
using namespace std;
|
||||||
|
const int N=110;
|
||||||
|
struct Node {
|
||||||
|
int id;
|
||||||
|
int fen;
|
||||||
|
bool operator<(const Node &t) {
|
||||||
|
if (fen == t.fen) return id < t.id;
|
||||||
|
return fen > t.fen;
|
||||||
|
}
|
||||||
|
} a[N];
|
||||||
|
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int n;
|
||||||
|
cin >> n;
|
||||||
|
for (int i = 1; i <= n; i++) cin >> a[i].id >> a[i].fen;
|
||||||
|
sort(a+1, a + n+1);
|
||||||
|
for (int i = 1; i <= n; i++) cout << a[i].id << " " << a[i].fen << endl;
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in new issue