Submission #699681

# Submission time Handle Problem Language Result Execution time Memory
699681 2023-02-17T17:45:01 Z Lobo Measures (CEOI22_measures) C++17
35 / 100
48 ms 5432 KB
#include<bits/stdc++.h>
using namespace std;
const long long inf = (long long) 1e18 + 10;
const int inf1 = (int) 1e9 + 10;
#define int long long
#define dbl long double
#define endl '\n'
#define sc second
#define fr first
#define mp make_pair
#define pb push_back
#define all(x) x.begin(), x.end()
const int maxn = -1;

int n, m, d;

void solve() {
    cin >> n >> m >> d;
    int mx = -inf;
    int ans = 0;
    for(int i = 1; i <= m; i++) {
        int x; cin >> x;
        mx = max(mx, x - i*d);
        ans = max(ans, -(x - i*d) + mx);
        // cout << mx << " " << ans << endl;
        if(ans%2 == 0) {
            cout << ans/2 << endl;
        }
        else {
            cout << ans/2 << ".5" << endl;
        }
    }
}

int32_t main() {
    ios::sync_with_stdio(false); cin.tie(0);

    // freopen("in.in", "r", stdin);
    // freopen("out.out", "w", stdout);
    int tt = 1;
    // cin >> tt;
    while(tt--) {
        solve();
    }

}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 34 ms 1252 KB Output is correct
2 Correct 41 ms 3232 KB Output is correct
3 Correct 42 ms 5104 KB Output is correct
4 Correct 35 ms 3004 KB Output is correct
5 Correct 37 ms 4208 KB Output is correct
6 Correct 36 ms 3324 KB Output is correct
7 Correct 41 ms 4240 KB Output is correct
8 Correct 35 ms 3096 KB Output is correct
9 Correct 36 ms 2884 KB Output is correct
10 Correct 41 ms 5432 KB Output is correct
11 Correct 48 ms 3740 KB Output is correct
12 Correct 39 ms 4696 KB Output is correct
13 Correct 37 ms 3020 KB Output is correct
14 Correct 41 ms 4936 KB Output is correct
15 Correct 40 ms 4784 KB Output is correct
16 Correct 34 ms 2568 KB Output is correct
17 Correct 38 ms 4316 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 34 ms 1252 KB Output is correct
2 Correct 41 ms 3232 KB Output is correct
3 Correct 42 ms 5104 KB Output is correct
4 Correct 35 ms 3004 KB Output is correct
5 Correct 37 ms 4208 KB Output is correct
6 Correct 36 ms 3324 KB Output is correct
7 Correct 41 ms 4240 KB Output is correct
8 Correct 35 ms 3096 KB Output is correct
9 Correct 36 ms 2884 KB Output is correct
10 Correct 41 ms 5432 KB Output is correct
11 Correct 48 ms 3740 KB Output is correct
12 Correct 39 ms 4696 KB Output is correct
13 Correct 37 ms 3020 KB Output is correct
14 Correct 41 ms 4936 KB Output is correct
15 Correct 40 ms 4784 KB Output is correct
16 Correct 34 ms 2568 KB Output is correct
17 Correct 38 ms 4316 KB Output is correct
18 Incorrect 41 ms 4420 KB Output isn't correct
19 Halted 0 ms 0 KB -