This commit is contained in:
HuangHai
2025-08-30 18:35:01 +08:00
commit 1f397eca87
6258 changed files with 1487241 additions and 0 deletions

View 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;
}

View 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;
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.