Submission #1020001

#TimeUsernameProblemLanguageResultExecution timeMemory
1020001abdelhakimArranging Shoes (IOI19_shoes)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#define mod 1000000007LL
#define inf 1e17
#define ll long long
using namespace std;

void printvec(vector<ll> vec)
{
    for (auto &&e : vec)
    {
        cout << e << ' ';
    }
    cout << endl;
}

ll count_swaps(int S[])
{
    int n = sizeof(S)/sizeof(S[0]);
    vector<ll> s(n);
    for (int i = 0; i < n; i++)
    {
        s[i] = S[i];
    }
    return s[0] > 0;
}
// int main()
// {

// }

Compilation message (stderr)

shoes.cpp: In function 'long long int count_swaps(int*)':
shoes.cpp:18:20: warning: 'sizeof' on array function parameter 'S' will return size of 'int*' [-Wsizeof-array-argument]
   18 |     int n = sizeof(S)/sizeof(S[0]);
      |                   ~^~
shoes.cpp:16:20: note: declared here
   16 | ll count_swaps(int S[])
      |                ~~~~^~~
/usr/bin/ld: /tmp/cc2SaCDq.o: in function `main':
grader.cpp:(.text.startup+0x29d): undefined reference to `count_swaps(std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status