제출 #1008753

#제출 시각아이디문제언어결과실행 시간메모리
1008753Rolo678Labels (NOI20_labels)C++14
0 / 100
1048 ms2140 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >>n; vector<int>d(n); for(int i = 1;i<n;i++) { cin >>d[i]; } int num = 0; int ans = 0; for(int i = 1;i<=n;i++) { bool flag = true; int k = i; for(int j = 1;j<n;j++) { if(d[i]+k > n) { flag = false; break; } else { k+= d[i]; } } num += flag; if(flag)ans = i; } if(num != 1) { cout << -1 << '\n'; } else { int k = ans; cout << k << ' '; for(int j:d) { k+= j; cout << k << ' '; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...