Submission #70770382
Source Code Expand
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define int long long
#define ALL(x) (x).begin(), (x).end()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
typedef pair<int, int> PI;
typedef pair<int, pair<int, int>> PII;
static const int INF = 1010000000000000017LL;
static const double eps = 1e-12;
static const double pi = 3.14159265358979323846;
static const int dx[4] = {1, -1, 0, 0};
static const int dy[4] = {0, 0, 1, -1};
static const int ddx[8] = {1, -1, 0, 0, 1, 1, -1, -1};
static const int ddy[8] = {0, 0, 1, -1, 1, -1, 1, -1};
template <class T>
inline bool chmin(T& a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template <class T>
inline bool chmax(T& a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
int N, M, K;
signed main() {
cin >> N >> M >> K;
vector<int> H(N), B(M);
for (int i = 0; i < N; ++i) {
cin >> H[i];
}
for (int i = 0; i < M; ++i) {
cin >> B[i];
}
sort(H.begin(), H.end());
sort(B.begin(), B.end(), greater<int>());
if (H.size() < K || B.size() < K) {
cout << "No" << endl;
}
for (int i = 0; i < K; ++i) {
if (H[i] > B[K - i - 1]) {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
}
Submission Info
Submission Time
2025-11-08 21:10:17+0900
Task
C - Robot Factory
User
tsuyosshi
Language
C++23 (GCC 15.2.0)
Score
300
Code Size
1461 Byte
Status
AC
Exec Time
113 ms
Memory
6580 KiB
Compile Error
./Main.cpp: In function 'int main()':
./Main.cpp:53:18: warning: comparison of integer expressions of different signedness: 'std::vector<long long int>::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
53 | if (H.size() < K || B.size() < K) {
| ~~~~~~~~~^~~
./Main.cpp:53:34: warning: comparison of integer expressions of different signedness: 'std::vector<long long int>::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
53 | if (H.size() < K || B.size() < K) {
| ~~~~~~~~~^~~
Judge Result
Set Name
Sample
All
Score / Max Score
0 / 0
300 / 300
Status
Set Name
Test Cases
Sample
00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt
All
00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 01_random_21.txt, 01_random_22.txt, 01_random_23.txt, 01_random_24.txt, 01_random_25.txt, 01_random_26.txt, 01_random_27.txt, 01_random_28.txt, 01_random_29.txt, 01_random_30.txt, 01_random_31.txt, 01_random_32.txt, 01_random_33.txt
Case Name
Status
Exec Time
Memory
00_sample_00.txt
AC
1 ms
3528 KiB
00_sample_01.txt
AC
1 ms
3556 KiB
00_sample_02.txt
AC
1 ms
3564 KiB
00_sample_03.txt
AC
1 ms
3416 KiB
01_random_03.txt
AC
113 ms
6472 KiB
01_random_04.txt
AC
113 ms
6472 KiB
01_random_05.txt
AC
113 ms
6580 KiB
01_random_06.txt
AC
113 ms
6476 KiB
01_random_07.txt
AC
113 ms
6416 KiB
01_random_08.txt
AC
113 ms
6476 KiB
01_random_09.txt
AC
113 ms
6400 KiB
01_random_10.txt
AC
113 ms
6476 KiB
01_random_11.txt
AC
113 ms
6472 KiB
01_random_12.txt
AC
51 ms
4800 KiB
01_random_13.txt
AC
54 ms
4928 KiB
01_random_14.txt
AC
74 ms
5308 KiB
01_random_15.txt
AC
32 ms
4104 KiB
01_random_16.txt
AC
29 ms
4036 KiB
01_random_17.txt
AC
35 ms
4308 KiB
01_random_18.txt
AC
113 ms
6460 KiB
01_random_19.txt
AC
113 ms
6460 KiB
01_random_20.txt
AC
113 ms
6460 KiB
01_random_21.txt
AC
113 ms
6460 KiB
01_random_22.txt
AC
113 ms
6516 KiB
01_random_23.txt
AC
52 ms
4616 KiB
01_random_24.txt
AC
4 ms
3544 KiB
01_random_25.txt
AC
106 ms
6216 KiB
01_random_26.txt
AC
113 ms
6476 KiB
01_random_27.txt
AC
113 ms
6580 KiB
01_random_28.txt
AC
113 ms
6448 KiB
01_random_29.txt
AC
113 ms
6476 KiB
01_random_30.txt
AC
113 ms
6580 KiB
01_random_31.txt
AC
71 ms
5308 KiB
01_random_32.txt
AC
82 ms
5520 KiB
01_random_33.txt
AC
79 ms
5564 KiB