Submission #31840863


Source Code Expand

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

template <typename T>
inline void read(T &a) {
	char c;for (c = getchar(); (c < '0' || c > '9') && c != '-'; c = getchar());bool f = c == '-';T x = f ? 0 : (c ^ '0');for (c = getchar(); c >= '0' && c <= '9'; c = getchar()) {x = x * 10 + (c ^ '0');}a = f ? -x : x;
}
template <typename T, typename ...Argv>
inline void read(T &a, Argv &...argv) {
	read(a), read(argv...);
}

int n, m;
int a[100000], b[100000];
signed main() {
	read(n, m);
	int mx = -1000000;
	for (int i = 1; i <= n; ++i) {
		read(a[i]);
		mx = max(mx, a[i]);
	}
	bool ok = 0;
	for (int i = 1; i <= m; ++i) {
		read(b[i]);
		if (a[b[i]] == mx) ok = 1;
	}
	if (ok) puts("Yes");
	else puts("No");
}

/*
5 2
100 100 100 1 1
5 4

*/

Submission Info

Submission Time
Task B - Takahashi's Failure
User rsdbk_husky_undo
Language C++ (GCC 9.2.1)
Score 200
Code Size 776 Byte
Status AC
Exec Time 5 ms
Memory 3680 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 20
Set Name Test Cases
Sample example_00.txt, example_01.txt, example_02.txt
All example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt
Case Name Status Exec Time Memory
example_00.txt AC 5 ms 3452 KiB
example_01.txt AC 2 ms 3564 KiB
example_02.txt AC 2 ms 3560 KiB
hand_00.txt AC 2 ms 3600 KiB
hand_01.txt AC 2 ms 3680 KiB
hand_02.txt AC 2 ms 3404 KiB
hand_03.txt AC 2 ms 3392 KiB
hand_04.txt AC 2 ms 3524 KiB
hand_05.txt AC 2 ms 3568 KiB
hand_06.txt AC 2 ms 3412 KiB
hand_07.txt AC 2 ms 3564 KiB
random_00.txt AC 2 ms 3564 KiB
random_01.txt AC 2 ms 3516 KiB
random_02.txt AC 2 ms 3408 KiB
random_03.txt AC 2 ms 3456 KiB
random_04.txt AC 2 ms 3412 KiB
random_05.txt AC 2 ms 3408 KiB
random_06.txt AC 2 ms 3640 KiB
random_07.txt AC 2 ms 3516 KiB
random_08.txt AC 2 ms 3568 KiB