Submission #1326020

#TimeUsernameProblemLanguageResultExecution timeMemory
1326020PlayVoltzAncient Machine (JOI21_ancient_machine)C++20
5 / 100
33 ms6372 KiB
#include "Anna.h" #include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define pii pair<int, int> #define fi first #define se second void Anna(int n, vector<char> s){ vector<int> res(n, 0); bool found=0; for (int i=0; i<n; ++i){ if (!found){ if (s[i]=='X')found=1, res[i]=1, ++i; continue; } if (s[i]=='Z'&&(i==n-1||s[i+1]!='Z'))res[i]=1; } for (auto a:res)Send(a); }
#include "Bruno.h" #include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define pii pair<int, int> #define fi first #define se second void Bruno(int n, int l, vector<int> a){ vector<int> vect; for (int i=0; i<n; ++i)if (a[i])vect.pb(i); if (vect.size()<=1){ for (int i=0; i<n; ++i)Remove(i); return; } for (int i=0; i<vect[0]; ++i)Remove(i); for (int i=vect.back()+1; i<n; ++i)Remove(i); for (int i=1; i<vect.size(); ++i){ for (int j=vect[i]-1; j>vect[i-1]; --j)Remove(j); Remove(vect[i]); } Remove(vect[0]); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...