Submission #1010909

#TimeUsernameProblemLanguageResultExecution timeMemory
1010909UnforgettableplAncient Machine (JOI21_ancient_machine)C++17
70 / 100
50 ms8356 KiB
#include "Anna.h" #include <vector> #include <bits/stdc++.h> using namespace std; namespace { } void Anna(int N, std::vector<char> S) { bool foundX = false; S.emplace_back('$'); for(int i=0;i<N;i++){ if(S[i]=='X'){ if(foundX)Send(0); else { foundX = true; Send(1); } } else if(S[i]=='Y'){ Send(0); } else if(S[i]=='Z'){ if(!foundX or S[i+1]=='Z')Send(0); else Send(1); } } }
#include "Bruno.h" #include <vector> #include <bits/stdc++.h> using namespace std; namespace { } // namespace void Bruno(int N, int L, std::vector<int> A) { vector<bool> vis(N); vector<int> po; for(int i=0;i<N;i++){ if(A[i]==1)po.emplace_back(i); } for(int x=1;x<po.size();x++){ for(int i=po[x]-1;i>po[x-1];i--){ Remove(i); vis[i]=true; } vis[po[x]]=true; Remove(po[x]); } for(int i=0;i<N;i++)if(!vis[i])Remove(i); }

Compilation message (stderr)

Bruno.cpp: In function 'void Bruno(int, int, std::vector<int>)':
Bruno.cpp:15:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |     for(int x=1;x<po.size();x++){
      |                 ~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...