# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
344869 | Jarif_Rahman | Labels (NOI20_labels) | C++17 | 74 ms | 6892 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define pb push_back
#define f first
#define sc second
using namespace std;
typedef long long int ll;
typedef string str;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int n; cin >> n;
vector<int> v(n-1);
for(int &x: v) cin >> x;
int mx = 0, mn = 1e8;
int cur = 0;
for(int i = 0; i < n-1; i++) cur+=v[i], mx = max(mx, cur), mn = min(mn, cur);
bool bl = 1;
int c = n - mx;
vector<int> ans(n);
ans[0] = c;
for(int i = 1; i < n; i++) ans[i] = ans[i-1] + v[i-1];
bool o = 0, nn = 0;
for(int i = 0; i < n; i++){
if(ans[i] == 1) o = 1;
if(ans[i] == n) nn = 1;
}
if(!o || !nn){
cout << "-1\n";
exit(0);
}
for(int x: ans) cout << x << " ";
cout << "\n";
}
컴파일 시 표준 에러 (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... |