• LQDOJ
  • Trang chủ
  • Bài tập
  • Bài nộp
  • Thành viên
  • Kỳ thi
  • Nhóm
  • Giới thiệu
    • Máy chấm
    • Khóa học
    • Đề xuất ý tưởng
    • Đề xuất bài tập
    • Tools
    • Báo cáo tiêu cực
    • Báo cáo lỗi

Tiếng Việt

Tiếng Việt
English

Đăng nhập

Đăng ký

hungtd

  • Giới thiệu
  • Bài tập
  • Bài nộp

Rating
-
Bài tập
88
Điểm
14247
Rating #
-
Điểm #
4242

Trần Đức Hùng (Newton Grammar)

Giới thiệu

English or Spanish?

Don't Move!

YOU MOVED SO YOU'RE G@Y

Code for a problem(hope you can find it):

#include<bits/stdc++.h>
using namespace std;
#define ll long long

bool is_prime(ll n) {
    if (n <= 1) {
        return false;
    }
    if (n <= 3) {
        return true;
    }
    if (n % 2 == 0 || n % 3 == 0) {
        return false;
    }
    ll i = 5;
    while (i * i <= n) {
        if (n % i == 0 || n % (i + 2) == 0) {
            return false;
        }
        i += 6;
    }
    return true;
}

signed main() {
    ll n;
    cin >> n;

    if (is_prime(n)) {
        cout << "YES" << "\n";
    } else {
        cout << "NO" << "\n";
    }

Also, check out my CDOJ, DMOJ profile:
CDOJ: https://oj.codedream.edu.vn/user/newton7
DMOJ: https://dmoj.ca/user/hungtd


«    »
Thứ 2
Thứ 3
Thứ 4
Thứ 5
Thứ 6
Thứ 7
CN
Ít
Nhiều

proudly powered by DMOJ| developed by LQDJudge team