General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
148608334 Practice:
Deepesson
1648B - 44 C++20 (GCC 11-64) Accepted 1933 ms 58836 KB 2022-03-06 16:15:09 2022-03-06 16:15:09
→ Source
#include <bits/stdc++.h>///beta
void solve(void){
    int N,C;
    std::cin>>N>>C;C+=5;
    int array[N];
    for(auto&x:array)std::cin>>x;
    std::map<int,int> mapa;
    for(auto&x:array)mapa[x]++;
    if(!mapa[1]){
        printf("No\n");
        return;
    }
    long long pref[C]={};
    for(auto&x:mapa){
        pref[x.first]++;
    }
    int s=0;
    for(int i=0;i!=C;++i){
        s+=pref[i];
        pref[i]=s;
    }
    for(auto&x:mapa){
        int a = x.first;
        int b = a*2;
        int sec=2;
        while(b<C){
            ///Numero de valores entre b e b+i-1
            int valores = pref[std::min(C-1,b+a-1)];
            valores-=pref[b-1];
            if(valores){
                if(!mapa[sec]){
                    printf("No\n");
                    return;
                }
            }
            b+=a;
            ++sec;
        }
    }
    printf("Yes\n");
}
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    std::cout.tie(0);
    int t;
    std::cin>>t;
    for(int __=0;__!=t;++__)
        solve();
}
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details