1 solutions

  • 1
    @ 2025-11-21 14:19:03
    #include<bits/stdc++.h>
    using namespace std;
    
    long long x;
    bool isPrime(long long x){
        if(x<=1) return false;
    	if(x==2) return true;
    	for(int i=2;i<=sqrt(x);i++){
    		if(x%i==0) return false;
    	}
    	return true;
    }
    
    int main(){
    	
    	cin>>x;
    	if(isPrime(x)) cout<<"Y";
    	else cout<<"N";
    	
    	return 0;
    }
    
    • 1

    Information

    ID
    117
    Time
    1000ms
    Memory
    64MiB
    Difficulty
    8
    Tags
    # Submissions
    21
    Accepted
    5
    Uploaded By