QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#236999 | #7517. Flying Ship Story | Benzenesir | WA | 150ms | 3624kb | C++14 | 4.0kb | 2023-11-04 12:21:12 | 2023-11-04 12:21:13 |
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].sec.fir)
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;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3580kb
input:
5 1 2 3 1 1 4 5 2 2 2 2 2 3 7 2 3 4
output:
2 1 0
result:
ok 3 lines
Test #2:
score: -100
Wrong Answer
time: 150ms
memory: 3624kb
input:
1000000 2 370943499 431961772 1 1 1 11995570 2 37566858 838793045 1 11995571 11995569 908148975 2 11995571 11995571 1 1 3 716821068 2 67877937 3 1 11995571 11995571 771898489 2 38381714 99749723 1 915818844 915818847 729541681 2 592361351 915818846 1 783627722 783627722 639375021 2 102203700 8636489...
output:
0 11995570 0 11995570 915818845 783627723 915818845 0 0 915818845 0 783627723 0 904468304 904468304 904468304 915818845 904468304 915818845 904468304 915818845 0 904468304 0 915818845 915818845 0 998138906 1 0 915818845 915818845 0 921710773 0 921710773 998138906 921710773 0 921710773 998138906 0 99...
result:
wrong answer 28th lines differ - expected: '0', found: '998138906 1'