Submission #161526

# Submission time Handle Problem Language Result Execution time Memory
161526 2019-11-02T22:18:20 Z ToniB Olivander (COCI18_olivander) C++14
0 / 50
4 ms 400 KB
#include <iostream>
#include <algorithm>

using namespace std;


int main(){
	int n, x, y;
	cin >> n;
	int listx[n], listy[n], sol;
	
	for(int i = 0; i < n; i++){
		cin >> x;
		listx[i] = x;
	}
	
	for(int i = 0; i < n; i++){
		cin >> y;
		listy[i] = y;
	}
	sort(listx, listx + n);
	sort(listy, listy + n);
	for(int i = 0; i < n; i++){
		if(listy[i] >= listx[i]){
	        sol += 1;
		}
		}
	if(sol == n){
		cout << "DA";
	}
	else{
		cout << "NE";
	}
	

	return 0;
}

Compilation message

olivander.cpp: In function 'int main()':
olivander.cpp:28:2: warning: 'sol' may be used uninitialized in this function [-Wmaybe-uninitialized]
  if(sol == n){
  ^~
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 400 KB Output isn't correct
2 Halted 0 ms 0 KB -