| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 833246 | vjudge1 | Exam (eJOI20_exam) | C++17 | 11 ms | 468 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
int h[maxn];
int t[maxn];
int main() {
int n;
cin >> n;
bool tc2 = true;
for (int i = 1; i <= n; i++) {
cin >> h[i];
}
for (int i = 1; i <= n; i++) {
cin >> t[i];
if (i != 1 && t[i] != t[i-1]) {
tc2 = false;
}
}
if (tc2) {
int accu = 0;
int req = t[1];
int status = 0;
for (int i = 1; i <= n; i++) {
if (h[i] > req) status = 0;
else if (h[i] < req) {
if (status == -1) {
accu++;
} else {
status++;
}
}
else if (h[i] == req) {
accu += status + 1;
status = -1;
}
}
cout << accu;
}
return 0;
}| # | 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... | ||||
