Submission #1139567

#TimeUsernameProblemLanguageResultExecution timeMemory
1139567Math4Life2020Ancient Machine (JOI21_ancient_machine)C++20
70 / 100
46 ms6456 KiB
#include "Anna.h" #include <bits/stdc++.h> using namespace std; using ll = int; using pii = pair<ll,ll>; void Anna(int N, vector<char> S) { bool xfnd = 0; for (ll i=0;i<N;i++) { if (S[i]=='X' && !xfnd) { xfnd = 1; Send(1); } else if (S[i]=='Z' && xfnd) { Send(1); } else { Send(0); } } }
#include <bits/stdc++.h> using namespace std; using ll = int; using pii = pair<ll,ll>; #include "Bruno.h" void Bruno(int N, int L, vector<int> A) { ll cx = -1; stack<ll> s0; for (ll i=0;i<N;i++) { if (A[i]==1) { if (cx==-1) { cx = i; } else { while (!s0.empty()) { Remove((int)s0.top()); s0.pop(); } Remove(i); } } else { if (cx==-1) { Remove(i); } else { s0.push(i); } } } while (!s0.empty()) { Remove((int)s0.top()); s0.pop(); } if (cx != -1) { Remove(cx); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...