제출 #935477

#제출 시각아이디문제언어결과실행 시간메모리
935477SmuggingSpunAncient Machine (JOI21_ancient_machine)C++17
0 / 100
54 ms9972 KiB
#include "Anna.h" #include<bits/stdc++.h> using namespace std; void Anna(int n, vector<char>S){ for(char& c : S){ if(c == 'X'){ Send(0); Send(0); } else if(c == 'Y'){ Send(1); Send(0); } else{ Send(0); Send(1); } } }
#include "Bruno.h" #include<bits/stdc++.h> using namespace std; void Bruno(int n, int sz_a, vector<int>A){ const int X = 0, Y = 1, Z = 2; vector<int>a(n); for(int i = 0; i < sz_a; i += 2){ a[i >> 1] = A[i] + (A[i + 1] << 1); } int ptr = n - 1; while(ptr > -1 && a[ptr] != Z){ Remove(ptr--); } if(ptr > -1){ int last = ptr--; while(ptr > -1){ int r_ptr = ptr; while(ptr > -1 && a[ptr] != X){ ptr--; } if(ptr > -1){ for(int i = ptr + 1; i <= r_ptr; i++){ Remove(i); } while(ptr > -1 && a[ptr] == X){ Remove(ptr--); } } } Remove(last); } }

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

Bruno.cpp: In function 'void Bruno(int, int, std::vector<int>)':
Bruno.cpp:5:19: warning: unused variable 'Y' [-Wunused-variable]
    5 |  const int X = 0, Y = 1, Z = 2;
      |                   ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...