답안 #935554

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
935554 2024-02-29T09:08:00 Z Boycl07 Ancient Machine (JOI21_ancient_machine) C++17
0 / 100
50 ms 8024 KB
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

#define rep(i, n) for(int i = 1; i <= n; ++i)
#define forn(i, l, r) for(int i = l; i <= r; ++i)
#define ford(i, r, l) for(int i = r; i >= l; --i)
#define FOR(i, n) for(int i = 0; i < n; ++i)
#define FORD(i, n) for(int i = n - 1; i >= 0; --i)
#define fi first
#define se second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define endl "\n"
#define task "skycrapers"
#define sz(a) int(a.size())
#define C(x, y) make_pair(x, y)
#define all(a) (a).begin(), (a).end()
#define bit(i, mask) (mask >> i & 1)

void Anna(int N, std::vector<char> S);

void Send(int a);


void Anna(int n, vector<char> S)
{
    bool flag = 0;
    int idx = 0;
    while(idx < n && S[idx] != 'X') Send(0), ++idx;
    Send(1); ++idx;
    while(idx < n)
    {
        if(S[idx] == 'Z') Send(1);
        else Send(0);
        ++idx;
    }
}



#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

#define rep(i, n) for(int i = 1; i <= n; ++i)
#define forn(i, l, r) for(int i = l; i <= r; ++i)
#define ford(i, r, l) for(int i = r; i >= l; --i)
#define FOR(i, n) for(int i = 0; i < n; ++i)
#define FORD(i, n) for(int i = n - 1; i >= 0; --i)
#define fi first
#define se second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define endl "\n"
#define task "skycrapers"
#define sz(a) int(a.size())
#define C(x, y) make_pair(x, y)
#define all(a) (a).begin(), (a).end()
#define bit(i, mask) (mask >> i & 1)


void Bruno(int N, int L, std::vector<int> A);

void Remove(int d);


void Bruno(int n, int Len, vector<int> A)
{
    int first = 0;
    while(first < n && A[first] != 1)
        Remove(first++);
    if(first == Len) return;
    for(int i = first + 1; i < n; ++i)
    {
        int j = i;
        while(j < n && A[j] != 1) ++j;
        ford(k, j - 1, i) Remove(k);
        if(j != n) Remove(j);
        i = j;
    }

    Remove(first);
}

Compilation message

Anna.cpp: In function 'void Anna(int, std::vector<char>)':
Anna.cpp:30:10: warning: unused variable 'flag' [-Wunused-variable]
   30 |     bool flag = 0;
      |          ^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 776 KB Output is correct
2 Correct 1 ms 780 KB Output is correct
3 Correct 0 ms 792 KB Output is correct
4 Correct 1 ms 780 KB Output is correct
5 Correct 0 ms 792 KB Output is correct
6 Correct 1 ms 792 KB Output is correct
7 Correct 0 ms 780 KB Output is correct
8 Correct 0 ms 780 KB Output is correct
9 Correct 0 ms 792 KB Output is correct
10 Incorrect 0 ms 1044 KB Wrong Answer [3]
11 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Partially correct 40 ms 8008 KB Partially correct
2 Partially correct 43 ms 7876 KB Partially correct
3 Partially correct 44 ms 7812 KB Partially correct
4 Partially correct 41 ms 7764 KB Partially correct
5 Partially correct 40 ms 7920 KB Partially correct
6 Partially correct 40 ms 7916 KB Partially correct
7 Partially correct 40 ms 7864 KB Partially correct
8 Partially correct 45 ms 8024 KB Partially correct
9 Partially correct 40 ms 7736 KB Partially correct
10 Partially correct 44 ms 7840 KB Partially correct
11 Partially correct 46 ms 8008 KB Partially correct
12 Partially correct 41 ms 7900 KB Partially correct
13 Partially correct 48 ms 7868 KB Partially correct
14 Partially correct 50 ms 7920 KB Partially correct
15 Partially correct 47 ms 7960 KB Partially correct
16 Partially correct 43 ms 7828 KB Partially correct
17 Partially correct 50 ms 7920 KB Partially correct
18 Incorrect 40 ms 7560 KB Wrong Answer [3]
19 Halted 0 ms 0 KB -