Submission #1309007

#TimeUsernameProblemLanguageResultExecution timeMemory
1309007duongquanghai08Ancient Machine (JOI21_ancient_machine)C++20
0 / 100
30 ms6112 KiB
#include "Anna.h" #include <bits/stdc++.h> using namespace std; void Anna(int n, vector<char> S) { bool check = false; for(auto x : S) { if(x == 'X' && !check) { check = true; Send(1); continue; } if(!check) Send(0); else { if(x == 'X' || x == 'Y') Send(0); else Send(1); } } return; }
#include "Bruno.h" #include <bits/stdc++.h> using namespace std; void Bruno(int n, int L, vector<int> A) { bool check = false; int pos = -1; stack<int> st; for(int i = 0; i < n; i++) { if(A[i] == 1 && !check) { check = true; pos = i; continue; } if(!check) { Remove(i); continue; } if(A[i] == 1) { while(!st.empty()) Remove(st.top()), st.pop(); Remove(i); } else st.push(i); } if(pos != -1) Remove(pos); return; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...