답안 #113181

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
113181 2019-05-24T07:50:31 Z rkocharyan Editor (BOI15_edi) C++14
15 / 100
55 ms 3832 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    vector <int> e;
    e.push_back(0);
    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        if (x > 0) {
            e.push_back(x);
            cout << x << '\n';
        } else {
            x *= -1;
            if ((int) e.size() > 1) {
                e.pop_back();
            }
            cout << e.back() << '\n';
        }
    }
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 55 ms 3732 KB Output is correct
2 Correct 55 ms 3832 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 28 ms 2672 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -