답안 #714640

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
714640 2023-03-25T07:06:34 Z bin9638 Ancient Machine (JOI21_ancient_machine) C++17
0 / 100
52 ms 8104 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,int L, 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,n,a);
    return 0;
}
#endif // SKY
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 636 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 52 ms 8104 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -