思路:由高位指向低位及一个闭环
#include <bits/stdc++.h>
using namespace std;
#define for1(i, n) for (int i = 1; i <= n; i++)
#define forn(i, n) for (int i = 0; i < n; i++)
#define IO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
int main(){
int n,m;
scanf("%d%d",&n,&m);
for1(i,m){
int x,y;scanf("%d%d",&x,&y);
if(x>y)printf("1");
else printf("0");
}
printf("
");
return 0;
}
PS:
开IO读比不开就慢100ms;