이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0);
#define int long long
#define pb push_back
#define fi first
#define se second
#define mp make_pair
const int mod = 1e9 + 7;
const int maxn = 2e6 + 5;
int32_t main()
{
IOS
int n; cin >> n;
int h[n + 1], t[n + 1];
for(int i = 1; i <= n; i++){
cin >> h[i];
}
bool sama = true;
cin >> t[1];
for(int i = 2; i <= n; i++){
cin >> t[i];
if(t[i] != t[i - 1])sama = false;
}
if(sama){
int tmp = t[1];
int ada = 0, kurang = 0, lebih = 0;
for(int i = 1; i <= n; i++){
if(h[i] == tmp){
ada++;
}else if(h[i] < tmp){
kurang++;
}else{
lebih++;
}
}
if(ada == 0){
cout << 0 << endl;
}else{
cout << ada + kurang << endl;
}
//cout << kurang << " " << lebih << " " << ada << endl;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |