Submission #684399

#TimeUsernameProblemLanguageResultExecution timeMemory
684399mjhmjh1104Ancient Machine (JOI21_ancient_machine)C++17
69 / 100
69 ms8192 KiB
#include "Anna.h"
#include <vector>
using namespace std;

void Anna(int n, vector<char> s) {
    int k = 0;
    for (int i = 0; i < n; i++) {
        if (s[i] == 'X') Send(1);
        else Send(0);
        if (s[i] == 'Z') k = i;
    }
    for (int t = 0; t <= 16; t++) Send(k & 1 << t ? 1 : 0);
}
#include "Bruno.h"
#include <vector>
using namespace std;

bool b[100006];

void Bruno(int n, int l, vector<int> a) {
    int lt = n, rt = 0;
    for (int t = 0; t <= 16; t++) if (a[n + t]) rt |= 1 << t;
    for (int i = n - 1; i >= 0; i--) if (a[i] || !i) {
        for (int j = i + 1; j < lt; j++) if (a[j]) Remove(j);
        for (int j = i + 1; j < lt; j++) if (!a[j] && j != rt) Remove(j);
        if (i != rt) Remove(i);
        lt = i;
    }
    Remove(rt);
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...