Submission #935558

# Submission time Handle Problem Language Result Execution time Memory
935558 2024-02-29T09:09:47 Z Boycl07 Ancient Machine (JOI21_ancient_machine) C++17
70 / 100
61 ms 8152 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;
    if(idx != n) 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 == n) 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:33:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   33 |     if(idx != n) Send(1); ++idx;
      |     ^~
Anna.cpp:33:27: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   33 |     if(idx != n) Send(1); ++idx;
      |                           ^~
Anna.cpp:30:10: warning: unused variable 'flag' [-Wunused-variable]
   30 |     bool flag = 0;
      |          ^~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 776 KB Output is correct
2 Correct 0 ms 788 KB Output is correct
3 Correct 0 ms 788 KB Output is correct
4 Correct 0 ms 1352 KB Output is correct
5 Correct 1 ms 776 KB Output is correct
6 Correct 0 ms 780 KB Output is correct
7 Correct 1 ms 792 KB Output is correct
8 Correct 0 ms 792 KB Output is correct
9 Correct 0 ms 780 KB Output is correct
10 Correct 0 ms 792 KB Output is correct
11 Correct 1 ms 788 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 48 ms 7828 KB Partially correct
2 Partially correct 45 ms 7912 KB Partially correct
3 Partially correct 43 ms 7784 KB Partially correct
4 Partially correct 40 ms 7924 KB Partially correct
5 Partially correct 40 ms 7928 KB Partially correct
6 Partially correct 46 ms 7912 KB Partially correct
7 Partially correct 48 ms 7712 KB Partially correct
8 Partially correct 49 ms 7968 KB Partially correct
9 Partially correct 53 ms 7848 KB Partially correct
10 Partially correct 58 ms 7912 KB Partially correct
11 Partially correct 40 ms 7984 KB Partially correct
12 Partially correct 40 ms 7876 KB Partially correct
13 Partially correct 57 ms 7948 KB Partially correct
14 Partially correct 45 ms 8040 KB Partially correct
15 Partially correct 43 ms 7968 KB Partially correct
16 Partially correct 56 ms 7864 KB Partially correct
17 Partially correct 51 ms 7924 KB Partially correct
18 Partially correct 46 ms 7932 KB Partially correct
19 Partially correct 61 ms 7760 KB Partially correct
20 Partially correct 48 ms 7912 KB Partially correct
21 Partially correct 46 ms 7988 KB Partially correct
22 Partially correct 45 ms 7700 KB Partially correct
23 Partially correct 40 ms 7908 KB Partially correct
24 Partially correct 40 ms 7932 KB Partially correct
25 Partially correct 51 ms 8152 KB Partially correct
26 Partially correct 49 ms 7908 KB Partially correct
27 Partially correct 45 ms 7992 KB Partially correct
28 Partially correct 49 ms 7792 KB Partially correct
29 Partially correct 45 ms 8004 KB Partially correct
30 Partially correct 50 ms 7788 KB Partially correct
31 Partially correct 45 ms 7924 KB Partially correct
32 Partially correct 45 ms 7956 KB Partially correct
33 Partially correct 40 ms 7996 KB Partially correct