Skip to content

Instantly share code, notes, and snippets.

View TechacademyCode's full-sized avatar

Techacademy Code TechacademyCode

View GitHub Profile
def is_prime(num):
if num < 2:
return False
for i in range(2, int(num**0.5) + 1):
if num % i == 0:
return False
return True
def isPrime(n):
if n < 2:
return False
for i in range(2, int(n**0.5) + 1):
if n % i == 0:
return False
return True
def beautifulNumber(n):
if n < 2:
n, k = map(int, input().split())
x = 2
cnt = 0
while n != 1:
if n % x == 0:
n = n // x
cnt += 1
if cnt == k:
print(x)
n, k = map(int, input().split())
x = 2
cnt = 0
while n != 1:
if n % x == 0:
n = n // x
cnt += 1
if cnt == k:
print(x)
#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int a[N];
int gcd(int a, int b)
{
while (a != 0 && b != 0)
{
if (a > b)
#include <bits/stdc++.h>
using namespace std;
long long M = 1000000007;
int main() {
int N;
cin >> N;
long long A[1000005];
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int A[1000000];
for (int i = 0; i < N; i++) {
cin >> A[i];
#include <bits/stdc++.h>
using namespace std;
int main() {
int x, y; // khai bao 2 bien x, y
cin >> x >> y; // nhap 2 bien x, y
cout << y / x << endl;
cout << fixed << setprecision(2) << (float)y / x << endl; // in do chinh xac 2 so dang sau dau phay
return 0;
#include <bits/stdc++.h>
using namespace std;
const int N = 2000;
int arr[N];
int getSum(int x)
{
int sum = 0;
for (int i = 0; i <= x; i++)
{
#include <bits/stdc++.h>
using namespace std;
const int N = 2000;
int arr[N];
int h[N] = {0};
int main() {
// 1 1 2 2 3
int n; cin >> n;
for (int i = 0; i < n; i++)