diff --git a/Algorithms/syntax.cpp b/Algorithms/syntax.cpp index bb0321d..a4f123c 100644 --- a/Algorithms/syntax.cpp +++ b/Algorithms/syntax.cpp @@ -8,7 +8,7 @@ cout << __builtin_ctz(x) << "\n"; // 4 zeroes at the end of the number cout << __builtin_popcount(x) << "\n"; // 5 ones cout << __builtin_parity(x) << "\n"; // 1 -//Append ll to the end for this to apply to long longs. +// Append ll to the end for this to apply to long longs. // Set operations: // a & b: intersection @@ -16,7 +16,7 @@ cout << __builtin_parity(x) << "\n"; // 1 // ~a: complement // a & (~b): difference -//ordered set +// ordered set #include using namespace __gnu_pbds; @@ -33,17 +33,17 @@ s.insert(9); auto x = s.find_by_order(2); cout << *x << "\n"; // 7 -//And the function order_of_key returns the position of a given element: +// And the function order_of_key returns the position of a given element: cout << s.order_of_key(7) << "\n"; // 2 -//If the element does not appear in the set, we get the position that the element -//would have in the set: +// If the element does not appear in the set, we get the position that the element +// would have in the set: cout << s.order_of_key(6) << "\n"; // 2 cout << s.order_of_key(8) << "\n"; // 3 -//Converting from int to string +// Converting from int to string int n = 1; string result; @@ -51,7 +51,7 @@ ostringstream oss; oss << n; result = oss.str(); -//string to int +// string to int string text = "456"; int num; @@ -60,19 +60,19 @@ if(!(iss >> num)) { num = 0; } -//Process words from a line (useful when the length of a line is not specified beforehand) +// Process words from a line (useful when the length of a line is not specified beforehand) string s; getline(cin, s); stringstream ss; ss << s; string s2; while(ss >> s2) { - //process s2 + // process s2 } -//randomization (source: https://codeforces.com/blog/entry/61587) +// randomization (source: https://codeforces.com/blog/entry/61587) mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); uniform_int_distribution<> distrib1(1, n); int x = big-get(distrib1(rng)); -//can change to mt19937_64 for long longs +// can change to mt19937_64 for long longs