Submission #1100214

# Submission time Handle Problem Language Result Execution time Memory
1100214 2024-10-13T09:57:57 Z owieczka Just Long Neckties (JOI20_ho_t1) C++17
0 / 100
1 ms 2388 KB
#include <bits/stdc++.h>
using namespace std;

int neckties[200'005];
int employees[200'005];
int strangeness[200'005];

int main()
{
   ios_base::sync_with_stdio(0); cin.tie(0);
   int n;
   cin >> n;
   for (int i = 0; i <= n; i++)
   {
      cin >> neckties[i];
   }
   for (int i = 0; i < n; i++)
   {
      cin >> employees[i];
   }
   sort (neckties, neckties + n + 1);
   sort (employees, employees + n);
   for (int i = n+1; i > 0; i--)
   {
      strangeness[i] = max(strangeness[i+1], neckties[i] - employees[i-1]);
   }
   int str = 0;
   for (int i = 0; i <= n; i++)
   {
      cout << max (str, strangeness[i+1]) << ' ';
      str = max(str, neckties[i] - employees[i]);
   }
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2388 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2388 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2388 KB Output isn't correct
2 Halted 0 ms 0 KB -