QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#113181#4446. Link is as bearLiuf#WA 217ms11000kbC++20752b2023-06-16 16:59:062023-06-16 16:59:08

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-06-16 16:59:08]
  • 评测
  • 测评结果:WA
  • 用时:217ms
  • 内存:11000kb
  • [2023-06-16 16:59:06]
  • 提交

answer

#include<bits/stdc++.h>

#define endl '\n'
#define pii pair<int, int>
#define int long long
#define ld long double

using namespace std;

const int mod=1e9+7,M=2000010,Mlog=22;

void solve(){
    int n;
    cin>>n;

    vector<int>a(n+1),b(n+1,0);  
    map<int,int>m;
    for(int i=1;i<=n;i++){
        cin>>a[i];
        m[a[i]]=1;
    }

    if(m.size()==1){
        for(auto [x,_]:m){
            cout<<x<<endl;
            return;
        }
    }

    for(int i=1;i<=n;i++){
        b[i]=b[i-1]^a[i];
    }

    cout<<b[n]<<endl;
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int t;
    cin>>t;

    while(t--){
        solve();
    }



    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 217ms
memory: 11000kb

input:

22222
100000
595189703884863 72716684812661 449525802123580 504421888022388 390139608591346 108895143840760 170477720052912 185583843894744 201608404318832 128831549357316 521084715261656 668960191579878 573530403227342 489014525501629 56366633717911 1705111713690 227582321537214 710815946393065 169...

output:

367105242564297
80685774788852
905452073216932
800506481918522
913657452217541
299196809323710
667132970972809
121078747625910
167632099646865
737568965050208
22049392616706
711945311050738
1106277129968908
161653562054199
1108034298121334
707664136718665
712603298471237
681235366385653
929752393702...

result:

wrong answer 1st lines differ - expected: '1125899906842623', found: '367105242564297'