TOPIC

Time limit exceeded

emenin asked 5 years ago

#include<iostream>

using namespace std;

int main(){
     int a, t=0, cont=0 ;

     cin>>a;
     int vet[a];
     while(cont<a){
        cin>>vet[cont];
        int test=0;
        for(int i=0;i<cont;i++){
            if(vet[cont]==vet[i]){
                test = 1;
            }
        }
        if(test == 0)
            t++;
        cont++;
     }
     cout<<t<<endl;
    return 0;
}

não consigo descobrir o erro...

This topic has not been answered yet. Be the first!

Remember not post solutions. Your post may be reviewed by our moderators.