Submission #84396

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
843962018-11-15 06:19:42wzyCipele (COCI18_cipele)C++11
90 / 90
925 ms16396 KiB
#include <bits/stdc++.h>
using namespace std;
int n , m;
vector<int> small, big;
int32_t main(){
scanf("%d%d" , &n , &m);
small.resize(n) , big.resize(m);
for(int i = 0 ; i < n ;i ++){
scanf("%d" , &small[i]);
}
for(int i = 0 ; i < m ; i++){
scanf("%d" , &big[i]);
}
sort(small.begin() , small.end());
sort(big.begin() , big.end());
int l = 0 , r = 1000000000;
if(small.size() > big.size()) swap(n,m) , swap(small , big);
int ansj = -1;
while(l<=r){
int mid = (l+r)/2;
int can = true;
multiset<int> mt;
for(int i = 0 ; i < big.size() ; i++) mt.insert(big[i]);
for(int i = 0 ; i < small.size() ; i++){
multiset<int>::iterator it = mt.lower_bound(small[i] - mid);
if(it == mt.end()){
can = false;
break;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

cipele.cpp: In function 'int32_t main()':
cipele.cpp:25:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i = 0 ; i < big.size() ; i++) mt.insert(big[i]);
                   ~~^~~~~~~~~~~~
cipele.cpp:26:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i = 0 ; i < small.size() ; i++){
                   ~~^~~~~~~~~~~~~~
cipele.cpp:8:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d" , &n , &m);
  ~~~~~^~~~~~~~~~~~~~~~~~
cipele.cpp:11:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d" , &small[i]);
   ~~~~~^~~~~~~~~~~~~~~~~~
cipele.cpp:14:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d" , &big[i]);
   ~~~~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...