• 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ý

leophat299

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

Rating
-
Bài tập
6
Điểm
1553
Rating #
-
Điểm #
18816

Giới thiệu

include <bits/stdc++.h>

using namespace std;
bool kt (int n)
{
int x=sqrt(n) ;
if (xx==n)
return true ;
return false ;
}
int main()
{
int n ; cin >> n ;
int k ; cin >> k ;
long long dem=0 ;
if (k==1)
{
for (int i=4;i<=n;i++)
if (kt(i)==true)
dem++ ;
}
if (k==2)
{
for (int i=2;i<=n/2;i++)
for (int j=8;j<=n;j++) {
if (kt(i
j)==true)
dem++ ;
}
}
if (k==3)
{
for (int i=2;i<=n/2;i++)
{
for (int j=3;j<=n-2;j++)
{
for (int k=6;k<=n;k++)
if (kt(ijk)==true)
dem++ ;
}
}
}
cout << dem ;
return 0;
}


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

proudly powered by DMOJ| developed by LQDJudge team