QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#547751 | #7517. Flying Ship Story | SICKO | WA | 0ms | 3648kb | C++17 | 3.9kb | 2024-09-05 09:16:52 | 2024-09-05 09:16:53 |
Judging History
answer
#include<iostream>
#define int long long
using namespace std;
struct poi{
int x, y, v;
}p[20], np[20];
int pin1, pin2;
signed main(){
ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
int n, res=0; cin>>n;
while(n--){
int opt, x, y, v; cin>>opt;
if(opt == 1){
pin2 = 0;
cin>>x>>y>>v;
x ^= res; y^=res; v^=res;
int lt = 1;
int nx, ny;
int lsx[4]={0, 0, 0, 0};
int lsy[4]={0, 0, 0, 0};
if(p[lt].v <= v){
nx = x; ny = y;
np[++pin2] = {x, y, v};
v = -1;
}
else{
nx = p[lt].x; ny = p[lt].y;
np[++pin2] = p[lt]; lt++;
}
while(lt<=pin1 && v > 0){
poi pos;
if(p[lt].v <= v){
pos = {x, y, v}; v = -1;
}
else pos = p[lt++];
// 阶段一
if(nx && ny){
// 无用
if(nx == pos.x && ny == pos.y) continue;
// 有用
np[++pin2] = pos;
// 阶段二
if(nx == pos.x && ny != pos.y){
ny = 0; continue;
}
if(nx != pos.x && ny == pos.y){
nx = 0; continue;
}
// 阶段三
if(nx != pos.x && ny != pos.y){
nx = ny = 0;
lsx[0] = lsy[0] = 2;
lsx[1] = nx; lsx[2] = pos.x;
lsy[1] = pos.y; lsy[2] = ny;
continue;
}
}
// 阶段2单边
else if(nx || ny){
if(nx){
// 无用
if(pos.x == nx) continue;
// 有用
np[++pin2] = pos;
lsx[0] = lsy[0] = 1;
lsx[1] = nx; lsy[1] = pos.y;
nx = 0;
continue;
}
// 无用
if(pos.x == nx) continue;
// 有用
np[++pin2] = pos;
lsx[0] = lsy[0] = 1;
lsx[1] = pos.x; lsy[1] = ny;
ny = 0;
continue;
}
// 点的情况
else{
if(lsx[0] == 1){
// 无用
if(pos.x == lsx[1] || pos.y == lsy[1]) continue;
// 有用
np[++pin2] = pos;
break;
}
if(lsx[0] == 2){
// 无用
if((pos.x == lsx[1] && pos.y == lsy[2])||(pos.x == lsx[2] && pos.y == lsy[1])) continue;
// 有用
np[++pin2] = pos;// 一个点
if((pos.x == lsx[2] || pos.y == lsy[2])){
// 进入一个点状态
lsx[0] = lsy[0] = 1;
lsx[1] = lsx[2]; lsy[1] = lsy[2];
continue;
}
if((pos.x == lsx[1] || pos.y == lsy[1])){
// 进入一个点状态
lsx[0] = lsy[0] = 1;
continue;
}
// 结束
break;
}
}
}
}
if(opt == 2){
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3648kb
input:
5 1 2 3 1 1 4 5 2 2 2 2 2 3 7 2 3 4
output:
result:
wrong answer 1st lines differ - expected: '2', found: ''