Submission #1171680

#TimeUsernameProblemLanguageResultExecution timeMemory
1171680PedroBigManAncient Machine (JOI21_ancient_machine)C++20
70 / 100
51 ms6456 KiB
#include "Anna.h" #include <iostream> #include <vector> #include <cmath> #include <algorithm> #include <string> #include <map> #include <unordered_map> #include <set> #include <unordered_set> #include <queue> #include <deque> #include <list> #include <iomanip> #include <stdlib.h> #include <time.h> #include <cstring> using namespace std; typedef int ll; typedef unsigned long long int ull; typedef long double ld; #define REP(i,a,b) for(ll i=(ll) a; i<(ll) b; i++) #define pb push_back #define mp make_pair #define pl pair<ll,ll> #define ff first #define ss second #define whole(x) x.begin(),x.end() #define DEBUG(i) cout<<"Pedro Is The Master "<<i<<endl #define INF 500000000LL #define EPS 0.00000001 #define pi 3.14159 namespace { } void Anna(int N, vector<char> S) { ll lastz = -1LL; for(ll i=N-1;i>=0;i--) {if(S[i]=='Z') {lastz=i; break;}} REP(i,0,lastz) { if(S[i]=='X') {Send(0);} else {Send(1);} } return; }
#include "Bruno.h" #include <iostream> #include <vector> #include <cmath> #include <algorithm> #include <string> #include <map> #include <unordered_map> #include <set> #include <unordered_set> #include <queue> #include <deque> #include <list> #include <iomanip> #include <stdlib.h> #include <time.h> #include <cstring> using namespace std; typedef int ll; typedef unsigned long long int ull; typedef long double ld; #define REP(i,a,b) for(ll i=(ll) a; i<(ll) b; i++) #define pb push_back #define mp make_pair #define pl pair<ll,ll> #define ff first #define ss second #define whole(x) x.begin(),x.end() #define DEBUG(i) cout<<"Pedro Is The Master "<<i<<endl #define INF 500000000LL #define EPS 0.00000001 #define pi 3.14159 namespace { vector<ll> t; template<class A=ll> void Out(vector<A> a) {REP(i,0,a.size()) {cout<<a[i]<<" ";} cout<<endl;} } void Bruno(int N, int L, vector<int> A) { ll indZ = A.size(); vector<ll> pos; REP(i,0,A.size()) {if(A[i]==0) {pos.pb(i);}} if(pos.size()==0) {REP(i,0,N) {Remove(i);} return;} for(ll i=pos.size()-1;i>=0;i--) { ll l = pos[i]; ll r = indZ-1; if(i!=pos.size()-1) {r=pos[i+1]-1;} REP(j,l+1,r+1) {Remove(j);} Remove(l); } REP(i,indZ,N) {Remove(i);} ll r = pos[0]-1; REP(i,0,r+1) {Remove(i);} return; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...