Submission #65738480


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
vector<ll> zaatu(vector<ll> a) {
  vector<ll> b(0, 0);
  b = a;
  sort(b.begin(), b.end());
  b.erase(unique(b.begin(), b.end()), b.end());
  int s = b.size();
  for(ll &o : a) {
    int l = 0, r = s, c = 0;
    while(r - l > 1) {
      c = (l + r) / 2;
      if(b.at(c) <= o) {
        l = c;
      }
      else {
        r = c;
      }
    }
    o = r;
  }
  return a;
}

int main() {
  int N;
  cin >> N;
  vector<ll> A(N);
  for(ll &o : A) {
    cin >> o;
  }
  A = zaatu(A);
  for(int i = 0; i < N; i++) {
    cout << A[i];
    if(i == N - 1) {
      cout << endl;
    }
    else {
      cout << ' ';
    }
  }
}

Submission Info

Submission Time
Task A15 - Compression
User friedrice0
Language C++ 23 (gcc 12.2)
Score 1000
Code Size 729 Byte
Status AC
Exec Time 37 ms
Memory 5280 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 1000 / 1000
Status
AC × 1
AC × 21
Set Name Test Cases
Sample sample_01.txt
All 10_random_small_00.txt, 10_random_small_01.txt, 10_random_small_02.txt, 10_random_small_03.txt, 10_random_small_04.txt, 10_random_small_05.txt, 10_random_small_06.txt, 10_random_small_07.txt, 10_random_small_08.txt, 10_random_small_09.txt, 20_random_large_00.txt, 20_random_large_01.txt, 20_random_large_02.txt, 20_random_large_03.txt, 20_random_large_04.txt, 20_random_large_05.txt, 20_random_large_06.txt, 20_random_large_07.txt, 20_random_large_08.txt, 20_random_large_09.txt, sample_01.txt
Case Name Status Exec Time Memory
10_random_small_00.txt AC 1 ms 3544 KiB
10_random_small_01.txt AC 1 ms 3648 KiB
10_random_small_02.txt AC 1 ms 3432 KiB
10_random_small_03.txt AC 1 ms 3488 KiB
10_random_small_04.txt AC 1 ms 3544 KiB
10_random_small_05.txt AC 1 ms 3544 KiB
10_random_small_06.txt AC 1 ms 3460 KiB
10_random_small_07.txt AC 1 ms 3644 KiB
10_random_small_08.txt AC 1 ms 3496 KiB
10_random_small_09.txt AC 1 ms 3500 KiB
20_random_large_00.txt AC 8 ms 3604 KiB
20_random_large_01.txt AC 16 ms 3964 KiB
20_random_large_02.txt AC 14 ms 3844 KiB
20_random_large_03.txt AC 37 ms 5280 KiB
20_random_large_04.txt AC 13 ms 3844 KiB
20_random_large_05.txt AC 32 ms 4920 KiB
20_random_large_06.txt AC 34 ms 5012 KiB
20_random_large_07.txt AC 14 ms 4028 KiB
20_random_large_08.txt AC 32 ms 5016 KiB
20_random_large_09.txt AC 32 ms 5024 KiB
sample_01.txt AC 1 ms 3676 KiB