Submission #288235

# Submission time Handle Problem Language Result Execution time Memory
288235 2020-09-01T10:41:00 Z Autoratch Labels (NOI20_labels) C++14
0 / 100
58 ms 4472 KB
#include <bits/stdc++.h>
using namespace std;

const int N = 3e5 + 1;

int n;
int a[N];

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);

    cin >> n;
    for(int i = 1;i < n;i++) cin >> a[i];
    int x = 0,mn = 0,mx = 0;
    for(int i = 1;i < n;i++)
    {
        x+=a[i];
        mn = min(mn,x);
    }
    x = 0;
    cout << x+1-mn << ' ';
    for(int i = 1;i < n;i++)
    {
        x+=a[i];
        cout << x+1-mn << ' ';
    }
}

Compilation message

Labels.cpp: In function 'int main()':
Labels.cpp:15:22: warning: unused variable 'mx' [-Wunused-variable]
   15 |     int x = 0,mn = 0,mx = 0;
      |                      ^~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 58 ms 4088 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 48 ms 4472 KB Output is correct
4 Incorrect 43 ms 2680 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -