Submission #70763367


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
template<class T> bool chmax(T &a, const T &b) { if(a<b){a=b;return 1;}return 0;}
template<class T> bool chmin(T &a, const T &b) { if(a>b){a=b;return 1;}return 0;}
//-------------------------------------------------------

int N,M,K;
int H[202020],B[202020];

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N>>M>>K;
	FOR(i,N) cin>>H[i];
	FOR(i,M) cin>>B[i];
	sort(H,H+N);
	sort(B,B+M);
	FOR(i,K) {
		if(H[i]>B[M-K+i]) {
			cout<<"No"<<endl;
			return;
		}
	}
	cout<<"Yes"<<endl;
		
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}

Submission Info

Submission Time
Task C - Robot Factory
User kmjp
Language C++23 (GCC 15.2.0)
Score 300
Code Size 1111 Byte
Status AC
Exec Time 43 ms
Memory 5264 KiB

Compile Error

./Main.cpp: In function 'void solve()':
./Main.cpp:20:15: warning: unused variable 'j' [-Wunused-variable]
   20 |         int i,j,k,l,r,x,y; string s;
      |               ^
./Main.cpp:20:17: warning: unused variable 'k' [-Wunused-variable]
   20 |         int i,j,k,l,r,x,y; string s;
      |                 ^
./Main.cpp:20:19: warning: unused variable 'l' [-Wunused-variable]
   20 |         int i,j,k,l,r,x,y; string s;
      |                   ^
./Main.cpp:20:21: warning: unused variable 'r' [-Wunused-variable]
   20 |         int i,j,k,l,r,x,y; string s;
      |                     ^
./Main.cpp:20:23: warning: unused variable 'x' [-Wunused-variable]
   20 |         int i,j,k,l,r,x,y; string s;
      |                       ^
./Main.cpp:20:25: warning: unused variable 'y' [-Wunused-variable]
   20 |         int i,j,k,l,r,x,y; string s;
      |                         ^
./Main.cpp: In function 'int main(int, char**)':
./Main.cpp:6:19: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
    6 | #define FOR(x,to) for(x=0;x<(to);x++)
      |                   ^~~
./Main.cpp:41:9: note: in expansion of macro 'FOR'
   41 |         FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
      |         ^~~
./Main.cpp:6:19: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
    6 | #define FOR(x,to) for(x=0;x<(to);x++)
      |                   ^~~
./Main.cpp:41:45: note: in expansion of macro 'FOR'
   41 |         FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
      |                                             ^~~
./Main.cpp:6:28: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    6 | #define FOR(x,to) for(x=0;x<(to);x++)
      |                            ^
./Main.cpp:41:45: note: in expansion of macro 'FOR'
   41 |         FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
      |                                             ^~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 4
AC × 35
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 2 ms 3540 KiB
00_sample_01.txt AC 1 ms 3460 KiB
00_sample_02.txt AC 1 ms 3544 KiB
00_sample_03.txt AC 1 ms 3440 KiB
01_random_03.txt AC 43 ms 5172 KiB
01_random_04.txt AC 43 ms 5072 KiB
01_random_05.txt AC 43 ms 5176 KiB
01_random_06.txt AC 43 ms 5132 KiB
01_random_07.txt AC 43 ms 5248 KiB
01_random_08.txt AC 43 ms 5180 KiB
01_random_09.txt AC 43 ms 5264 KiB
01_random_10.txt AC 43 ms 5216 KiB
01_random_11.txt AC 43 ms 5244 KiB
01_random_12.txt AC 20 ms 4228 KiB
01_random_13.txt AC 21 ms 4240 KiB
01_random_14.txt AC 28 ms 4704 KiB
01_random_15.txt AC 13 ms 4092 KiB
01_random_16.txt AC 11 ms 3920 KiB
01_random_17.txt AC 14 ms 4092 KiB
01_random_18.txt AC 43 ms 5132 KiB
01_random_19.txt AC 43 ms 5128 KiB
01_random_20.txt AC 43 ms 5132 KiB
01_random_21.txt AC 43 ms 5216 KiB
01_random_22.txt AC 43 ms 5124 KiB
01_random_23.txt AC 20 ms 4176 KiB
01_random_24.txt AC 2 ms 3672 KiB
01_random_25.txt AC 41 ms 4996 KiB
01_random_26.txt AC 43 ms 5068 KiB
01_random_27.txt AC 43 ms 5248 KiB
01_random_28.txt AC 43 ms 5188 KiB
01_random_29.txt AC 43 ms 5204 KiB
01_random_30.txt AC 42 ms 5204 KiB
01_random_31.txt AC 27 ms 4432 KiB
01_random_32.txt AC 31 ms 4736 KiB
01_random_33.txt AC 30 ms 4616 KiB