제출 #1294550

#제출 시각아이디문제언어결과실행 시간메모리
1294550serkanrashidAncient Machine (JOI21_ancient_machine)C++20
70 / 100
43 ms6552 KiB
#include "Anna.h" #include<bits/stdc++.h> using namespace std; pair<int,int> encode(char c) { pair<int,int>res = {0,0}; if(c == 'X') res = {0,0}; if(c == 'Y') res = {0,1}; if(c == 'Z') res = {1,0}; return res; } void Anna(int N, std::vector<char> S) { bool f = false; for(int i = 0; i < N; i++) { if(S[i] == 'X') f = true; if(!f) continue; if(S[i] == 'X' || S[i] == 'Y') Send(1); else Send(0); } }
#include "Bruno.h" #include<bits/stdc++.h> using namespace std; char decode(pair<int,int> p) { if(p == make_pair(0,0)) return 'X'; if(p == make_pair(0,1)) return 'Y'; if(p == make_pair(1,0)) return 'Z'; } const int MAXN = 1e5 + 5; char s[MAXN]; void Bruno(int N, int L, std::vector<int> A) { int stidx = N - A.size(); for(int i = 0; i < stidx; i++) Remove(i); vector<int>br; for(int i = stidx; i < N; i++) { int s = A[i-stidx]; if(s == 1) br.push_back(i); else { while(br.size() >= 2) { Remove(br.back()); br.pop_back(); } Remove(i); } } while(br.size() >= 1) { Remove(br.back()); br.pop_back(); } }

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

# 2번째 컴파일 단계

Bruno.cpp: In function 'char decode(std::pair<int, int>)':
Bruno.cpp:10:1: warning: control reaches end of non-void function [-Wreturn-type]
   10 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...