QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#343741#8254. Water JournalEsraaSyam#WA 0ms3876kbC++201.2kb2024-03-02 23:43:282024-03-02 23:43:28

Judging History

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

  • [2024-03-02 23:43:28]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3876kb
  • [2024-03-02 23:43:28]
  • 提交

answer

#include "bits/stdc++.h"
using namespace std;

#define nl "\n"
#define ll long long
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define sz(v) (int) v.size()

template<typename T = int>
istream &operator>>(istream &in, vector<T> &v) {
    for (auto &x: v) in >> x;
    return in;
}

template<typename T = int>
ostream &operator<<(ostream &out, const vector<T> &v) {
    for (const T &x: v) out << x << " ";
    return out;
}

void Sira() {
    ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
#endif
}

void solve(){
    int n , a , b;
    cin >> n >> a >> b;

    map < int , int > mp;

    for(int i = 0 ; i < n - 1 ; i++){
        int x;
        cin >> x;
        mp[x]++;
    }

    if(mp.count(a) and mp.count(b)){
        for(int i = 1 ; i <= n  ; i++){
            cout << i << nl;
        }
    }else{
        if(!mp.count(a)) cout << a << nl;
        else cout << b << nl;
    }

}

int main() {
    Sira();
    int t = 1;
//    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: 0ms
memory: 3876kb

input:

5 1 5
2
2
4
4

output:

1

result:

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