Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
36217 hshh 【S】T1 C++ 运行超时 58 4000 MS 8084 KB 623 2025-02-10 13:49:34

Tests(7/12):


#include<bits/stdc++.h> using namespace std; long long x[1000010],a,b,m,m1; int n,q; string a1,x1,x2; bool l; int main(){ ios::sync_with_stdio(0); cin>>n>>q; for(int i=1;i<=n;i++){ cin>>x[i]; } for(int j=1;j<=q;j++){ cin>>a>>b; l=0; for(int i=1;i<n;i++){ m=(a^x[i])-b; m1=(x[i+1]^a)-b; if(m*m1<=0){ cout<<i<<endl; l=1; break; } } if(l==0) cout<<"-1"<<endl; } return 0; } /* 5 6 3 5 1 2 4 0 2 1 1 2 3 3 2 4 2 5 8 */


测评信息: