QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#236995 | #7517. Flying Ship Story | Benzenesir | WA | 0ms | 3704kb | C++14 | 4.0kb | 2023-11-04 12:20:23 | 2023-11-04 12:20:24 |
Judging History
answer
#pragma GCC optimize(3)
#pragma GCC target("avx,sse2,sse3,sse4,mmx")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-fwhole-program")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-fstrict-overflow")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-skip-blocks")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("-funsafe-loop-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")
#include <cstdio>
#include <cmath>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <queue>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <bitset>
#include <stack>
#include <tuple>
#include <bitset>
#define ll long long
#define ull unsigned long long
#define ld long double
#define db double
#define fp(a,b,c) for(int a=b;a<=c;a++)
#define fd(a,b,c) for(int a=b;a>=c;a--)
#define pii pair<int,int>
#define inf 0x3f3f3f3f
#define base 127
#define mod 1000000007
#define eb emplace_back
#define y1 y114
#define y0 y514
#define x1 x114
#define x0 x514
#define mpr make_pair
#define met(x,t) memset(x,t,sizeof(x))
#define fir first
#define sec second
#include <numeric>
#include <stdlib.h>
#include <assert.h>
#define int ll
using namespace std;
inline ll rd(){
ll x = 0, f = 1;char ch = getchar();
while(ch < '0' || ch > '9'){if(ch == '-')f = -1;ch = getchar();}
while(ch >= '0' && ch <= '9')x = (x<<1) + (x<<3) + (ch^48),ch = getchar();
return x * f;}
int q;
pair<pii,pii> maxx[2][31];
signed main(){
ios::sync_with_stdio(false);
cin.tie(0),cout.tie(0);
q=rd();
int ans=0;
while(q--){
ll op=rd(),x=rd()^ans,y=rd()^ans;
int w;
if(op==2){
ans=0;
fp(i,0,30){
int o=(x>>i&1);
if(maxx[o^1][i].fir.sec==y)
ans=max(ans,maxx[o^1][i].sec.fir);
else ans=max(ans,maxx[o^1][i].fir.fir);
}
cout << ans << '\n';
}else {
w=rd()^ans;
fp(i,0,30){
int o=(x>>i&1);
if(maxx[o][i].fir.sec==y)
maxx[o][i].fir.fir=max(maxx[o][i].fir.fir,w);
else if(maxx[o][i].sec.sec==y)
maxx[o][i].sec.fir=max(maxx[o][i].sec.fir,w);
else if(maxx[o][i].fir.fir<w){
swap(maxx[o][i].fir,maxx[o][i].sec);
maxx[o][i].fir=mpr(w,y);
}else if(maxx[o][i].sec.fir<w)
maxx[o][i].sec=mpr(w,y);
if(maxx[o][i].fir.fir<maxx[o][i].fir.sec)
swap(maxx[o][i].fir,maxx[o][i].sec);
}
if(w==998138906){
cout << maxx[1][0].fir.fir <<" " << maxx[1][0].fir.sec << endl;
}
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3704kb
input:
5 1 2 3 1 1 4 5 2 2 2 2 2 3 7 2 3 4
output:
0 0 0
result:
wrong answer 1st lines differ - expected: '2', found: '0'