Submission #1028405

#TimeUsernameProblemLanguageResultExecution timeMemory
1028405AdamGSAncient Machine (JOI21_ancient_machine)C++17
70 / 100
47 ms8760 KiB
#include "Anna.h" #include<bits/stdc++.h> using namespace std; #define rep(a, b) for(int a = 0; a < (b); ++a) #define st first #define nd second #define pb push_back #define all(a) a.begin(), a.end() void Anna(int n, vector<char>T) { vector<int>P(n); rep(i, n) if(T[i]=='X') { P[i]=1; for(int j=i+1; j<n; ++j) { if(T[j]=='Z') P[j]=1; } break; } rep(i, n) Send(P[i]); }
#include "Bruno.h" #include<bits/stdc++.h> using namespace std; #define rep(a, b) for(int a = 0; a < (b); ++a) #define st first #define nd second #define pb push_back #define all(a) a.begin(), a.end() void Bruno(int n, int m, vector<int>T) { int x=-1; rep(i, n) { if(T[i]) { x=i; break; } else Remove(i); } if(x==-1) return; int lst=x; for(int i=x+1; i<n; ++i) if(T[i]) { for(int j=i-1; j>lst; --j) Remove(j); Remove(i); lst=i; } Remove(x); for(int i=lst+1; i<n; ++i) Remove(i); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...