/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 1ms 324.0 KiB
#2 Wrong Answer 1ms 320.0 KiB

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-11-11 03:12:14
Judged By
Score
0
Total Time
1ms
Peak Memory
324.0 KiB