ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2057B - Gorilla and the Exam
Language: C++17 (GCC 7-32)


Submission (verdict: Time limit exceeded on test 14):
#include<bits/stdc++.h>
using namespace std;


#define md : 1000000007;



int solve(){
    int n,k;
    cin >> n >> k;

    vector<int> vec(n);

    unordered_map<int,int> mp;

    for(int i=0; i<n; i++){
        cin >> vec[i];
        mp[vec[i]]++;
    }

    priority_queue<pair<int,int>, vector<pair<int,int>>, greater<> > st;

    for(auto x: mp){
        st.push({x.second, x.first});
    }

    int count = 0;

    while(!st.empty() && k){
        int temp = (st.top()).first;
        if(temp > k) k = 0;
        else{
            k-=temp;
            st.pop();
        }
    }

    st.size() > 0 ? cout <<  st.size() : cout << 1 ;
    cout << endl;


}




int main(){

    int t;
    cin>>t;


    while(t--)
        solve();

    return 0;
}
Problem: 2057B - Gorilla and the Exam
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include<bits/stdc++.h>
using namespace std;


#define md : 1000000007;



void solve(){
    int n,k;
    cin >> n >> k;

    vector<int> vec(n);

    unordered_map<int,int> mp;
    vector<int>count = {1};

    for(int i=0; i<n; i++){
        cin >> vec[i];
        mp[vec[i]]++;
    }

    sort(vec.begin(),vec.end());
    for(int i=1; i<vec.size(); i++){
        if(vec[i] == vec[i-1]){
            count.back()++;
        }else{
            count.push_back(1);
        }
    }

    sort(count.begin(), count.end());
    

    int i;
    for( i=0; i<count.size(); ){
        if(count[i] > k) break;
        i++;
        k-=count[i];
        if(k == 0) break;
    }

    int res = count.size()-i != 0 ? count.size()-i : 1;

    cout << res <<  endl;
    // priority_queue<pair<int,int>, vector<pair<int,int>>, greater<> > st;

    // for(auto x: mp){
    //     st.push({x.second, x.first});
    // }

    // int count = 0;

    // while(!st.empty() && k){
    //     int temp = (st.top()).first;
    //     if(temp > k) k = 0;
    //     else{
    //         k-=temp;
    //         st.pop();
    //     }
    // }

    // st.size() > 0 ? cout <<  st.size() : cout << 1 ;
    // cout << endl;


}




int main(){

    int t;
    cin>>t;


    while(t--)
        solve();

    return 0;
}

Submission (verdict: Time limit exceeded on test 14):
#include<bits/stdc++.h>
using namespace std;


#define md : 1000000007;



void solve(){
    int n,k;
    cin >> n >> k;

    vector<int> vec(n);

    unordered_map<int,int> mp;
    vector<int>count = {1};

    for(int i=0; i<n; i++){
        cin >> vec[i];
        mp[vec[i]]++;
    }

    sort(vec.begin(),vec.end());
    for(int i=1; i<vec.size(); i++){
        if(vec[i] == vec[i-1]){
            count.back()++;
        }else{
            count.push_back(1);
        }
    }

    sort(count.begin(), count.end());
    

    int i;
    for( i=0; i<count.size(); ){
        if(count[i] > k) break;
        k-=count[i++];
        if(k == 0) break;
    }

    int res = count.size()-i != 0 ? count.size()-i : 1;

    cout << res <<  endl;
    // priority_queue<pair<int,int>, vector<pair<int,int>>, greater<> > st;

    // for(auto x: mp){
    //     st.push({x.second, x.first});
    // }

    // int count = 0;

    // while(!st.empty() && k){
    //     int temp = (st.top()).first;
    //     if(temp > k) k = 0;
    //     else{
    //         k-=temp;
    //         st.pop();
    //     }
    // }

    // st.size() > 0 ? cout <<  st.size() : cout << 1 ;
    // cout << endl;


}




