Submission #1071453

#TimeUsernameProblemLanguageResultExecution timeMemory
107145312345678Ancient Machine (JOI21_ancient_machine)C++17
70 / 100
63 ms8892 KiB
#include "Anna.h" #include <bits/stdc++.h> using namespace std; void Anna(int N, std::vector<char> S) { int st=-1; for (int i=0; i<N; i++) { if (S[i]=='X'&&st==-1) st=i, Send(1); else if (S[i]=='Z'&&st!=-1) Send(1); else Send(0); } }
#include "Bruno.h" #include <bits/stdc++.h> using namespace std; const int nx=1e5+5; int lst=0, rem[nx]; void Bruno(int N, int L, std::vector<int> A) { int st=-1, lst=-1; for (int i=0; i<N; i++) { if (A[i]) { if (st==-1) { lst=st=i; } else { for (int j=i-1; j>lst; j--) rem[j]=1, Remove(j); lst=i; rem[i]=1, Remove(i); } } } for (int i=0; i<N; i++) if (!rem[i]) Remove(i); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...