답안 #602258

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
602258 2022-07-22T19:15:41 Z Devigo Labels (NOI20_labels) C++14
0 / 100
38 ms 4668 KB
#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define mp make_pair

const int siz = 0;
const int mod = 0;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n;
	cin >> n;
	vector<int> v(n-1);
	for(int i=0; i<n-1; i++) {
		cin >> v[i];
	}
	bool ok = 1; int sum = 0;
	for(int i=0; i<n-1; i++) {
		sum += v[i];
		if(v[i] == 0) {
			ok = 0; break;
		}
	}
	if(!ok) {
		cout << "-1\n";
	}
	else {
		int x = 1;
		cout << x << " ";
		for(int i=0; i<n-1; i++) {
			cout << (x+=v[i]) << " ";
		}
		cout << "\n";
	}
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 36 ms 3960 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 38 ms 4668 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -