Submission #1157317

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11573172025-02-25 14:38:52InvMODDancing Elephants (IOI11_elephants)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
#define all(v) (v).begin(), (v).end()
using namespace std;
const int N = 2e5 + 5;
int n, len, a[N];
void init(int N, int L, int X[])
{
for(int i = 0; i < N; i++){
a[i + 1] = X[i];
}
n = N, len = L;
return;
}
int update(int ii, int y){
a[ii + 1] = y;
vector<int> pos(n + 1);
for(int i = 1; i <= n; i++)
pos[i] = a[i];
sort(1 + all(pos));
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

elephants.cpp: In function 'int32_t main()':
elephants.cpp:54:16: error: cannot convert 'std::vector<int>' to 'int*'
   54 |     init(N, L, X);
      |                ^
      |                |
      |                std::vector<int>
elephants.cpp:11:29: note:   initializing argument 3 of 'void init(int, int, int*)'
   11 | void init(int N, int L, int X[])
      |                         ~~~~^~~
elephants.cpp:45:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   45 |     freopen(name".INP", "r", stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
elephants.cpp:46:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   46 |     freopen(name".OUT", "w", stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~