Submission #544809


Source Code Expand

#include <algorithm>
#include <iostream>
#include <fstream>
#include <cstdio>
#include <string>
#include <vector>
#include <stack>
#include <cmath>
#include <functional>
#include <cassert>
#include <iomanip>
#include <array>
#include <time.h>
#include <limits.h>
#define debug(x) cout<<#x<<": "<<x<<endl
#define rep(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for (int i=(a);i<=(b);i++)

using namespace std;
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
#ifdef _WIN32
	istream &cin = ifstream("input.txt");
#endif

	
	string str = "";
	int N, M;
	vector<int> VN;
	vector<int> VM;
	cin >> N >> M; 

	rep(i, N){
		int tmp;
		cin >> tmp;
		VN.push_back(tmp);
	}
	
	rep(i, M){
		int tmp;
		cin >> tmp;
		VM.push_back(tmp);
	}

	sort(VN.begin(), VN.end());
	sort(VM.begin(), VM.end());

	//cout << VN.at(VN) << endl;

	while (VN.size() > 0 && VM.size() > 0){
		if (VN.at(VN.size() - 1) >= VM.at(VM.size() - 1)){
			VN.pop_back();
			VM.pop_back();
		}
		else{
			VN.pop_back();
		}


	}

	cout << (VM.size() == 0 ? "YES" : "NO") << endl;


	system("PAUSE");
	return 0;
}

Submission Info

Submission Time
Task C - Hotel
User yuya625625
Language C++11 (GCC 4.9.2)
Score 100
Code Size 1148 Byte
Status AC
Exec Time 82 ms
Memory 1948 KiB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:66:17: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result [-Wunused-result]
  system("PAUSE");
                 ^

Judge Result

Set Name Sample Dataset1 Dataset2
Score / Max Score 0 / 0 60 / 60 40 / 40
Status
AC × 4
AC × 29
AC × 55
Set Name Test Cases
Sample 0-sample-1.txt, 0-sample-2.txt, 0-sample-3.txt, 0-sample-4.txt
Dataset1 0-sample-1.txt, 0-sample-2.txt, 0-sample-3.txt, 0-sample-4.txt, 1-max-0.txt, 1-max-1.txt, 1-max-2.txt, 1-max-3.txt, 1-max-4.txt, 1-random-00.txt, 1-random-01.txt, 1-random-02.txt, 1-random-03.txt, 1-random-04.txt, 1-random-05.txt, 1-random-06.txt, 1-random-07.txt, 1-random-08.txt, 1-random-09.txt, 1-random-10.txt, 1-random-11.txt, 1-random-12.txt, 1-random-13.txt, 1-random-14.txt, 1-random-15.txt, 1-random-16.txt, 1-random-17.txt, 1-random-18.txt, 1-random-19.txt
Dataset2 0-sample-1.txt, 0-sample-2.txt, 0-sample-3.txt, 0-sample-4.txt, 1-max-0.txt, 1-max-1.txt, 1-max-2.txt, 1-max-3.txt, 1-max-4.txt, 1-random-00.txt, 1-random-01.txt, 1-random-02.txt, 1-random-03.txt, 1-random-04.txt, 1-random-05.txt, 1-random-06.txt, 1-random-07.txt, 1-random-08.txt, 1-random-09.txt, 1-random-10.txt, 1-random-11.txt, 1-random-12.txt, 1-random-13.txt, 1-random-14.txt, 1-random-15.txt, 1-random-16.txt, 1-random-17.txt, 1-random-18.txt, 1-random-19.txt, 2-max-0.txt, 2-max-1.txt, 2-max-2.txt, 2-max-3.txt, 2-max-4.txt, 2-max-5.txt, 2-random-00.txt, 2-random-01.txt, 2-random-02.txt, 2-random-03.txt, 2-random-04.txt, 2-random-05.txt, 2-random-06.txt, 2-random-07.txt, 2-random-08.txt, 2-random-09.txt, 2-random-10.txt, 2-random-11.txt, 2-random-12.txt, 2-random-13.txt, 2-random-14.txt, 2-random-15.txt, 2-random-16.txt, 2-random-17.txt, 2-random-18.txt, 2-random-19.txt
Case Name Status Exec Time Memory
0-sample-1.txt AC 27 ms 824 KiB
0-sample-2.txt AC 29 ms 848 KiB
0-sample-3.txt AC 28 ms 864 KiB
0-sample-4.txt AC 29 ms 828 KiB
1-max-0.txt AC 30 ms 956 KiB
1-max-1.txt AC 27 ms 872 KiB
1-max-2.txt AC 29 ms 828 KiB
1-max-3.txt AC 27 ms 828 KiB
1-max-4.txt AC 29 ms 996 KiB
1-random-00.txt AC 29 ms 828 KiB
1-random-01.txt AC 29 ms 924 KiB
1-random-02.txt AC 28 ms 828 KiB
1-random-03.txt AC 29 ms 828 KiB
1-random-04.txt AC 29 ms 936 KiB
1-random-05.txt AC 29 ms 820 KiB
1-random-06.txt AC 29 ms 824 KiB
1-random-07.txt AC 27 ms 820 KiB
1-random-08.txt AC 29 ms 832 KiB
1-random-09.txt AC 29 ms 928 KiB
1-random-10.txt AC 28 ms 824 KiB
1-random-11.txt AC 28 ms 816 KiB
1-random-12.txt AC 29 ms 928 KiB
1-random-13.txt AC 29 ms 932 KiB
1-random-14.txt AC 28 ms 836 KiB
1-random-15.txt AC 29 ms 932 KiB
1-random-16.txt AC 28 ms 828 KiB
1-random-17.txt AC 29 ms 928 KiB
1-random-18.txt AC 28 ms 928 KiB
1-random-19.txt AC 28 ms 828 KiB
2-max-0.txt AC 80 ms 1944 KiB
2-max-1.txt AC 79 ms 1948 KiB
2-max-2.txt AC 82 ms 1892 KiB
2-max-3.txt AC 80 ms 1940 KiB
2-max-4.txt AC 81 ms 1948 KiB
2-max-5.txt AC 78 ms 1948 KiB
2-random-00.txt AC 59 ms 1560 KiB
2-random-01.txt AC 61 ms 1564 KiB
2-random-02.txt AC 67 ms 1688 KiB
2-random-03.txt AC 61 ms 1692 KiB
2-random-04.txt AC 46 ms 1316 KiB
2-random-05.txt AC 46 ms 1244 KiB
2-random-06.txt AC 45 ms 1180 KiB
2-random-07.txt AC 32 ms 1052 KiB
2-random-08.txt AC 71 ms 1688 KiB
2-random-09.txt AC 54 ms 1436 KiB
2-random-10.txt AC 43 ms 1304 KiB
2-random-11.txt AC 54 ms 1564 KiB
2-random-12.txt AC 74 ms 1944 KiB
2-random-13.txt AC 58 ms 1576 KiB
2-random-14.txt AC 38 ms 1176 KiB
2-random-15.txt AC 34 ms 1176 KiB
2-random-16.txt AC 53 ms 1308 KiB
2-random-17.txt AC 49 ms 1308 KiB
2-random-18.txt AC 48 ms 1440 KiB
2-random-19.txt AC 43 ms 1180 KiB