题解 | 剩下的数 | 诈骗
剩下的数
https://www.nowcoder.com/practice/f80366f2611640c1abc6e5655c51ea2c
#include <iostream>
using namespace std;
int main() {
// 根据抽屉原理, 连续 的 x 个数中一定存在一个 a_i % x == r_0
long long l,r,x,t,m;
cin>>t;
while(t--){
cin>>l>>r;
long long s=(l+r)*(r-l+1)/2;
cin>>m;
while(m--){
cin>>x;
cout<<(s%x>0)<<"\n";
}
}
}
// 64 位输出请用 printf("%lld")
