

题意:无限字符串按字典序比大小

#include <bits/stdc++.h>
using namespace std;
string s, t;
int main() {
while (cin >> s >> t)
if (s + t < t + s)
puts("<");
else if (s + t > t + s)
puts(">");
else
puts("=");
return 0;
}
优化:

本文介绍了一种算法,用于比较两个无限字符串的字典序大小。通过将两个字符串拼接并比较拼接后的字符串,可以高效地确定它们之间的大小关系。此方法适用于需要进行无限字符串比较的场景。
450

被折叠的 条评论
为什么被折叠?



