Submission #422367

# Submission time Handle Problem Language Result Execution time Memory
422367 2021-06-10T04:51:15 Z 반딧불(#7601) Ranklist Sorting (BOI07_sorting) C++17
0 / 100
1 ms 204 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

void renumber(int n, int *a){
    vector<int> vec(a+1, a+n+1);
    sort(vec.begin(), vec.end());
    for(int i=1; i<=n; i++){
        a[i] = lower_bound(vec.begin(), vec.end(), a[i]) - vec.begin() + 1;
        a[i] = n + 1 - a[i];
    }
}


int n;
int arr[1002];

int main(){
    scanf("%d", &n);
    for(int i=1; i<=n; i++) scanf("%d", &arr[i]);
    renumber(n, arr);

    if(n <= 100) return 1;
}

Compilation message

sorting.cpp: In function 'int main()':
sorting.cpp:21:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   21 |     scanf("%d", &n);
      |     ~~~~~^~~~~~~~~~
sorting.cpp:22:34: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   22 |     for(int i=1; i<=n; i++) scanf("%d", &arr[i]);
      |                             ~~~~~^~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 204 KB Execution failed because the return code was nonzero
2 Runtime error 1 ms 204 KB Execution failed because the return code was nonzero
3 Runtime error 1 ms 204 KB Execution failed because the return code was nonzero
4 Runtime error 0 ms 204 KB Execution failed because the return code was nonzero
5 Runtime error 1 ms 204 KB Execution failed because the return code was nonzero
6 Incorrect 1 ms 204 KB Unexpected end of file - int32 expected
7 Incorrect 1 ms 204 KB Unexpected end of file - int32 expected
8 Incorrect 1 ms 204 KB Unexpected end of file - int32 expected
9 Incorrect 1 ms 204 KB Unexpected end of file - int32 expected
10 Incorrect 1 ms 204 KB Unexpected end of file - int32 expected