제로1 [백준/BOJ][C++] 10773번 제로 #include #include using namespace std; int main() { // 쓰레드 환경이 아닐때 버퍼를 분리하여 처리속도를 빠르게 해줌 ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int K; cin >> K; stack stk; int sum = 0; for (int i = 0; i > x; if (x == 0) { sum -= stk.top(); stk.pop(); } else { stk.push(x); sum += x; } } cout 2023. 8. 21. 이전 1 다음