Submission

Status:

[PP-SSSSSSSSSS]

Subtask/Task Score:

{0/100}

Score: 0

User: letdown

Problemset: ซื้อขายหุ้นซีเค

Language: cpp

Time: 0.002 second

Submitted On: 2026-03-10 22:04:54

#include <bits/stdc++.h>

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

    int n, mn, mx=0, tmp;
    cin >> n >> mn;
    n--;

    while (n--) {
        cin >> tmp;
        mn = min(mn, tmp);
        mx = max(mx, tmp - mn);
    }

    cout << mx;
}