제출 #800077

#제출 시각아이디문제언어결과실행 시간메모리
800077Sohsoh84Ancient Machine (JOI21_ancient_machine)C++17
70 / 100
64 ms8956 KiB
#include "Anna.h" #include <bits/stdc++.h> using namespace std; namespace { int variable_example = 0; } void Anna(int N, vector<char> S) { variable_example++; int tflagind = -1; vector<int> ans = {0}; for (int i = 1; i < N; i++) { ans.push_back(S[i - 1] == 'Z'); } int ind = 0; while (S[ind] != 'X' && ind < N) ind++; if (ind == N) return; for (int i = 0; i <= ind; i++) ans[i] = 0; ans[ind] = 1; for (int i = N - 2; i >= 0; i--) if (ans[i] + ans[i + 1] == 2) ans[i] = 0; for (int e : ans) Send(e); }
#include "Bruno.h" #include <bits/stdc++.h> using namespace std; namespace { int variable_example = 0; int FunctionExample(int P) { return 1 - P; } } // namespace void Bruno(int N, int L, std::vector<int> TA) { if (!L) { for (int i = 0; i < N; i++) Remove(i); return; } int ind = 0; vector<int> A(N); while (!TA[ind]) ind++; for (int i = 0; i < ind; i++) A[i] = 1; A[N - 1] = 1; for (int i = ind + 1; i < N; i++) A[i - 1] = TA[i]; stack<int> st; bool flag = false; for (int i = 0; i < N; i++) { if (A[i]) { while (st.size() > 1) { Remove(st.top()); st.pop(); } Remove(i); } else st.push(i); } while (!st.empty()) { Remove(st.top()); st.pop(); } }

컴파일 시 표준 에러 (stderr) 메시지

Anna.cpp: In function 'void Anna(int, std::vector<char>)':
Anna.cpp:12:6: warning: unused variable 'tflagind' [-Wunused-variable]
   12 |  int tflagind = -1;
      |      ^~~~~~~~

Bruno.cpp: In function 'void Bruno(int, int, std::vector<int>)':
Bruno.cpp:34:7: warning: unused variable 'flag' [-Wunused-variable]
   34 |  bool flag = false;
      |       ^~~~
Bruno.cpp: At global scope:
Bruno.cpp:10:6: warning: 'int {anonymous}::FunctionExample(int)' defined but not used [-Wunused-function]
   10 |  int FunctionExample(int P) { return 1 - P; }
      |      ^~~~~~~~~~~~~~~
Bruno.cpp:8:6: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    8 |  int variable_example = 0;
      |      ^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...