| Lê Quang Lâm - TK33 | |
|
|
|
Tác giả | Thông điệp |
---|
Admin Admin
Tổng số bài gửi : 152 Join date : 23/04/2022 Age : 41 Đến từ : THPT Chuyên Nguyễn Tất Thành - Yên Bái
| Tiêu đề: Lê Quang Lâm - TK33 Mon Jul 25, 2022 3:15 pm | |
| Nơi nộp bài của Lê Quang Lâm | |
|
| |
lequanglamyb2007
Tổng số bài gửi : 304 Join date : 25/07/2022
| Tiêu đề: Re: Lê Quang Lâm - TK33 Mon Jul 25, 2022 3:19 pm | |
| d2b1 - Code:
-
#include <iostream> #include <math.h> #include <cstdio>
using namespace std;
float a, b, c, p, s;
int main() { cin >> a >> b >> c; p = a + b + c; s = sqrt((p / 2.0) * (p / 2.0 - a) * (p / 2.0 - b) * (p / 2.0 - c)); printf("%0.2f %0.2f", p, s); return 0; }
| |
|
| |
lequanglamyb2007
Tổng số bài gửi : 304 Join date : 25/07/2022
| Tiêu đề: Re: Lê Quang Lâm - TK33 Mon Jul 25, 2022 3:42 pm | |
| d2b2 - Code:
-
#include <iostream> #include <math.h> #include <cstdio>
using namespace std;
int xa, ya, xb, yb, xc, yc; float dab, dbc, dca;
float dodai(int xm, int ym, int xn, int yn) { float d = sqrt((xm - xn) * (xm - xn) + (ym - yn) * (ym - yn)); return d; }
int main() { cin >> xa >> ya >> xb >> yb >> xc >> yc; dab = dodai(xa, ya, xb, yb); dbc = dodai(xb, yb, xc, yc); dca = dodai(xc, yc, xa, ya); printf("%0.3f %0.3f %0.3f", dab, dbc, dca); return 0; }
| |
|
| |
lequanglamyb2007
Tổng số bài gửi : 304 Join date : 25/07/2022
| Tiêu đề: Re: Lê Quang Lâm - TK33 Mon Jul 25, 2022 4:02 pm | |
| d2b4 - Code:
-
#include <iostream>
using namespace std;
int a, b, x, y;
int main() { cin >> a >> b; y = (a - 2) * (b - 2); x = a * b - y; cout << x << " " << y; return 0; }
| |
|
| |
lequanglamyb2007
Tổng số bài gửi : 304 Join date : 25/07/2022
| Tiêu đề: Re: Lê Quang Lâm - TK33 Mon Jul 25, 2022 4:25 pm | |
| d2b5 - Code:
-
#include <iostream>
using namespace std;
int n; long long s;
int main() { cin >> n; s = n*1LL * (n + 1) / 2; cout << s << endl; return 0; }
| |
|
| |
lequanglamyb2007
Tổng số bài gửi : 304 Join date : 25/07/2022
| Tiêu đề: Re: Lê Quang Lâm - TK33 Mon Jul 25, 2022 4:25 pm | |
| d2b6 - Code:
-
#include <iostream>
using namespace std;
int n; long long s;
int main() { cin >> n; s = n*1LL * (n + 1) * (2 * n + 1) / 6; cout << s << endl; return 0; }
| |
|
| |
lequanglamyb2007
Tổng số bài gửi : 304 Join date : 25/07/2022
| Tiêu đề: Re: Lê Quang Lâm - TK33 Mon Jul 25, 2022 4:32 pm | |
| d2b7 - Code:
-
#include <iostream>
using namespace std;
int n; long long s;
int main() { cin >> n; s = 1LL *n * n; cout << s << endl; return 0; }
| |
|
| |
lequanglamyb2007
Tổng số bài gửi : 304 Join date : 25/07/2022
| Tiêu đề: Re: Lê Quang Lâm - TK33 Mon Jul 25, 2022 4:42 pm | |
| d2b8 - Code:
-
#include <iostream>
using namespace std;
int n; long long s;
int main() { cin >> n; s = 1LL * n * (n + 1) / 2; cout << s * s; return 0; }
| |
|
| |
lequanglamyb2007
Tổng số bài gửi : 304 Join date : 25/07/2022
| Tiêu đề: Re: Lê Quang Lâm - TK33 Mon Jul 25, 2022 4:53 pm | |
| d2b9 - Code:
-
#include <iostream>
using namespace std;
int n; long long s;
int main() { cin >> n; s = 1LL * n *n * (n + 1)* (n + 1)*(2*n*n+2*n-1)/ 12; cout << s; return 0; }
| |
|
| |
lequanglamyb2007
Tổng số bài gửi : 304 Join date : 25/07/2022
| Tiêu đề: Re: Lê Quang Lâm - TK33 Mon Jul 25, 2022 4:59 pm | |
| d2b10 - Code:
-
#include <iostream>
using namespace std;
int n; long long s;
int main() { cin >> n; s = 1LL * n * (n + 1) * (n + 2) / 3; cout << s; return 0; }
| |
|
| |
lequanglamyb2007
Tổng số bài gửi : 304 Join date : 25/07/2022
| Tiêu đề: Re: Lê Quang Lâm - TK33 Mon Jul 25, 2022 5:03 pm | |
| d2b11 - Code:
-
#include <iostream>
using namespace std;
int n; float s;
int main() { cin >> n; s = (n - 1.0f) / n; cout << s; return 0; }
| |
|
| |
lequanglamyb2007
Tổng số bài gửi : 304 Join date : 25/07/2022
| Tiêu đề: Re: Lê Quang Lâm - TK33 Mon Jul 25, 2022 5:14 pm | |
| d2b12 - Code:
-
#include <iostream>
using namespace std;
int n; float s;
int main() { cin >> n; s = 1.0 * n * (n + 3) / (4.0 * (n + 1) * (n + 2)); cout << s; return 0; }
| |
|
| |
lequanglamyb2007
Tổng số bài gửi : 304 Join date : 25/07/2022
| Tiêu đề: Re: Lê Quang Lâm - TK33 Mon Jul 25, 2022 5:20 pm | |
| d2b13 - Code:
-
#include <iostream>
using namespace std;
int n; float s;
int main() { cin >> n; s = 1.0f * n * (n + 2.0f) / ((n + 1.0f) * (n + 1.0f)); cout << s; return 0; }
| |
|
| |
lequanglamyb2007
Tổng số bài gửi : 304 Join date : 25/07/2022
| Tiêu đề: Re: Lê Quang Lâm - TK33 Mon Jul 25, 2022 5:31 pm | |
| d2b14 - Code:
-
#include <iostream> #include <math.h>
using namespace std;
int n; int p; long long s;
int main() { cin >> n >> p; s = ((long long) pow(p, n + 1) - 1) / (p - 1); cout << s; return 0; }
| |
|
| |
lequanglamyb2007
Tổng số bài gửi : 304 Join date : 25/07/2022
| Tiêu đề: Re: Lê Quang Lâm - TK33 Mon Jul 25, 2022 5:38 pm | |
| d2b15 - Code:
-
#include <iostream> #include <math.h>
using namespace std; int n, p; long long s;
int main() { cin >> n >> p; s = ((n + 1) * (long long) pow(p, n + 1)) / (p - 1) - ((long long) pow(p, n + 1) - 1) / ((p - 1) * (p - 1)); cout << s; return 0; }
| |
|
| |
lequanglamyb2007
Tổng số bài gửi : 304 Join date : 25/07/2022
| Tiêu đề: Re: Lê Quang Lâm - TK33 Wed Jul 27, 2022 9:00 am | |
| d3b1 - Code:
-
#include <iostream>
using namespace std;
int n;
int main() { cin >> n; if (n % 2 == 0) { cout << "n is even"; } else { cout << "n is odd"; } return 0; }
| |
|
| |
lequanglamyb2007
Tổng số bài gửi : 304 Join date : 25/07/2022
| Tiêu đề: Re: Lê Quang Lâm - TK33 Wed Jul 27, 2022 9:01 am | |
| d3b2 - Code:
-
#include <iostream>
using namespace std;
int n;
int main() { cin >> n; if ((n % 3 == 0) && (n % 5 != 0)) { cout << "true"; } else { cout << "false"; } return 0; }
| |
|
| |
lequanglamyb2007
Tổng số bài gửi : 304 Join date : 25/07/2022
| Tiêu đề: Re: Lê Quang Lâm - TK33 Wed Jul 27, 2022 9:02 am | |
| d3b3 - Code:
-
#include <iostream>
using namespace std;
int a, b;
int main() { cin >> a >> b; if (a > b) { cout << a; } else { cout << b; } return 0; }
| |
|
| |
lequanglamyb2007
Tổng số bài gửi : 304 Join date : 25/07/2022
| Tiêu đề: Re: Lê Quang Lâm - TK33 Wed Jul 27, 2022 9:02 am | |
| d3b4 - Code:
-
#include <iostream>
using namespace std;
int a, b, c, rmin;
int main() { cin >> a >> b >> c; rmin = a; if (rmin > b) { rmin = b; } if (rmin > c) { rmin = c; } cout << rmin; return 0; }
| |
|
| |
lequanglamyb2007
Tổng số bài gửi : 304 Join date : 25/07/2022
| Tiêu đề: Re: Lê Quang Lâm - TK33 Wed Jul 27, 2022 9:22 am | |
| d3b5 - Code:
-
#include <iostream>
using namespace std;
int a, b, c, ab, bc, ac, rmax;
int main() { cin >> a >> b >> c; ab = a + b; bc = b + c; ac = c + a; rmax = ab; if (rmax < bc) { rmax = bc; } if (rmax < ac) { rmax = ac; } cout << rmax; return 0; }
| |
|
| |
lequanglamyb2007
Tổng số bài gửi : 304 Join date : 25/07/2022
| Tiêu đề: Re: Lê Quang Lâm - TK33 Wed Jul 27, 2022 9:22 am | |
| d3b6 - Code:
-
#include <iostream>
using namespace std;
int a, b, ab, ba, rmax;
int main() { cin >> a >> b; ab = a * 10 + b; ba = b * 10 + a; rmax = ab; if (rmax < ba) { rmax = ba; } cout << rmax; return 0; }
| |
|
| |
lequanglamyb2007
Tổng số bài gửi : 304 Join date : 25/07/2022
| Tiêu đề: Re: Lê Quang Lâm - TK33 Wed Jul 27, 2022 9:34 am | |
| d3b7 - Code:
-
#include <iostream> #include <cstdio>
using namespace std;
int a, b; float x;
int main() { cin >> a >> b; if (a == 0) { if (b == 0) { printf("infinitely many solutions"); } else { printf("no solution"); } } else { x = -1.0f * b / a; printf("%0.2f", x); } return 0; }
| |
|
| |
lequanglamyb2007
Tổng số bài gửi : 304 Join date : 25/07/2022
| Tiêu đề: Re: Lê Quang Lâm - TK33 Wed Jul 27, 2022 9:54 am | |
| d3b8 - Code:
-
#include <iostream> #include <math.h> #include <cstdio>
using namespace std;
int a, b, c; float d, xa, xb;
int main() { cin >> a >> b >> c; d = 1.0f * b * b - 4.0f * a * c; if (d < 0) { printf("no solution"); } else if (d == 0) { printf("x1 = x2 = %0.3f", -1.0 * b / (2.0 * a)); } else { xa = (-1.0 * b + sqrt(d)) / (2.0 * a); xb = (-1.0 * b / a) - xa; printf("x1 = %0.3f, x2 = %0.3f", xa, xb); } return 0; }
| |
|
| |
lequanglamyb2007
Tổng số bài gửi : 304 Join date : 25/07/2022
| Tiêu đề: Re: Lê Quang Lâm - TK33 Wed Jul 27, 2022 10:09 am | |
| d3b9 - Code:
-
#include <iostream> #include <cstdio> #include <math.h>
using namespace std;
int a, b, c; float p, s;
int main() { cin >> a >> b >> c; if (a + b <= c || b + c <= a || c + a <= b) { printf("not a triangle"); } else { p = (a + b + c) / 2.0; s = sqrt(p * (p - a) * (p - b) * (p - c)); printf("%0.3f", s); } return 0; }
| |
|
| |
lequanglamyb2007
Tổng số bài gửi : 304 Join date : 25/07/2022
| Tiêu đề: Re: Lê Quang Lâm - TK33 Wed Jul 27, 2022 10:29 am | |
| d3b10 - Code:
-
#include <iostream> #include <math.h>
using namespace std;
int m_x, m_y, i_x, i_y, r; float dist_i_m;
int main() { cin >> m_x >> m_y >> i_x >> i_y >> r; dist_i_m = sqrt((m_x - i_x)*(m_x - i_x) + (m_y - i_y)*(m_y - i_y)); if (dist_i_m < r) { cout << "M is inside the circle"; } else if (dist_i_m == r) { cout << "M is on the circle"; } else { cout << "M is outside the circle"; } return 0; }
| |
|
| |
Sponsored content
| Tiêu đề: Re: Lê Quang Lâm - TK33 | |
| |
|
| |
| Lê Quang Lâm - TK33 | |
|