Submission #725011

#TimeUsernameProblemLanguageResultExecution timeMemory
725011piOOEAncient Machine (JOI21_ancient_machine)C++17
Compilation error
0 ms0 KiB
#include "Anna.h" #include <vector> void Anna(int n, std::vector<char> s) { int type = 0; for (int i = 0; i < n; ++i) { int use = 0; if (s[i] == 'X') { if (type == 0) { type |= 1; use = 1; } } else if (s[i] == 'Y') { if ((type & 1) && !(type & 2)) { type |= 2; use = 1; } } else if (s[i] == 'Z') { if ((type & 1) && (type & 2)) { type ^= 2; use = 1; } } Send(use); } }
#include "Bruno.h" #include <vector> void Bruno(int N, int L, std::vector<int> A) { for (int i = 0; i < N; ++i) { if (A[i] == 0) { Remove(i); } } int fi = std::find(A.begin(), A.end(), 1) - A.begin(); if (fi != N) { for (int i = fi + 1; i < N; ++i) { if (A[i] == 1) { Remove(i); } } Remove(fi); } }

Compilation message (stderr)

Bruno.cpp: In function 'void Bruno(int, int, std::vector<int>)':
Bruno.cpp:10:19: error: 'find' is not a member of 'std'
   10 |     int fi = std::find(A.begin(), A.end(), 1) - A.begin();
      |                   ^~~~