QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#344304 | #8254. Water Journal | Haidy_Yasser# | WA | 0ms | 3600kb | C++14 | 1.4kb | 2024-03-03 23:47:49 | 2024-03-03 23:47:49 |
Judging History
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'