Submission #1017291

#TimeUsernameProblemLanguageResultExecution timeMemory
1017291vivkostovFriend (IOI14_friend)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
#define endl '\n'
#include "friend.h"
using namespace std;
void speed()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}
int n,a,b,br[15][15],mas[15],otg,con[15];
void check()
{
    int seg=0;
    for(int i=1;i<=n;i++)
    {
        if(!mas[i])continue;
        for(int j=i+1;j<=n;j++)
        {
            if(!mas[j])continue;
            if(br[i][j])return;
        }
        seg+=con[i];
    }
    otg=max(otg,seg);
}
void rec(int step)
{
    if(step==n)
    {
        check();
        return;
    }
    for(int i=0;i<=1;i++)
    {
        mas[step+1]=i;
        rec(step+1);
        mas[step+1]=0;
    }
}
int findSample(int N, int confidence[], int host[], int protocol[])
{
    n=N;
    for(int i=1;i<=n;i++)
    {
        if(protocol[i]==0)
        {
            br[a][i]=1;
            br[i][a]=1;
        }
        if(protocol[i]==1)
        {
            for(int i=1;i<=n;i++)
            {
                br[b][i]=br[a][i];
                br[i][b]=br[i][a];
            }
        }
        if(protocol[i]==2)
        {
            for(int i=1;i<=n;i++)
            {
                br[b][i]=br[a][i];
                br[i][b]=br[i][a];
            }
            br[a][i]=1;
            br[i][a]=1;
        }
    }
    for(int i=1;i<=n;i++)
    {
        con[i]=confidence[i-1];
    }
    rec(0);
    retunr otg;
}
int main()
{
    speed();
    read();
    return 0;
}

Compilation message (stderr)

friend.cpp: In function 'int findSample(int, int*, int*, int*)':
friend.cpp:75:5: error: 'retunr' was not declared in this scope
   75 |     retunr otg;
      |     ^~~~~~
friend.cpp:76:1: warning: no return statement in function returning non-void [-Wreturn-type]
   76 | }
      | ^
friend.cpp: In function 'int main()':
friend.cpp:80:5: error: 'read' was not declared in this scope; did you mean 'fread'?
   80 |     read();
      |     ^~~~
      |     fread