VL11 - Kiểm tra số nguyên tố

View as PDF

Submit solution

Points: 1.00
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type
Allowed languages
C, C#, C++, Go, Java, Pascal, Perl, PHP, Python, Ruby, Rust, Scratch, Swift

Cho số nguyên ~n~, hãy viết chương trình kiểm tra xem ~n~ có phải số nguyên tố hay không?

Input

Số nguyên ~n~ cần kiểm tra

Giới hạn:

  • ~|n| \le 10^{12}~

Output

Nếu ~n~ là số nguyên tố, in ra YES, ngược lại in ra NO

Sample

Input #1
7
Output #1
YES

Comments

Please read the guidelines before commenting.



  • 0
    noname2003  commented on Sept. 18, 2023, 4:18 a.m.

    bai nay lam kieu j ae toi toan bi sai


  • 0
    longzuhaun  commented on Sept. 9, 2023, 2:42 p.m.

    Bài này lỗi à ? test case 1 là gì thế mn?


  • -7
    ZaoZing  commented on Aug. 8, 2023, 11:51 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -9
    PQM1709  commented on July 27, 2023, 9:16 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -12
    annh  commented on July 11, 2023, 4:20 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -10
    anhbongthayminhquadeptrai  commented on July 10, 2023, 3:32 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.