QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#276051#7517. Flying Ship StorywangqingxianWA 263ms3456kbC++141.5kb2023-12-05 15:30:592023-12-05 15:30:59

Judging History

你现在查看的是最新测评结果

  • [2023-12-05 15:30:59]
  • 评测
  • 测评结果:WA
  • 用时:263ms
  • 内存:3456kb
  • [2023-12-05 15:30:59]
  • 提交

answer

#include<algorithm>
#include<vector>
#include<cstdio>
#include<map>
#include<cstring>
#include<iostream>
#include<cstdlib>
#include<iomanip>
#include<bitset>
#include<queue>
#include<cassert>
#include<stdlib.h>
#include<cmath>
#include<set>
#define TIME (double)clock()/(double)CLOCKS_PER_SEC
//#define ll long long
#define ld long double
#define For(i,l,r) for(int i=(l);i<=(r);++i)
#define rof(i,r,l) for(int i=(r);i>=(l);--i)
#define db double
#define mem0(a) memset(a,0,sizeof(a))
#define ull unsigned long long
#define lowbit(t) (t&-t)
#define uint unsigned int
//#define int long long
#define x1 dlskjfakljflkasd
#define y1 sldkfjalfjkalskl
#define x2 sdalkfjaklfjsdlk
#define y2 sfjaofoiwjfwfwof
using namespace std;
const int N=5e3+1,inf=1e18,mod=998244353;
int q;
struct giao{int x,y,w;};
giao p[5];
int ans=0;
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    cin>>q;
    while(q--){
        int op,x,y,w;
        cin>>op>>x>>y;
        x^=ans;y^=ans;
        if(op==1){
            cin>>w;
            For(i,0,4){
                if(p[i].x==x||p[i].y==y||p[i].w==0){
                    p[i]={x,y,max(w,p[i].w)};
                    break;
                }
            }
        }
        else{
            ans=0;
            For(i,0,4){
                if((p[i].x!=x)&&(p[i].y!=y))ans=max(ans,p[i].w);
            }
            cout<<ans<<endl;
        }
    }
    return 0;
}
/*
5
 1 2 3 1
 1 4 5 2
 2 2 2
 2 3 7
 2 3 4
 */

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3452kb

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: 263ms
memory: 3456kb

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
0
908148975
908148975
908148975
908148975
908148975
908148975
908148975
908148975
908148975
908148975
908148975
908148975
908148975
908148975
908148975
908148975
908148975
908148975
908148975
908148975
908148975
908148975
908148975
908148975
998138906
998138906
998138906
998138906
99813...

result:

wrong answer 4th lines differ - expected: '11995570', found: '0'