Skip to content

Instantly share code, notes, and snippets.

View lectricas's full-sized avatar

alexey polusov lectricas

  • Saint-Petersburg
View GitHub Profile
@lectricas
lectricas / DataItem.kt
Last active October 18, 2018 08:09
Simple spinner, but based on EditText
// sample data item, you can make your own
data class DataItem(
private val title: String,
private val id: Int
): EditTextSpinner.PopItem {
override fun getTitle() = title
override fun getId() = id
}
//
// Created by lectr on 10.03.2021.
//
#include <iostream>
#include <vector>
void sort(std::vector<int> &arr, int n) {
bool isSorted = true;
for (int j = 0; j < n - 1; j++) {
if (arr[j] > arr[j + 1]) {
#include <vector>
#include <iostream>
int main() {
int n, m;
std::cin >> n;
std::cin >> m;
std::vector<int> nv(n);
std::vector<int> mv(m);
for (int i = 0; i < n; i++) {
int main() {
std::string st1, st2;
getline(std::cin, st1);
getline(std::cin, st2);
std::unordered_map<char, char> map;
if (st1.length() != st2.length()) {
std::cout << "NO";
return 0;
#include <iostream>
//
// Created by lectr on 24.03.2021.
//
#include <unordered_map>
#include <string>
int main() {
int n;
#include <string>
#include <array>
#include <iostream>
#include <unordered_map>
#include <cassert>
#include <sstream>
using namespace std;
#include <string>
#include <iostream>
#include <sstream>
#include <cmath>
#include <vector>
using namespace std;
#define p 10
#define s 2654435769
void print_range(Node *root, int L, int R) {
if (root == nullptr) {
return;
}
print_range(root->left, L, R);
if (root->value <= R && root->value >= L) {
cout << root->value << "\n";
}
print_range(root->right, L, R);
//
// Created by apolyusov on 19.04.2021.
//
#include "solution.h"
Node *my_method(Node *root) {
if (root->right == nullptr) {
return root;
}
#include <iostream>
#include <vector>
using namespace std;
int main() {
int vertex_count;
cin >> vertex_count;
vector<vector<char>> matrix(vertex_count, vector<char>(vertex_count));
for (int i = 0; i < vertex_count; i++) {