# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
301169 | beso123 | Labels (NOI20_labels) | C++14 | 36 ms | 1664 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define int long long
#define pii pair<int,int>
#define x first
#define y second
using namespace std;
int n;
int a[100005];
main(){
cin>>n;
a[1]=1;
for(int k=2;k<=n;k++){
cin>>a[k];
a[k]+=a[k-1];
}
int ad=0;
for(int k=1;k<=n;k++){
if(a[k]<0)
ad=max(ad,abs(a[k]));
}
for(int k=1;k<=n;k++)
a[k]+=ad;
int mx=0;
for(int k=1;k<=n;k++){
mx=max(mx,a[k]);
}
if(mx!=n)
cout<<-1;
else{
for(int k=1;k<=n;k++)
cout<<a[k]<<' ';
}
return 0;
}
컴파일 시 표준 에러 (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... |