Tên đăng nhập Điểm ▴ Bài tập Giới thiệu
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0

include<bits/stdc++.h>

using namespace std;
typedef long long ll;
const int base=31;
const ll MOD=1e+7;
const ll N=100000;
ll p[N],q[N],f[N],g[N];
string a,b;
string s;
ll geta(int l,int r) {
return (f[r]-f[l-1]p[r-l+1]+MODMOD)%MOD;
}
ll getb(int l,int r) {
return (g[r]-g[l-1]q[r-l+1]+MODMOD)%MOD;
}
void solve() {

int n,m,t;
cin>>n>>m;

cin>>a>>b;

a=" "+a;
b=" "+b;
p[0]=1;

for(int i=1; i<=n; i++) {
    p[i]=(p[i-1]*base)%MOD;
}
for(int i=1; i<=n; i++) {
    f[i]=(f[i-1]*base+a[i]-'a'+1)%MOD;
}
q[0]=1;
for(int i=1; i<=m; i++) {
    q[i]=(q[i-1]*base)%MOD;
}
for(int i=1; i<=m; i++) {
    g[i]=(g[i-1]*base+b[i]-'a'+1)%MOD;
}

// for(int i=1;i<=k;i++){
// if(geta(k-1,k)!=getb(k-1,k))f[k]=g[k]-1;
// }
int l,r,u,v;

cin>>t;
int d=1;

    while(t--) {
        cin>>l>>r>>u>>v;
        if(geta(l,r)<getb(u,v)){

// res[d]="<";d++;

s+='<';
            continue;
        }
        if(geta(l,r)>getb(u,v)){

// res[d]=">";d++;
s+='>';continue;
}
else{
// res[d]="=";d++;
s+='=';
}
if(t==0)break;
}

// cout<<geta(1,10)<<" "<<getb(1,11);
// cout<<endl;
// for(int i=1;i<=n;i++)cout<<f[i]<<" ";
// cout<<endl;
// for(int i=1;i<=m;i++)cout<<g[i]<<" ";
cout<<s;
}

int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
solve();
}

9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0

include <bits/stdc++.h>

using namespace std;
int main()
{
freopen("PALIND.inp","r",stdin);
freopen("PALIND.out","w",stdout);
int n,b=0,a,l,k,c;
cin>>n;
while(n>0){
cin>>l>>k;
int t=l+k;
c=t;
while(t>0)
{
a=t%10;
t=t/10;
b=b*10+a;
}
if(b==c){
cout<<"1"<<endl;
}
else{
cout<<"0"<<endl;
}
n--;
}
return 0;
}

9101 0 0
9101
BL8D_AnhThu0902
Phan thị Anh Thư
0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101
dinhthilien19112000
Đinh Thị Liên
0 0
9101
VoHoangGiaBao_TTanHiep
VoHoangGiaBao_TTanHiep
0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101
nguyenthithanhhang8c_bl
BL8C23_HằngNTT
0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101
minhchaunguyen485
Nguyển Hoàng Khánh Trang
0 0

BL8A23_TrangNHK

9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0
9101 0 0