| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 483995 | T0p_ | Labels (NOI20_labels) | C++14 | 70 ms | 5476 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int N = 3e5+5;
int d[N];
int main()
{
int n;
scanf(" %d",&n);
int mn = 1e9, mx = -1e9;
for(int i=2 ; i<=n ; i++)
{
scanf(" %lld",&d[i]);
d[i] += d[i-1];
mn = min(mn, d[i]);
mx = max(mx, d[i]);
}
int cnt = 0;
for(int a1=1 ; a1<=n ; a1++) if(1 <= a1+mn && a1+mn <= n && 1 <= a1+mx && a1+mx <= n) cnt++;
if(cnt != 1) printf("-1\n");
else
{
for(int a1=1 ; a1<=n ; a1++) if(1 <= a1+mn && a1+mn <= n && 1 <= a1+mx && a1+mx <= n)
{
printf("%d ",a1);
for(int i=2 ; i<=n ; i++) printf("%d ",a1+d[i]);
return 0;
}
}
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... | ||||
