2 solutions

  • 0
    @ 2025-10-9 20:11:11

    请勿抄袭

    #include <iostream>
    #include <algorithm>
    using namespace std;
    typedef long long ll;
    const int N = 2e5 + 5;
    int n, x, a[N], dp[N], f[N], g[N], idx, ans1, ans2;
    int main() {
    	while (cin >> x) a[++n] = x;
    	f[++ans1] = a[1];
    	for (int i = 2; i <= n; ++i) {
    		if (a[i] <= f[ans1]) f[++ans1] = a[i];
    		................
    

    Information

    ID
    5078
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    6
    Tags
    # Submissions
    187
    Accepted
    46
    Uploaded By