Submission #714639

# Submission time Handle Problem Language Result Execution time Memory
714639 2023-03-25T07:05:36 Z bin9638 Ancient Machine (JOI21_ancient_machine) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#ifndef SKY
#include "Anna.h"
#endif // SKY
using namespace std;
#define N 100010
#define ll long long
#define ii pair<int,int>
#define fs first
#define sc second
#define pb push_back
#define iii pair<int,ii>

#ifdef SKY
void Send(int a)
{
    cout<<a<<" ";
}
#endif // SKY

void Anna(int n, vector<char> s)
{
    for(int i=0;i<n;i++)
        if(s[i]=='Z')
            Send(1);
                else Send(0);
}

#ifdef SKY
int main()
{
    freopen("A.inp","r",stdin);
    freopen("A.out","w",stdout);
    ios::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);
    int n;
    cin>>n;
    vector<char>s;
    for(int i=1;i<=n;i++)
    {
        char ch;
        cin>>ch;
        s.pb(ch);
    }
    Anna(n,s);
    return 0;
}
#endif // SKY
#include<bits/stdc++.h>
#ifndef SKY
#include "Bruno.h"
#endif // SKY
using namespace std;
#define N 100010
#define ll long long
#define ii pair<int,int>
#define fs first
#define sc second
#define pb push_back
#define iii pair<int,ii>

#ifdef SKY
void Remove(int d)
{
    cout<<d<<" ";
}
#endif // SKY

void Bruno(int n, vector<int> a)
{
    int pos=0;
    for(int i=0;i<n;i++)
        if(a[i]==1)
        {
            //cout<<i<<endl;
            for(int j=i-1;j>=pos;j--)
                Remove(j);
            Remove(i);
            pos=i+1;
        }
    for(int i=pos;i<n;i++)
        Remove(i);
}

#ifdef SKY
int main()
{
    freopen("A.inp","r",stdin);
    freopen("A.out","w",stdout);
    ios::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);
    int n;
    cin>>n;
    vector<int>a;
    for(int i=1;i<=n;i++)
    {
        int u;
        cin>>u;
        a.pb(u);
    }
    Bruno(n,a);
    return 0;
}
#endif // SKY

Compilation message

/usr/bin/ld: /tmp/ccVWUhLe.o: in function `main':
grader_bruno.cpp:(.text.startup+0x24d): undefined reference to `Bruno(int, int, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status