我这个程序 a,b输入不进去 怎么改捏

我这个程序 a,b输入不进去 怎么改捏
题目:P1816 忠诚 - 洛谷 | 计算机科学教育新生态 https://www.luogu.com.cn/problem/P1816

#include<bits/stdc++.h>
using namespace std;
int arr[100001];
int shu1[100005][101];
int shu2[100005];
int a,b;
int temp=9999999;
int m,n;
int flag=0;
int main(){
    scanf("%d",&m,&n);
    for(int i=1;i<=m;i++){
        scanf("%d",&arr[i]);
        shu2[arr[i]]++;
        shu1[arr[i]][shu2[arr[i]]]=i;
    }
    for(int i=1;i<=n;i++){
        cin>>a>>b;//输入不了
        flag=0;
        for(int i=0;i<=100000;i++){//桶排序 
            for(int j=1;j<=shu2[i];j++){
                    if(a<=shu1[i][j] && shu1[i][j]<=b)
                {
                    flag=1;
                    temp=i;
                    break;
                }
            }
            if(flag==1)
            {
                break;
            }
        }
        printf("%d ",temp);
    }
    
    return 0;
}
            

主要问题 你的n和m只有一个占位符,你只输入了m