Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
36206 | j136 | 【S】T1 | C++ | 解答错误 | 8 | 4000 MS | 4168 KB | 581 | 2025-02-10 13:12:36 |
#include<bits/stdc++.h> using namespace std; int n,q,a[0x114514],ix,iy; //0x114514 ≈ 1e6 static jmp_buf buf; int sign(int x){ return (x>0)-(x<0); } void isok(int x,int y){ for(int i=1;i<n;i++)if(((a[i]^x)-y)*((a[i+1]^x)-y)<1)cout<<i,longjmp(buf,1); cout<<-1,longjmp(buf,1); } int main(){ //freopen("function.in","r",stdin),freopen("function.out","w",stdout); scanf("%d%d",&n,&q); for(int i=1;i<=n;i++)scanf("%d",a+i); while(q--){ scanf("%d%d",&ix,&iy); if(!setjmp(buf))isok(ix,iy); else cout<<'\n'; } }