Submission #872707

# Submission time Handle Problem Language Result Execution time Memory
872707 2023-11-13T15:22:20 Z HuyQuang_re_Zero Gondola (IOI14_gondola) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#define ll long long
#define db long double
#define II pair <ll,ll>
#define III pair <ll,II>
#define IV pair <vector <int>,vector <int> >
#define TII pair <treap*,treap*>
#define fst first
#define snd second
#define BIT(x,i) ((x>>i)&1)
#define pi acos(-1)
#define to_radian(x) (x*pi/180.0)
#define to_degree(x) (x*180.0/pi)
#define Log(x) (31-__builtin_clz((int)x))
#define LogLL(x) (63-__builtin_clzll((ll)x))
#include "gondola.h"
using namespace std;
int n,i,a[100005];
int valid(int n,int a[])
{
    int last_u=0,last_i=0;
    map <int,int> d;
    for(i=0;i<n;i++)
    {
        int u=a[i];
        if(d[u]) return 0;
        d[u]=1;
        if(u>n) continue;
        if(last_u>0 && (u-last_u+n)%n!=(i-last_i+n)%n)
            return 0;
        last_u=u; last_i=i;
    }
    return 1;
}
/*
int main()
{
    freopen("gondola.inp","r",stdin);
    freopen("gondola.out","w",stdout);
    cin>>n;
    for(i=0;i<n;i++) cin>>a[i];
    cout<<valid(n,a);
}
*/

Compilation message

/usr/bin/ld: /tmp/ccMLUvN7.o: in function `main':
grader.cpp:(.text.startup+0x108): undefined reference to `countReplacement'
/usr/bin/ld: grader.cpp:(.text.startup+0x132): undefined reference to `replacement'
collect2: error: ld returned 1 exit status