链接:I-字串比较_第十一届"图灵杯"NEUQ-ACM程序设计竞赛 (nowcoder.com)
ac代码
#include<bits/stdc++.h>
#define quick std::ios::sync_with_stdio(false);std::cin.tie(nullptr);std::cout.tie(nullptr);
using namespace std;
typedef long long ll;
void solve(){
ll n,m,q;
cin>>n>>m>>q;
string a,b;
cin>>a>>b;
for (ll i=0;i<q;i++){
ll l1,r1,l2,r2;cin>>l1>>r1>>l2>>r2;
ll pos1=r1-l1+1;
ll pos2=r2-l2+1;
string c=a.substr(l1-1,pos1);
string d=b.substr(l2-1,pos2);
if(c<d)cout<<"<\n";
else{
if(c>d) cout<<">\n";
else cout<<"=\n";
}
}
}
int main(){
quick;ll _=1;
while (_--)solve();
return 0;
}