# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1137831 | woohyun_jng | Building 4 (JOI20_building4) | C++20 | 34 ms | 5188 KiB |
#include <bits/stdc++.h>
#define int long long
#define MAX 600000
using namespace std;
typedef array<int, 2> pr;
int A[MAX], B[MAX];
pr dp[MAX][2];
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(0), cout.tie(0);
int N, K, Z;
bool X, Y;
string res;
cin >> N;
for (int i = 1; i <= N * 2; i++)
cin >> A[i];
for (int i = 1; i <= N * 2; i++)
cin >> B[i];
for (int i = 1; i <= N * 2; i++) {
X = A[i] >= A[i - 1] && dp[i - 1][0][0] != -1;
Y = A[i] >= B[i - 1] && dp[i - 1][1][0] != -1;
if (X && Y)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |