QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#344304#8254. Water JournalHaidy_Yasser#WA 0ms3600kbC++141.4kb2024-03-03 23:47:492024-03-03 23:47:49

Judging History

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

  • [2024-03-03 23:47:49]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3600kb
  • [2024-03-03 23:47:49]
  • 提交

answer

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

#define pb push_back
#define sz(x) int(x.size())
#define all(vec) vec.begin(), vec.end()
#define rall(vec) vec.rbegin(), vec.rend()
#define cin(v) for (auto& cn : v)  cin >> cn;
#define cout(v) for (auto &cn : v) cout << cn << " ";
#define MOD int(1e9+7)
// #define endl "\n"
 
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

void Haidy()
{
    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 main()
{
    Haidy();
    int t = 1;
    // cin >> t;
    for(int i = 1;i<=t; i++)
    {
        solve();
    }
    return 0;
}
// int dx[] = {0, 0, 1, -1, 1, -1, 1, -1};
// int dy[] = {1, -1, 0, 0, 1, -1, -1, 1};

struct team{
    int id, school;
};

void solve()
{
    int n, minn, maxx;
    cin >> n >> minn >> maxx;
    bool mini = false, maxi = false, ok = true;
    for(int i = 0; i < n-1; i++){
        int x;
        cin >> x;
        mini |= (x == minn);
        maxi |= (x == maxx);
        if(x < minn|| x > maxx)
            ok = 0;
    }
    if(!ok || (!mini && !maxi))
        cout << -1;
    if(!mini)
        cout << minn;
    else if(!maxi)
        cout << maxx;
    else{
        for(int i = minn; i <= maxx;i++)
            cout << i << endl;
    }
}

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3600kb

input:

5 1 5
2
2
4
4

output:

-11

result:

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