# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
674601 | QwertyPi | Labels (NOI20_labels) | C++14 | 139 ms | 6708 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 11;
int a[N], d[N];
int main(){
int n; cin >> n;
for(int i = 0; i < n - 1; i++) cin >> d[i];
a[0] = 0; for(int i = 0; i < n - 1; i++) a[i + 1] = a[i] + d[i];
int _min = *min_element(a, a + n), _max = *max_element(a, a + n);
if(_max - _min != n - 1){
cout << -1 << endl;
}else{
for(int i = 0; i < n; i++) cout << a[i] - _min + 1 << ' '; cout << endl;
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |