'commit'
This commit is contained in:
32
GESP/Level4/GESP202312/4_1.cpp
Normal file
32
GESP/Level4/GESP202312/4_1.cpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#include <bits/stdc++.h>
|
||||
using namespace std;
|
||||
map<string, string> dict;
|
||||
int main() {
|
||||
int N;
|
||||
cin >> N;
|
||||
while (N--) {
|
||||
string word1, word2;
|
||||
cin >> word1 >> word2;
|
||||
dict[word1] = word2;
|
||||
}
|
||||
string content, word = "";
|
||||
cin >> content;
|
||||
content += "\n";
|
||||
|
||||
for (int i = 0; i < content.size(); i++) {
|
||||
if (content[i] >= 'a' && content[i] <= 'z')
|
||||
word += content[i];
|
||||
else { // 遇到符号,就停止下来看看刚才是不是拼接出了新的单词
|
||||
if (word != "") {
|
||||
if (dict.count(word))
|
||||
cout << dict[word];
|
||||
else
|
||||
cout << "UNK";
|
||||
word = "";
|
||||
}
|
||||
// 输出符号
|
||||
cout << content[i];
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
24
GESP/Level4/GESP202312/4_2.cpp
Normal file
24
GESP/Level4/GESP202312/4_2.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include <bits/stdc++.h>
|
||||
using namespace std;
|
||||
const int N = 100005;
|
||||
int a[N];
|
||||
int b[N], bl = 1;
|
||||
int n;
|
||||
int ans;
|
||||
int main() {
|
||||
scanf("%d", &n);
|
||||
for (int i = 1; i <= n; i++)
|
||||
scanf("%d", &a[i]);
|
||||
|
||||
for (int i = 1; i <= n; i++)
|
||||
scanf("%d", &b[i]);
|
||||
|
||||
sort(a + 1, a + n + 1);
|
||||
sort(b + 1, b + n + 1);
|
||||
|
||||
for (int i = 1; i <= n; i++)
|
||||
if (a[i] > b[bl])
|
||||
++ans, ++bl;
|
||||
printf("%d\n", ans);
|
||||
return 0;
|
||||
}
|
||||
BIN
GESP/Level4/GESP202312/GESP12月C++七级真题.pdf
Normal file
BIN
GESP/Level4/GESP202312/GESP12月C++七级真题.pdf
Normal file
Binary file not shown.
BIN
GESP/Level4/GESP202312/GESP12月C++五级真题.pdf
Normal file
BIN
GESP/Level4/GESP202312/GESP12月C++五级真题.pdf
Normal file
Binary file not shown.
BIN
GESP/Level4/GESP202312/GESP12月C++八级真题.pdf
Normal file
BIN
GESP/Level4/GESP202312/GESP12月C++八级真题.pdf
Normal file
Binary file not shown.
BIN
GESP/Level4/GESP202312/GESP12月C++六级真题.pdf
Normal file
BIN
GESP/Level4/GESP202312/GESP12月C++六级真题.pdf
Normal file
Binary file not shown.
BIN
GESP/Level4/GESP202312/GESP12月C++四级真题.pdf
Normal file
BIN
GESP/Level4/GESP202312/GESP12月C++四级真题.pdf
Normal file
Binary file not shown.
Reference in New Issue
Block a user