Skip to content

Instantly share code, notes, and snippets.

View TechacademyCode's full-sized avatar

Techacademy Code TechacademyCode

View GitHub Profile
n, k = map(int, input().split())
arr = list()
h = [0] * 10
cnt = 0
for i in range(n):
x = int(input())
y = x - k
cnt += h[y]
h[x] += 1
s = input().strip()
h = [0] * 26
for ch in s:
h[ord(ch) - ord('a')] += 1
print(*h)
n = int(input())
arr = list(map(int, input().split()))
left = 0 # vi tri dau
right = n-1
flag = True
while left < right:
if arr[left] != arr[right]:
flag = False
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, k;
cin >> n >> k;
int a[n];
#include <bits/stdc++.h>
using namespace std;
int main() {
string str;
cin >> str;
// abc -> abccba
// abcd -> abcddcba
for (int i = 0; i < str.length(); i++)
#include <bits/stdc++.h>
using namespace std;
int main() {
string str;
cin >> str;
for (int i = 0; i < str.length(); i++)
{
cout << str[i];
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
string str;
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
string s;
cin >> s;
int n = s.length();
int left = 0, right = n-1;
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
// "nguyen thi kim anh"
// chữ cái đầu tiên luôn luôn viết hóa
// sau dấu cách thì luôn luôn viết hoa
# hàm
#Liệt kê những số là số nguyên tố nhỏ hơn N và có tổng các chữ số của nó là một số trong dãy số Fibonacci.
import math
def isFibonacci(n):
# pass
x1 = 1
x2 = 1
while x2 < n:
temp = x1
x1 = x2