Submission #524654

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5246542022-02-09 18:15:37amunduzbaevAncient Machine (JOI21_ancient_machine)C++17
99 / 100
60 ms8088 KiB
#include "Anna.h"
#include "bits/stdc++.h"
using namespace std;
#define ll long long
const int B = 90;
ll dp[B][2];
void Anna(int n, vector<char> s) {
int f = -1;
for(int i=0;i<n;i++){
if(s[i] == 'X') { f = i; break; }
}
int C = (n + B - 1) / B;
if(f == -1){
return;
}
//~ cout<<f<<" "<<n<<" "<<s[0]<<endl;
for(int i=0;i<17;i++) Send(f >> i & 1);
vector<int> res(n);
//~ res[f] = 1;
for(int i=f+1;i<n;i++){
if(s[i] == 'Z'){
res[i] = 1;
if(s[i-1] == 'Z') res[i-1] = 0;
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...