This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <string> | |
#include <cmath> | |
#include <algorithm> | |
#include <map> | |
using namespace std; | |
bool contains(map<string, int> dic, int x) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <string> | |
#include <cmath> | |
#include <algorithm> | |
using namespace std; | |
bool is_valid(vector<int> numb) { | |
int sum = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string | |
scheme =["0", "10", "1100", "1101", "1110" ,"1111"] | |
str = "abcdef" | |
code = "" | |
inp_str = "abccdf" | |
for x in inp_str: | |
ind = str.find(x) | |
print(scheme[ind], end ="−") | |
code += scheme[ind] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <cmath> | |
using namespace std; | |
double calcHi(vector<double> P_i) { | |
double h_i = 0; | |
for (double i : P_i) { | |
if (i == 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <cmath> | |
using namespace std; | |
double calcHi(vector<double> P_i) { | |
double h_i = 0; | |
for (double i : P_i) { | |
if (i == 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Base { | |
public int x = 0; | |
} | |
class Child extends Base{ | |
public int x = 1; | |
} | |
public class Main | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class stack { | |
int *data; | |
int size; | |
int count = 0; | |
public: | |
stack(int _size) : size(_size) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
using namespace std; | |
class foo { | |
private: | |
int x; | |
public: | |
int y; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def myfunc1(): | |
x = "John" | |
def myfunc2(): | |
nonlocal x | |
x = "hello" | |
myfunc2() | |
return x | |
print(myfunc1()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
// массив указателей | |
int **x; | |
int n = 5, m = 4; | |
x = new int *[n]; |
NewerOlder