int main(){

    int t;
    cin>>t;


    while(t--)
        solve();

    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>

#define int long long
#define all(a) a.begin(), a.end()

using namespace std;

signed main(){
    ios_base :: sync_with_stdio(0); cin.tie(0);
    int tests;
    cin >> tests;
    for (int tests1 = 0; tests1 < tests; tests1++){
        int l, r;
        cin >> l >> r;
        int x1, x2, x3;
        x1 = l | (1 << __lg(l ^ r) - 1);
        x2 = x1 + 1;
        x3 = (x1 == l ? r : l);
        cout << x1 << ' ' << x2 << ' ' << x3 << endl;
    }
}


Submission (verdict: Accepted):
#include <bits/stdc++.h>

#define int long long
#define all(a) a.begin(), a.end()

using namespace std;

signed main(){
    ios_base :: sync_with_stdio(0); cin.tie(0);
    int tests;
    cin >> tests;
    for (int tests1 = 0; tests1 < tests; tests1++){
        int l, r;
        cin >> l >> r;
        int x1, x2, x3;
        x1 = l | ((1 << (__lg(l ^ r))) - 1);
        x2 = x1 + 1;
        x3 = (x1 == l ? r : l);
        cout << x1 << ' ' << x2 << ' ' << x3 << endl;
    }
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>

#define int long long
#define all(a) a.begin(), a.end()

using namespace std;

signed main(){
    ios_base :: sync_with_stdio(0); cin.tie(0);
    int tests;
    cin >> tests;
    for (int tests1 = 0; tests1 < tests; tests1++){
        int l, r;
        cin >> l >> r;
        int x1, x2, x3;
        x1 = 1 << __lg(l ^ r);
        x2 = x1 - 1;
        x3 = (x2 == l ? r : l);
        cout << x1 << ' ' << x2 << ' ' << x3 << endl;
    }
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>

#define int long long
#define all(a) a.begin(), a.end()

using namespace std;

signed main(){
    ios_base :: sync_with_stdio(0); cin.tie(0);
    int tests;
    cin >> tests;
    for (int tests1 = 0; tests1 < tests; tests1++){
        int l, r;
        cin >> l >> r;
        int x1, x2, x3;
        x1 = l | (1 << __lg(l ^ r));
        x2 = x1 - 1;
        x3 = (x2 == l ? r : l);
        cout << x1 << ' ' << x2 << ' ' << x3 << endl;
    }
}


Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>

#define int long long
#define all(a) a.begin(), a.end()

using namespace std;

signed main(){
    ios_base :: sync_with_stdio(0); cin.tie(0);
    int tests;
    cin >> tests;
    for (int tests1 = 0; tests1 < tests; tests1++){
        int l, r;
        cin >> l >> r;
        int x1, x2, x3;
        x1 = l | (1 << (__lg(l ^ r) + 1));
        x2 = x1 - 1;
        x3 = (x2 == l ? r : l);
        cout << x1 << ' ' << x2 << ' ' << x3 << endl;
    }
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>

#define int long long
#define all(a) a.begin(), a.end()

using namespace std;

signed main(){
    ios_base :: sync_with_stdio(0); cin.tie(0);
    int tests;
    cin >> tests;
    for (int tests1 = 0; tests1 < tests; tests1++){
        int l, r;
        cin >> l >> r;
        int x1, x2, x3;
        x1 = 1 << __lg(l ^ r);
        x2 = x1 - 1;
        x3 = (x2 == l ? r : l);
        cout << x1 << ' ' << x2 << ' ' << x3 << endl;
    }
}


Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>

#define int long long
#define all(a) a.begin(), a.end()

using namespace std;

signed main(){
    ios_base :: sync_with_stdio(0); cin.tie(0);
    int tests;
    cin >> tests;
    for (int tests1 = 0; tests1 < tests; tests1++){
        int l, r;
        cin >> l >> r;
        int x1, x2, x3;
        x1 = l | (1 << __lg(l ^ r));
        x2 = x1 - 1;
        x3 = (x2 == l ? r : l);
        cout << x1 << ' ' << x2 << ' ' << x3 << endl;
    }
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>

#define int long long
#define all(a) a.begin(), a.end()

using namespace std;

signed main(){
    ios_base :: sync_with_stdio(0); cin.tie(0);
    int tests;
    cin >> tests;
    for (int tests1 = 0; tests1 < tests; tests1++){
        int l, r;
        cin >> l >> r;
        int x1, x2, x3;
        x1 = l | (1 << (__lg(l ^ r) + 1));
        x2 = x1 - 1;
        x3 = (x2 == l ? r : l);
        cout << x1 << ' ' << x2 << ' ' << x3 << endl;
    }
}


Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>

#define int long long
#define all(a) a.begin(), a.end()

using namespace std;

signed main(){
    ios_base :: sync_with_stdio(0); cin.tie(0);
    int tests;
    cin >> tests;
    for (int tests1 = 0; tests1 < tests; tests1++){
        int l, r;
        cin >> l >> r;
        int x1, x2, x3;
        x1 = l | (1 << __lg(l ^ r) - 1);
        x2 = x1 + 1;
        x3 = (x1 == l ? r : l);
        cout << x1 << ' ' << x2 << ' ' << x3 << endl;
    }
}
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
#include <cmath>
#define int long long int
#define endl "\n"
using namespace std;

int32_t main(){
    int test; cin >> test;
    for(int q=0;q<test;q++){
        int l; int r; cin >> l >> r;
        for(int i=30;i>-1;i--){
            int vbuck=l/pow(2,i);
            if((vbuck+1)*pow(2,i)<=r){
                cout<<(vbuck+1)*pow(2,i)<<" "<<(vbuck+1)*pow(2,i)-1<<" ";
                if((vbuck+1)*pow(2,i)-1==l){
                    cout<<r<<endl;
                } else{
                    cout<<l<<endl;
                }
                break;
            }
        }
    }
    return 0;
}

Submission (verdict: Accepted):
#include <bits/stdc++.h>
#include <cmath>
#define int long long int
#define endl "\n"
using namespace std;

int32_t main(){
    int test; cin >> test;
    for(int q=0;q<test;q++){
        int l; int r; cin >> l >> r;
        for(int i=30;i>-1;i--){
            int vbuck=l/pow(2,i);
            vbuck++;
            vbuck*=pow(2,i);
            if(vbuck<=r){
                cout<<vbuck<<" "<<vbuck-1<<" ";
                if(vbuck-1==l){
                    cout<<r<<endl;
                } else{
                    cout<<l<<endl;
                }
                break;
            }
        }
    }
    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
#include <cmath>
#define int long long int
#define endl "\n"
using namespace std;

int32_t main(){
    int test; cin >> test;
    for(int q=0;q<test;q++){
        int l; int r; cin >> l >> r;
        for(int i=30;i>-1;i--){
            int vbuck=l/pow(2,i);
            if((vbuck+1)*pow(2,i)<=r){
                cout<<l<<" "<<(vbuck+1)*pow(2,i)<<" "<<(vbuck+1)*pow(2,i)-1<<endl;
                break;
            }
        }
    }
    return 0;
}

Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
#include <cmath>
#define int long long int
#define endl "\n"
using namespace std;

int32_t main(){
    int test; cin >> test;
    for(int q=0;q<test;q++){
        int l; int r; cin >> l >> r;
        for(int i=30;i>-1;i--){
            int vbuck=l/pow(2,i);
            if((vbuck+1)*pow(2,i)<=r){
                cout<<(vbuck+1)*pow(2,i)<<" "<<(vbuck+1)*pow(2,i)-1<<" ";
                if((vbuck+1)*pow(2,i)-1==l){
                    cout<<r<<endl;
                } else{
                    cout<<l<<endl;
                }
                break;
            }
        }
    }
    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
#include <cmath>
#define int long long int
#define endl "\n"
using namespace std;

int32_t main(){
    int test; cin >> test;
    for(int q=0;q<test;q++){
        int l; int r; cin >> l >> r;
        for(int i=30;i>-1;i--){
            int vbuck=l/pow(2,i);
            if((vbuck+1)*pow(2,i)<=r){
                cout<<l<<" "<<(vbuck+1)*pow(2,i)<<" "<<(vbuck+1)*pow(2,i)-1<<endl;
                break;
            }
        }
    }
    return 0;
}
Problem: 2060D - Subtract Min Sort
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
int main(){
    int tt;cin>>tt;
    while(tt--){
        int n;cin>>n;
        int arr[n];
        for(int i=0;i<n;i++){
            cin>>arr[i];
        }
        if(arr[0]>arr[1]){
            cout<<"NO"<<endl;
            continue;
        }

        for(int i=0;i<n-1;i++){
            int mn=min(arr[i],arr[i+1]);
            arr[i]-=mn;
             arr[i+1]-=mn;
        }

        int cnt=0;
        for(int i=0;i<n;i++){
            if(arr[i]) cnt++;
        }
        if(cnt<=1) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
}
Problem: 2060D - Subtract Min Sort
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
int main(){
    int tt;cin>>tt;
    while(tt--){
        int n;cin>>n;
        int arr[n];
        for(int i=0;i<n;i++){
            cin>>arr[i];
        }
        if(arr[0]>arr[1]){
            cout<<"NO"<<endl;
            continue;
        }

        for(int i=0;i<n-1;i++){
            int mn=min(arr[i],arr[i+1]);
            arr[i]-=mn;
             arr[i+1]-=mn;
        }

        int cnt=0;
        for(int i=0;i<n;i++){
            if(arr[i]) cnt++;
        }
        if(cnt<=1) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
}

Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;
int main(){
    int tt;cin>>tt;
    while(tt--){
        int n;cin>>n;
        int arr[n];
        for(int i=0;i<n;i++){
            cin>>arr[i];
        }
        if(arr[0]>arr[1]){
            cout<<"NO"<<endl;
            continue;
        }

        for(int i=0;i<n-1;i++){
            int mn=min(arr[i],arr[i+1]);
            arr[i]-=mn;
             arr[i+1]-=mn;
        }

        int cnt=0;
        for(int i=0;i<n;i++){
            if(arr[n-1]) continue;
            else cnt++;
        }
        if(cnt) cout<<"NO"<<endl;
        else cout<<"YES"<<endl;
    }
}
Problem: 2060D - Subtract Min Sort
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
int main(){
    int tt;cin>>tt;
    while(tt--){
        int n;cin>>n;
        int arr[n];
        for(int i=0;i<n;i++){
            cin>>arr[i];
        }
        if(arr[0]>arr[1]){
            cout<<"NO"<<endl;
            continue;
        }

        for(int i=0;i<n-1;i++){
            int mn=min(arr[i],arr[i+1]);
            arr[i]-=mn;
             arr[i+1]-=mn;
        }

        int cnt=0;
        for(int i=0;i<n;i++){
           cnt=cnt^arr[i];
        }
        if(cnt==arr[n-1]) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
}




Submission (verdict: Accepted):
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector <ll>;
using ii = pair <ll, ll>;
using vii = vector <ii>;

void tc () {
    ll n;
    cin >> n;
    vll ve(n);
    for (ll &i : ve) cin >> i;
    ll j = 0;
    for (ll i = 1; i < n; i++) {
        if (ve[i-1] > ve[i]) j = i;
    }
    if (j == 0) { // all done
        cout << "YES\n";
        return;
    }
    auto fop = [&](ll i) {
        ll minN = min(ve[i], ve[i+1]);
        ve[i] -= minN;
        ve[i+1] -= minN;
    };
    for (ll i = 0; i < j; i++) {
        fop(i);
    }
    cout << (is_sorted(ve.begin(), ve.end()) ? "YES" : "NO") << '\n';
}

int main () {
    cin.tie(nullptr) -> sync_with_stdio(false);
    ll T; cin >> T; while (T--) { tc(); }
    return 0;
}
Problem: 2060D - Subtract Min Sort
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;
int main(){
    int tt;cin>>tt;
    while(tt--){
        int n;cin>>n;
        int arr[n];
        for(int i=0;i<n;i++){
            cin>>arr[i];
        }
        if(arr[0]>arr[1]){
            cout<<"NO"<<endl;
            continue;
        }

        for(int i=0;i<n-1;i++){
            int mn=min(arr[i],arr[i+1]);
            arr[i]-=mn;
             arr[i+1]-=mn;
        }

        int cnt=0;
        for(int i=0;i<n;i++){
            if(arr[n-1]) continue;
            else cnt++;
        }
        if(cnt) cout<<"NO"<<endl;
        else cout<<"YES"<<endl;
    }
}

Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
int main(){
    int tt;cin>>tt;
    while(tt--){
        int n;cin>>n;
        int arr[n];
        for(int i=0;i<n;i++){
            cin>>arr[i];
        }
        if(arr[0]>arr[1]){
            cout<<"NO"<<endl;
            continue;
        }

        for(int i=0;i<n-1;i++){
            int mn=min(arr[i],arr[i+1]);
            arr[i]-=mn;
             arr[i+1]-=mn;
        }

        int cnt=0;
        for(int i=0;i<n;i++){
           cnt=cnt^arr[i];
        }
        if(cnt==arr[n-1]) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
}
Problem: 2050C - Uninteresting Number
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 3):
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long n;
        cin>>n;
        long long temp = n;
        int two = 0, three = 0;
        long long sum = 0;
        while(temp>0)
        {
            int r = temp%10;
            sum += r;
            if(r==2) two++;
            if(r==3) three++;
            temp /= 10;
        }
        if(sum%9==0)
        {
            cout<<"YES"<<endl;
            continue;
        }
        bool flag = true;
        for(int i = 0; i<=min(10, two); i++)
        {
            for(int j = 0; j<=min(10, three); j++)
            {
                if((sum+i*2+j*6)%9==0)
                {
                    cout<<"YES"<<endl;
                    flag = false;
                    break;
                }
            }
        }
        if(flag==true)
        cout<<"NO"<<endl;
    }
    return 0;
}

Submission (verdict: Accepted):
#include <iostream>
#include <string>
using namespace std;

void solve() {
    string n;
    cin >> n;

    int sm = 0, twos = 0, threes = 0;

    // Compute sum and count 2s and 3s
    for (char c : n) {
        int digit = c - '0';
        sm += digit;
        if (digit == 2) twos++;
        if (digit == 3) threes++;
    }

    // Check combinations of transformations
    for (int i = 0; i <= min(10, twos); i++) {
        for (int j = 0; j <= min(10, threes); j++) {
            if ((sm + i * 2 + j * 6) % 9 == 0) {
                cout << "YES" << endl;
                return;
            }
        }
    }

    cout << "NO" << endl;
}

int main() {
    int t;
    cin >> t;

    while (t--) {
        solve();
    }

    return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 3):
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long n;
        cin>>n;
        long long temp = n;
        int two = 0, three = 0;
        long long sum = 0;
        while(temp>0)
        {
            int r = temp%10;
            sum += r;
            if(r==2) two++;
            if(r==3) three++;
            temp /= 10;
        }
        if(sum%9==0)
        {
            cout<<"YES"<<endl;
            continue;
        }
        bool flag = true;
        for(int i = 1; i<=min(8, two); i++)
        {
            if((sum+i*2)%9==0)
                {
                    cout<<"YES"<<endl;
                    flag = false;
                    break;
                }
        }
        if(flag==false)
        continue;
        for(int i = 1; i<=min(8, three); i++)
        {
            if((sum+i*6)%9==0)
                {
                    cout<<"YES"<<endl;
                    flag = false;
                    break;
                }
        }
        if(flag==false)
        continue;
        for(int i = 1; i<=min(8, two); i++)
        {
            for(int j = 1; j<=min(8, three); j++)
            {
                if((sum+i*2+j*6)%9==0)
                {
                    cout<<"YES"<<endl;
                    flag = false;
                    break;
                }
            }
        }
        if(flag==true)
        cout<<"NO"<<endl;
    }
    return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 3):
#include<bits/stdc++.h>
using namespace std;

int main() {
    int t;
    cin >> t;
    while (t--) {
        long long n;
        cin >> n;
        long long temp = n;
        int two = 0, three = 0;
        long long sum = 0;

        // Calculate digit sum and count of 2s and 3s
        while (temp > 0) {
            int r = temp % 10;
            sum += r;
            if (r == 2) two++;
            if (r == 3) three++;
            temp /= 10;
        }

        // Check if the current sum is already divisible by 9
        if (sum % 9 == 0) {
            cout << "YES" << endl;
            continue;
        }

        bool possible = false;

        // Iterate over possible combinations of transformations
        for (int x = 0; x <= min(8, two); x++) {
            for (int y = 0; y <= min(8, three); y++) {
                if ((sum + x * 2 + y * 6) % 9 == 0) {
                    possible = true;
                    break;
                }
            }
            if (possible) break; // Exit outer loop early
        }

        // Output result based on findings
        cout << (possible ? "YES" : "NO") << endl;
    }
    return 0;
}


Submission (verdict: Wrong answer on test 3):
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long n;
        cin>>n;
        long long temp = n;
        int two = 0, three = 0;
        long long sum = 0;
        while(temp>0)
        {
            int r = temp%10;
            sum += r;
            if(r==2) two++;
            if(r==3) three++;
            temp /= 10;
        }
        if(sum%9==0)
        {
            cout<<"YES"<<endl;
            continue;
        }
        bool flag = true;
        for(int i = 0; i<=min(10, two); i++)
        {
            for(int j = 0; j<=min(10, three); j++)
            {
                if((sum+i*2+j*6)%9==0)
                {
                    cout<<"YES"<<endl;
                    flag = false;
                    break;
                }
            }
        }
        if(flag==true)
        cout<<"NO"<<endl;
    }
    return 0;
}