/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Wrong Answer 2ms 548.0 KiB
#2 Wrong Answer 2ms 324.0 KiB
#3 Time Exceeded ≥2028ms ≥2.117 MiB
#4 Accepted 235ms 2.328 MiB
#5 Accepted 222ms 2.359 MiB
#6 Accepted 220ms 2.344 MiB
#7 Accepted 2ms 332.0 KiB
#8 Wrong Answer 2ms 332.0 KiB
#9 Wrong Answer 336ms 2.688 MiB
#10 Wrong Answer 242ms 2.324 MiB

Code

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define sp " "
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define yes cout << "yes" << endl
#define no cout << "no" << endl

void messi()
{
    ll n;
    cin >> n;
    vector<ll> v(n);
    for (ll &x : v)
        cin >> x;
    ll q;
    cin >> q;
    while (q--)
    {
        ll a, b, x;
        cin >> a >> b >> x;
        if (a == 1)
        {

            v[b] = x;
        }
        else
        {
            bool flag = true;

            for (ll i = b; i < x; i++)
            {
                if (v[i] > v[i + 1])
                {
                    flag = false;
                    break;
                }
            }
            if (flag)
                YES;
            else
                NO;
        }
    }
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    ll tc = 1; // cin>>tc;
    while (tc--)
    {
        messi();
    }
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1085 Sorted or !Sorted
Contest
Bangladesh 2.0
Language
C++20 (G++ 13.2.0)
Submit At
2024-08-16 17:15:00
Judged At
2024-10-03 13:23:20
Judged By
Score
40
Total Time
≥2028ms
Peak Memory
≥2.688 MiB