/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 324.0 KiB
#2 Wrong Answer 2ms 344.0 KiB
#3 Time Exceeded ≥2087ms ≥2.137 MiB

Code

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pi (3.141592653589)
#define mod 1000000007
#define pb push_back
#define vi vector<ll>
#define mp make_pair
#define f first
#define s second
#define sz(container) (ll) container.size()
#define setp(x) cout << fixed << setprecision(x)
#define all(container) container.begin(), container.end()
#define rall(container) container.rbegin(), container.rend()
#define fast ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
int main()
{
    fast;
    ll n;
    cin >> n;
    vi arr(n);
    for (ll i = 0; i < n; i++)
    {
        ll x;
        cin >> x;
    }
    ll q;
    cin >> q;
    while (q--)
    {
        ll x, l, r;
        cin >> x >> l >> r;
        if (x == 1)
        {
            arr[l - 1] = r;
        }
        else
        {
            cout << (is_sorted(arr.begin() + l - 1, arr.begin() + r) ? "YES" : "NO") << "\n";
        }
    }
}

Information

Submit By
Type
Submission
Problem
P1085 Sorted or !Sorted
Language
C++17 (G++ 13.2.0)
Submit At
2024-08-17 04:20:29
Judged At
2024-11-11 03:09:48
Judged By
Score
10
Total Time
≥2087ms
Peak Memory
≥2.137 MiB