uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
24969ba3-c3e1-4caf-920b-760c223060b2
Niito15/Ejercicios-Algoritmica-II
09-04/Ejercicio 3.cpp
/* 3) Ingresar tantos números como se desee hasta un número ingresado previamente. Indicar cuantos números fueron ingresados y el promedio de los pares e impares encontrados. Observación: calcular el promedio”, el promedio es simplemente una sumatoria de todos los elementos involucrados dividido la cantidad de element...
ALGO
0.988426
3.635878
c249bbb5-77de-439c-a378-021adbd8376a
sakshidabral/Leetcode
2707-merge-two-2d-arrays-by-summing-values/2707-merge-two-2d-arrays-by-summing-values.cpp
class Solution { public: vector<vector<int>> mergeArrays(vector<vector<int>>& n1, vector<vector<int>>& n2) { vector<vector<int>> ans; int i=0, j=0; while(i < n1.size() || j < n2.size()) { if(i < n1.size() && j < n2.size() && n1[i][0]==n2[j][0]) { ans.push_back({n...
ALGO
0.999968
5.855972
5cf15270-3472-4471-91b1-e83ec94b0c35
dangduongcoder/PTIT-Code
c++/CPP0101.cpp
//Duong #include <bits/stdc++.h> using namespace std; typedef long long ll; #define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); const int MOD = 1e9 + 7; const ll INF = 1e18; void solve() { ll s; cin >> s; // ll s = 0; cout << s*(s+1)/2 << endl; } int main() { fastio; int te...
ALGO
0.999652
5.339345
223ead10-6e3f-4f85-800f-91592a6b54d2
PaablooCH/ChironDX
Source/DirectXTex/DirectXTexMisc.cpp
#include "DirectXTexP.h" using namespace DirectX; using namespace DirectX::Internal; #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wignored-attributes" #endif namespace { const XMVECTORF32 g_Gamma22 = { { { 2.2f, 2.2f, 2.2f, 1.f } } }; //---------------------------------------...
TOOL
0.942085
6.908776
6ed8ea4f-1b73-46e3-b524-f7eb2e31d832
bm-mit/Codeforces
1729A_TwoElevators.cpp
//* 205934146 00:03:41 Minh4893IT A - Two Elevators GNU C++14 Accepted 46 ms 0 KB #include <bits/stdc++.h> using namespace std; #define int long long #define ss stringstream #define uset unordered_set #define umap unordered_map #define mmap multimap #define mset multiset #define pq priority_queue #define endl "\n" #...
ALGO
0.999918
5.006385
ad158be7-724e-437d-a21a-01add04ac18c
SiddharthVerma2206/LeetCode
Trees/BTLevelOrderTraversel.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.99994
6.020734
46800a39-dfaa-472a-9db3-59cfee24b680
matt-chan/numopt
src/DavidsonSolver.cpp
#include <chrono> namespace numopt { namespace eigenproblem { /* * CONSTRUCTORS */ /** * @param matrixVectorProduct a vector function that returns the matrix-vector product (i.e. the matrix-vector product representation of the matrix) * @param diagonal the diagonal of the matrix ...
ALGO
0.998797
7.371603
d3fd33bf-f64b-4bee-a332-08d1b994482a
Bitwise-AR/Placement-Series
Binary Trees/Vertical Order Traversal of a Binary Tree/dfs_multiset.cpp
class Solution { public: map<int, map<int, multiset<int>>> mp; void solve(TreeNode* root, int col, int row) { if(root == NULL) return; mp[col][row].insert(root->val); solve(root->left, col-1, row+1); solve(root->right, col+...
ALGO
0.999997
6.080809
635bf777-2e23-4461-ba49-c0eaeb5d7c10
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_5633_2.cpp
#include <bits/stdc++.h> using namespace std; int n; char s[30]; long long f[21][4]; long long gao(int x, int tot, bool lim) { if (x > n) return 1; if (~f[x][tot] && !lim) return f[x][tot]; long long res = 0; int up = lim ? s[x] : 9; if (tot == 3) up = 0; for (int i = 0; i <= up; ++i) res += gao(x + 1, ...
ALGO
0.999153
4.949882
f3c6fe1d-fc7a-4b94-9ded-dd3baada337e
masumapps/myapp
nativeLibs/mupdf/thirdparty/tesseract/src/ccmain/resultiterator.cpp
#include <tesseract/resultiterator.h> #include "pageres.h" #include "tesseractclass.h" #include "unicharset.h" #include <allheaders.h> #include <set> #include <vector> static const char *const kLRM = "\u200E"; // Left-to-Right Mark static const char *const kRLM = "\u200F"; // Right-to-Left Mark namespace tesseract...
ALGO
0.875808
7.187228
a5b94f49-be26-4c69-891e-8b93622ad68c
wangtongxue-369/xcpc_Code_file
file/vjudge/2025spring_practice/2.1_data/AB.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define INF 0x3f3f3f3f #define PII pair<ll, ll> const ll mod = 1e9 + 7; const ll MAXN = 500005; const ll base1 = 131; const ll base2 = 127; ll _ = 1, n, m, ans = 0, a[MAXN], b[MAXN]; void solve() { cin >> n; for (i...
ALGO
0.999995
3.673125
7628b976-1f42-4663-bd43-14ec1532b6d0
0x1Shub/Data-Structures-And-Algorithms
Neetcode/Interview 150/Two Pointer/02_Two_Sum_II.cpp
// Valid Palindrome #include<iostream> #include <string> #include <algorithm> #include <vector> #include <unordered_map> using namespace std; class Solution { public: vector<int> twoSum(vector<int>& numbers, int target) { if(numbers.size() == 0){ return {0}; } ...
ALGO
0.999954
5.664127
6a0d9e81-371c-4be1-bc46-f3695f9c2cfe
maopu2001/Codeforces
1844A.cpp
#include <bits/stdc++.h> using namespace std; #define nl endl typedef long long ll; const int MOD = 1e9 + 7; void solve(int T) { int a, b; cin >> a >> b; if (a >= 2) cout << 1 << nl; else if (a = 1 && b >= 3) cout << 2 << nl; else cout << 3 << nl; } int main() { // cout << setprecision(2) << ...
ALGO
0.999613
4.54304
0cc0386e-512f-4d56-ba5a-0ad2e04a8270
iamslash/learntocode
leetcode/LongestIncreasingSubsequence/20201228.a.cpp
#include <cstdio> #include <vector> // i // A: 6 1 5 3 4 // ans: 1 3 4 // 0ms 100.00% 6.4MB 100.00% // LIS // O(NlgN) O(N) class Solution { public: int lengthOfLIS(const std::vector<int> &A) { std::vector<int> ans; for (int i = 0; i < A.size(); i++) { auto it = std::lower_bound(ans.beg...
ALGO
0.999967
5.280274
efd2bfb4-34b8-4dde-a31a-3bf46774933d
legendgoddess/Coding-Box
luogu/lg-p6292.cpp
#include <bits/stdc++.h> /* * @ legendgod * ʹǰ·޵ԨȥҲǰ */ using namespace std; //#define Fread //#define Getmod #ifdef Fread char buf[1 << 21], *iS, *iT; #define gc() (iS == iT ? (iT = (iS = buf) + fread (buf, 1, 1 << 21, stdin), (iS == iT ? EOF : *iS ++)) : *iS ++) #endif // Fread template <typename T> void r1(T &x) ...
ALGO
0.999963
4.040389
9a55de58-85dc-4989-aa5f-284d279e70e2
BigSecret1/leetcode
2024/Jul/Step-By-Step Directions From a Binary Tree Node to Another.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), ...
ALGO
0.999979
6.121444
6c28f588-b7f6-4e04-82d1-d40efb1b5e71
Dylan-Watson/FRC2019
src/Simulation/RobotLibraries/Common/PIDController.cpp
#include <math.h> #include <queue> #include <assert.h> #include "../Base/Base_Includes.h" #include "../Base/Misc.h" //needed to define the declspec and IsZero #include "PIDController.h" /***********************************************************************************************************/ /* Laten...
ALGO
0.948751
5.506904
b9841be4-23ab-4717-b5d6-385627ae1d53
RakibLiar/LeetCode
3010-divide-an-array-into-subarrays-with-minimum-cost-i/3010-divide-an-array-into-subarrays-with-minimum-cost-i.cpp
class Solution { public: int minimumCost(vector<int>& nums) { int min1 = INT_MAX, min2 = INT_MAX; for(int i=1; i<nums.size(); i++) { if(nums[i] < min1) { min2 = min1; min1 = nums[i]; } else if(nums[i] < min2) { min2 = nums[i]; ...
ALGO
0.99995
5.416194
0d5302e8-61ac-47a8-9209-1e39d2cb0b02
AbhishekSaini102/CPP-Programming-Language-
Dsa_Practice/04_MergeShort.cpp
// #include <iostream> // #include <vector> // using namespace std; // void merge(vector<int> &nums, int left, int mid, int right) // { // int t1 = mid - left + 1; // int t2 = right - mid; // int arr1[t1]; // int arr2[t1]; // for (int i = 0; i < t1; i++) // { // arr1[i] = nums[left ...
ALGO
0.999998
5.706357
1412f48c-88eb-4c7d-8979-443717433bd0
senixbeatz/zadachi_kp
200.cpp
//Задание 20, 5 урок #include <iostream> #include <vector> #include <cmath> using namespace std; double computeA(vector<double> x, vector<double> y) { double sumX = 0.0, sumY = 0.0, sumXY = 0.0, sumXX = 0.0; int n = x.size(); for (int i = 0; i < n; ++i) { sumX += x[i]; sumY += y[i]; ...
ALGO
0.995593
4.717421
1e930412-1ca6-4401-abaf-70adcfdfd2c7
yogasrivarshan/Codeforces-Solutions
697a.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long int #define pb push_back #define mod 1000000007 #define mp make_pair // for(i=0;i<n;i++) // for(auto it = m.begin();it!=m.end();it++) bool isPowerOfTwo(ll n) { if (n == 0) return 0; while (n != 1) { if (n%2 != 0) ...
ALGO
0.999605
5.127399
b2622843-5e32-4ec0-a528-0e5f30cd9f4a
pdusan/pap2023
a1/main.cpp
#include <iostream> #include <chrono> #include <functional> #include "helpers.hpp" #include "implementation.hpp" int main(int argc, char **argv) { bool print_runtime_only = false; int exec_mode = 0; // 0. all, 1 sequential only, 2. taskloop only, 3. explicit tasks only int grain_size = 1; // optional param...
ALGO
0.997166
5.820335
087bfac2-cd75-4e76-8834-0140e8e9063d
akash4102/Data-Structures-And-Algorithm
prim'salgo.cpp
#include "bits/stdc++.h" using namespace std; int main(){ int n,m; cin>>n>>m; vector<pair<int,int>>adj[n]; int a,b,wt; for(int i=0;i<m;i++){ cin>>a>>b>>wt; adj[a].push_back({b,wt}); adj[b].push_back({a,wt}); } int parent[n]; int key[n]; bool mstSet[n]; fo...
ALGO
0.999996
4.35023
70427622-174f-483c-9708-a322a9172cb0
Afaque47/DSA
linear-search/main.cpp
#include <iostream> #include <cmath> #include <climits> using namespace std; bool fun(int ar[], int n,int key){ for(int i=0;i<n;i++) { if(ar[i]==key) { return 1; } } return 0; } int main(){ int key; int arr[16]={2,3,15,45,1...
ALGO
0.998967
4.011091
b0a41d51-2cbf-47bc-87d9-a9d7398efc43
ishandutta2007/codeforces
klimoza/normal/862/B.cpp
#include <iostream> #include <vector> #include <string> #include <map> #include <set> #include <cmath> #include <algorithm> #include <deque> #include <cassert> #include <math.h> #include <random> using namespace std; #define PI 3.14159265 typedef long long ll; const ll INF = 4 * 1e18; const int INFi = 2 * 1e9; ll mo...
ALGO
0.999948
4.216444
a06eadba-c5db-406e-a299-76393aa5654a
Nikhil-251/Code
496-next-greater-element-i/496-next-greater-element-i.cpp
class Solution { public: vector<int> nextgreatestright(vector<int>nums){ stack<int>st; vector<int>ans(nums.size()); for(int i=nums.size()-1;i>=0;i--){ while(st.size() > 0 && st.top()<nums[i]){ st.pop(); } ans[i] = st.size()>0?st.top():-1; ...
ALGO
0.999978
5.839072
63ac3d5f-db24-4e8c-aaad-e5811e59b48a
DrZhang818/my-first-project
Problems/Codeforces/ProblemSet/Constructive/CF1582D.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef double db; typedef pair<int,int> PII; typedef unsigned long long ull; const int inf = 1000000000; void solve() { int n; cin >> n; vector<int> a(n + 1); for(int i = 1; i <= n; i++) { cin >> a[i]; } if(n & 1) { ...
ALGO
0.999567
3.387082
47ba3010-79d6-4a19-ac3f-67b4b4fbb8fd
raincross7/code-similarity
codes/train_code/problem375/problem375_389.cpp
#include<iostream> #include<vector> #include<algorithm> #include<functional> using namespace std; int main() { vector<int> data; for(int i=0;i<10;i++) { int input; cin>>input; data.push_back(input); } sort(data.begin(),data.end(),greater<int>()); for(int i=0;i<3;i++) { cout<<data[i]...
ALGO
0.999269
3.608835
8b8c493b-ce5f-4dca-9c6e-bc20d57ff8e8
createandchoose/lab_2
LAB_3/a-5.cpp
#include <iostream> int main() { unsigned int n; std::cout << "Введите натуральное число n: "; std::cin >> n; int maxDigit = 0; int minDigit = 9; unsigned int temp = n; while (temp > 0) { int digit = temp % 10; maxDigit = std::max(maxDigit, digit); minDigit = std::m...
ALGO
0.997652
6.308451
3c3228d7-cda0-4a14-b3df-d239809795e7
IBHMM/C-Projects
linked list/sel_sort.cpp
#include <iostream> #include <cmath> #include <string> using namespace std; class Node { public: long long int value; Node* next; }; Node* take_values(Node** start) { Node* temp_start = *start; string value; do { cout << "Enter the value : "; cin >> value; if ...
ALGO
0.999099
4.756883
91f365b0-0906-4d20-b24c-4fe5d38b9e9e
rehanraja1/DSA
Binary Trees/Symmetrical Binary Trees/solution.cpp
#include <bits/stdc++.h> using namespace std; /* class Node { public: int data; Node* left; Node* right; Node(int data) : data(data), left(nullptr), right(nullptr) {} }; */ bool check(Node* node1,Node* node2){ if(node1==nullptr && node2==nullptr) return true; if(node1==nullptr && node2!=nullptr) ret...
ALGO
0.999997
5.989633
67bdc3ed-27a4-4b12-80ad-98dae73d5b40
PrabhuprasadSahoo/cp
A_Game_With_Sticks.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define fr(i,a,b,k) for(int i=a;i<b;i+=k) #define frrev(i,a,b,k) for(int i=a;i>b;i-=k) int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n,m; cin>>n>>m; if(min(n,m)%2==0) cout<<"Malvika"; else cout<<"Aksh...
ALGO
0.999935
3.358009
b6f36380-d6ba-4078-a543-634c601b08ee
ishandutta2007/codeforces
mhq/normal/1146/C.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); //freopen("input.txt", "r", stdin); int tst; cin >> tst; while (tst--) { int n; cin >> n; int mx = 0; for (i...
ALGO
0.999213
3.546231
e452c52d-cc0a-4029-a078-28187ac2ab11
mumumu6/kyopro
atcoder/abc/abc368/d2.cpp
#include <bits/stdc++.h> using namespace std; #include <atcoder/all> using namespace atcoder; using mint = modint998244353; using ll = long long; #define rep(i, n) for (ll i = 0; i < (n); i++) #define reps(i, a, b) for (ll i = (a); i < (b); i++) bool chmin(auto &a, auto b) { return a > b ? a = b, 1 : 0; } bool chmax(...
ALGO
0.999893
4.72083
4473bb1c-5de4-476b-bcc4-d34d01c19b71
ong-wei-hong/coding-problems
online-judge/11136/main.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define ii pair<int, int> #define vi vector<int> #define vll vector<long long> #define vii vector<pair<int, int>> #define pq priority_queue #define forn(i, n) for(int i=0; i<int(n); ++i) #define all(a) a.begin(),a.end() #define rall(a) a.rbegin(),a.ren...
ALGO
0.997479
3.82059
c01cf321-74c1-4d7d-a3cf-87cad125c8a7
shreejitverma/SDE-Interview-Prep
LeetCode/C++/minimum-height-trees.cpp
// Time: O(n) // Space: O(n) class Solution { public: vector<int> findMinHeightTrees(int n, vector<pair<int, int>>& edges) { if (n == 1) { return {0}; } unordered_map<int, unordered_set<int>> neighbors; for (const auto& e : edges) { int u, v; ti...
ALGO
0.99999
6.459302
afba6f73-6442-4a8f-9c1c-98851773ce89
Divigroup-RAP/PYTORCH
torch/csrc/jit/tensorexpr/operators/reduction.cpp
#include <torch/csrc/jit/tensorexpr/operators/reduction.h> using namespace torch::jit::tensorexpr; // Remove all indices from axes positions. static std::vector<VarHandle> squeezeIndices( const ParameterList& indices, const std::vector<size_t>& axes) { std::vector<VarHandle> indices_squeezed; for (size_t ...
TOOL
0.985096
7.252403
553c78df-d336-4f04-abe5-297215681487
brock-eng/C-Hash-Table
main.cpp
#include "hash_table.h" #include <stdio.h> #include "prime.h" inline void sprint(const char* string) { if (!string) { printf("Null"); printf("\n"); return; } printf(string); printf("\n"); } int main() { htHashTable* ht = htAPICreate(); htAPIInsert(ht, "10 + 10 =", "20"); ...
ALGO
0.971729
4.077737
d5c8dc3d-6b4f-4d43-be07-4d8ef9f3f719
kimjouny/Algorithm-Training
SWEA/[C++]오! 나의 여신님.cpp
#include <iostream> #include <queue> #define MAX 51 using namespace std; int T,N,M; char mp[MAX][MAX]; int dist[MAX][MAX]; int dy[4] = {1,0,-1,0}; int dx[4] = {0,1,0,-1}; queue < pair<int, int>> suyeon; queue < pair<int, int>> devil; bool arrived; int answer; void devilExpand() { int ds=devil.size(); while (ds--) {...
ALGO
0.99984
3.569505
d614546d-0151-4c97-87e2-4bb0d047b2e1
Sujitmaurya123/Algorithms
Recursion/fibo.cpp
#include<bits/stdc++.h> using namespace std; int fib(int n) { if (n <= 1) // base case return 1; return fib(n - 1) + fib(n - 2); // recurrence relation } int main(){ int ans=fib(6); cout<<ans<<endl; }
ALGO
0.999766
4.252641
f2546289-35c9-4fbf-9afd-4c314bd0f26c
STabaresG/parcial3
hiperbolica.cpp
#include "hiperbolica.h" //Implementacion //Constructor Hiperbolica::Hiperbolica(double x_max, double t_max, double alpha, int m1, int N1, double (*f) (double x1), double (*g) (double x2)) { l = x_max; //Longitud intervalo T = t_max; //Tiempo intervalo m = m1; //Cantidad divisiones intervalo l N = N1; ...
ALGO
0.999881
3.781602
76075300-793a-4856-955d-51e011e95eb4
pamellaccar/gromacs_with_packmol
install/gromacs-2022.1/src/gromacs/math/neldermead.cpp
/*! \internal \file * * \brief Implements routines in neldermead.h . * * \author Christian Blau <<EMAIL>> */ #include "gmxpre.h" #include "neldermead.h" #include <algorithm> #include <list> #include <numeric> #include <vector> #include "gromacs/math/utilities.h" #include "gromacs/utility/arrayref.h" #include "...
ALGO
0.999991
6.37758
508f977b-56ec-42e9-9fcf-14ba83b90bde
sarvex/leetcode-assembly
lcp/LCP 61. 气温变化趋势/Solution.cpp
class Solution { public: int temperatureTrend(vector<int>& temperatureA, vector<int>& temperatureB) { int ans = 0, f = 0; for (int i = 0; i < temperatureA.size() - 1; ++i) { int x = temperatureA[i + 1] - temperatureA[i]; int y = temperatureB[i + 1] - temperatureB[i]; ...
ALGO
0.999968
5.847486
81db3f49-2bb7-40cb-a626-e6bc76d76a7e
skylab-kulubu/Algorithms-and-Data-Structures
Cpp Subject/Project/The game of Pig/pig_sena_ery.cpp
#include<iostream> #include<cstdlib> #include<chrono> #include<thread> using namespace std; int humanTurn(int humanTotalScore); int computerTurn(int computerTotalScore); int main(int argc, char const *argv[]) { srand(time(0)); int hScore=0,cScore=0,ghScore=0,gcScore=0; cout<<"----------------Welcome PIG ...
ALGO
0.991019
3.844514
b36152b4-3b18-4a89-b3cb-b66fc9f26b45
MrNikhillyadav/Data-Structure_Algorithms
DSA-basics-c++/linkedlist-2/program.cpp
#include <iostream> using namespace std; class ListNode { public : int data; ListNode* next; ListNode(int data){ this->data = data; this -> next = NULL; } }; void printLinkedList(ListNode* head) { ListNode* temp = head; while (temp != nullptr) { ...
ALGO
0.999953
5.379564
2dca4ed0-35a3-4167-9cb2-2bbdfabd1985
bruteforceworker/testko4
src/key.cpp
#include <map> #include <openssl/ecdsa.h> #include <openssl/obj_mac.h> #include "key.h" // Generate a private key from just the secret parameter int EC_KEY_regenerate_key(EC_KEY *eckey, BIGNUM *priv_key) { int ok = 0; BN_CTX *ctx = NULL; EC_POINT *pub_key = NULL; if (!eckey) return 0; const EC_...
TOOL
0.959335
7.315616
805b3966-ac84-4be8-b530-a3f9213bf4b0
LokaTrack/mobile-development
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998733
6.76775
56f4325c-9f20-4bfa-bcf0-7f834460e86e
Ksawery4567/klasa_1D_Kamil-2023-2024_programista
InstructionIfConsoleApplication1.cpp/InstructionIfConsoleApplication1/Matura2022CzerwiecConsoleApplication/Matura2022CzerwiecConsoleApplication/Matura2022czerwiec.cpp
#include <iostream> #include <fstream> #include <vector> #include <algorithm> #include <map> using namespace std; int reverseNumber(int n) { int reversed = 0; while (n > 0) { reversed = reversed * 10 + n % 10; n /= 10; } return reversed; } int main() { vector<int> numbers; ifs...
ALGO
0.998119
3.041992
15e615e4-a107-432e-822c-f032dd54bbdf
ujjwalkushwaha2001/tree
tree/PrintNodeToPath.cpp
#include <bits/stdc++.h> using namespace std; struct Node { int data; struct Node *left; struct Node *right; Node(int value) { data = value; left = right = NULL; } }; bool rootToNode(Node *root, vector<int> &v, int x) { if (root == NULL) { return false; } ...
ALGO
0.999933
4.190996
d111eab9-959c-4c1e-9e44-0c25ee460e1d
shubhamm-06/DSA-learning
Array DSA/duplicate.cpp
// Q- Find duplicates in an array // Given an array a[] of size N which contains elements from 0 to N-1, you need to find all the elements occurring more than once in the given array #include <bits/stdc++.h> using namespace std; int duplicates(int a[], int n) { int ans; for(int i=0; i<n; i++) { an...
ALGO
0.999894
4.22823
82518640-9a24-4978-846d-eb137ed785f4
cqbzkrx/cqbzkrx
c++/模板/图论/kruskal (最小生成树).cpp
struct Node { int v, u; ll w; Node () : v (0), u (0), w (0) {} Node (int _v, int _u, ll _w) : v (_v), u (_u), w (_w) {} bool operator < (const Node &b) const { return w < b.w; } }; vector e (0, Node ()); sort (all(e)); auto kruskal = [&](const vector <Node> &e, DSU dsu) -> pair <ll, int>...
ALGO
0.999556
4.377232
6bbdc886-f2d4-46ef-b3fd-71fef3f6fd39
ishandutta2007/codeforces
bluediamond/normal/1729/B.cpp
#include <bits/stdc++.h> using namespace std; signed main() { #ifdef ONLINE_JUDGE ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #endif // ONLINE_JUDGE #ifndef ONLINE_JUDGE ///ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); freopen("___input___.txt","r",stdin); #endif // ONLINE_JUDGE int t; cin>>t; ...
ALGO
0.999761
5.355314
d982773b-f817-4ebe-b33f-5bfc78d037ee
alecalmirp/Logica-de-Programacao
Lista 2/lista2 - 2.cpp
#include <stdio.h> #include <math.h> int main () { float fixo, vendas, final; printf ("Informe o salário fixo do vendedor: "); scanf ("%f", &fixo); printf ("Agora informe a quantidade vendida, em reais, pelo vendedor: "); scanf ("%f", &vendas); final = (vendas * 0.15) + fixo; printf ("O salário fixo de seu vend...
TOOL
0.920889
4.089019
9882fe37-d3cf-44e4-b691-3b376a57f224
Bhagwankumarsingh/LeetCodeQuestions
34-find-first-and-last-position-of-element-in-sorted-array/find-first-and-last-position-of-element-in-sorted-array.cpp
class Solution { public: int firstOcc(vector<int>&nums,int target){ int n=nums.size(); int s=0; int e=n-1; int ans=-1; while(s<=e){ int mid=s+(e-s)/2; if(nums[mid]==target){ ans=mid; e=mid-1; } el...
ALGO
0.999901
6.460716
4e01659d-7911-429b-8a2a-e57681143422
adityasharmah/DSA
Tree/Binary Tree/Traversal/diameterOfTree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999851
6.574533
59cfb723-dce5-48de-9922-d3430ae6194a
tnsts/DiscreteStructures
Problems/TreeProblems/help.cpp
bool isSimple(int a){ for(int i = 2; i < a; i++){ if(!(a % i)){ return 0; } } return 1; } int number_sum(int a){ if(a < 0) a = -a; return (a/10 + a%10); }
ALGO
0.99673
3.780892
369f1111-d80e-43b3-be70-2cdafd8cd68e
Viljen789/ProblemSolving
leetcodesolutions/73-set-matrix-zeroes/set-matrix-zeroes.cpp
#define ll long long void color(vector<vector<int>>& matrix, int i, int j, int tot){ int n = matrix.size(); int m = matrix[0].size(); for(int a = 0; a<m; a++)if(matrix[i][a])matrix[i][a] = tot; for(int b = 0; b<n; b++)if(matrix[b][j])matrix[b][j] = tot; } class Solution { public: void setZeroes(ve...
ALGO
0.999892
5.264536
7ec7add5-1a01-4900-9287-7a3547339d81
huguangAOA/Bilibili-Algorithm
14.第14章:动态规划/第十四章代码/24.HZOJ-45.cpp
/************************************************************************* > File Name: 24.HZOJ-45.cpp > Author: huguang > Mail: <EMAIL> > Created Time: ************************************************************************/ #include <iostream> #include <cstdio> #include <cstdlib> #include <queue> #include <st...
ALGO
0.999916
3.695565
5ca92fa7-6929-4f5c-bda2-4b3f5ed29258
SaeedJannati/LeetCodeProblems
LeetCodeProblemsCMake/Problems/LeetCode3442MaximumDifferenceBetweenEvenAndOddFrequencyI.cpp
// // Created by saeed on 6/10/25. // #include "LeetCode3442MaximumDifferenceBetweenEvenAndOddFrequencyI.h" #include <vector> using namespace std; int LeetCode3442MaximumDifferenceBetweenEvenAndOddFrequencyI::maxDifference(string s) { vector<char> frequencies(26,0); for (auto c : s) { frequencies[c-'a...
ALGO
0.999256
5.205157
7e32a403-e896-4a54-b5f7-816421e10287
Anurag6212/LeetCode_Questions
pangram.cpp
//pangram sentence is a sentence which is having 26 size. class Solution { public: bool checkIfPangram(string sentence) { set<char>s; for(auto& c:sentence) { s.insert(c); } return s.size()==26; } };
ALGO
0.998986
6.047873
6506fc8a-c577-4557-bff9-76feaf28d325
Qhzy1411/ACM
CPP/2025summer/dingpa/7.25/1002.cpp
// Author: QHZY // Create_Time: 2025/07/25 12:06:54 #include <bits/stdc++.h> using namespace std; using i32 = int; using i64 = long long; using i128 = __int128; using u32 = unsigned; using u64 = unsigned long long; using u128 = unsigned __int128; using f32 = float; using f64 = double; using f128 = long double; using ...
ALGO
0.999988
3.971503
34a69ae3-d118-4864-b1f7-eb25f6f5d6bb
ishandutta2007/codeforces
mateusz/normal/607/A.cpp
#include <bits/stdc++.h> using namespace std; const int N = 100005; int a[N], b[N], dp[N]; pair<int, int> tab[N]; int n; int find(int p, int w) { int poc = 1; int kon = p; int ret = 0; while (poc <= kon) { int sr = (poc + kon) / 2; if (a[sr] < w) { ret = sr; po...
ALGO
0.999904
3.726203
7d5b043d-dde3-49b5-9264-4305a3cd163c
KUMARSANDIPROY/leetcode
Check Mirror in N-ary tree - GFG/check-mirror-in-nary-tree.cpp
// { Driver Code Starts //Initial Template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends //User function Template for C++ class Solution { public: int checkMirrorTree(int n, int e, int A[], int B[]) { map<int,stack<int>> mp; for(int i=0;i<2*e-1;i=i+2) ...
ALGO
0.999885
4.750188
13693aa9-71d2-4f28-ab2c-8f5a512bc444
yyatsuo/atcoder
abc020/b.cpp
#include <bits/stdc++.h> #define INF LLONG_MAX #define ll long long #define ull unsigned long long #define rep(i,n) for(int i=0; i<n; ++i) #define MOD 1000000007 using namespace std; template<class T> inline bool chmin(T& a, T b) { if(a>b) {a=b; return true;} return false;} template<class T> inline bool chmax(T& a, T ...
ALGO
0.999693
4.510094
73fbbbe5-8c7e-4aae-a561-269579df849a
chve117/EjerciciosCplusplus
ejercicios arrays/repaso/pareseimpares/main.cpp
#include <iostream> using namespace std; void llenarPares(int[100]); void llenarImpares(int[100]); void mostrarPares(int[100]); void mostrarImpares(int[100]); int main(){ int numeros[100]; llenarPares(numeros); llenarImpares(numeros); mostrarPares(numeros); mostrarImpares(numeros); return 0; } void llenarPares...
ALGO
0.99087
4.210978
86728808-6cf9-423a-be74-a018cf82dd18
sorowar-cse/CSE-2322__Data-Structure-Lab
Soft Code/Lab 4/L4_20 - Hash Table Using Chain method.cpp
#include<iostream> //#include<bits/stdc++.h> using namespace std; typedef struct node { int data; struct node *next; }; node *A[1032]; void Insert(int Size) { int num; cout<<"Enter the elements : "; for(int i=0; i<Size; i++) { cin>>num; node *newNode = new node(); new...
ALGO
0.999377
3.303099
3ebb7c88-c966-41e5-8c0b-9861757ac676
raincross7/code-similarity
codes/train_code/problem007/problem007_373.cpp
#include <iostream> #include <array> #include <algorithm> using namespace std; const int maxn = 3e5+6; using ll = long long; array<ll,maxn>arr; int main() { ios::sync_with_stdio(false); cin.tie(0); int num; ll tot = 0; cin >> num; for(int i = 0;i<num;++i) { cin >> arr[i]; arr...
ALGO
0.999802
3.589456
c9451b8b-d270-42bc-81a1-8c0878e75bb7
neocoretechs/libedgetpu
tensorflow/lite/ml_dtypes/third_party/eigen/doc/examples/TutorialLinAlgInverseDeterminant.cpp
#include <iostream> #include <Eigen/Dense> int main() { Eigen::Matrix3f A; A << 1, 2, 1, 2, 1, 0, -1, 1, 2; std::cout << "Here is the matrix A:\n" << A << std::endl; std::cout << "The determinant of A is " << A.determinant() << std::endl; std::cout << "The inverse of A is:\n" << A.invers...
ALGO
0.999802
4.488896
554034e8-c72f-490c-a69d-9026003ae288
mtheory101/hybrid-rendering-thesis
depends/include/AssImp/src/SplitLargeMeshes.cpp
/** @file Implementation of the SplitLargeMeshes postprocessing step */ #include "AssimpPCH.h" // internal headers of the post-processing framework #include "SplitLargeMeshes.h" #include "ProcessHelper.h" using namespace Assimp; // ------------------------------------------------------------------------------------...
TOOL
0.970295
6.530207
7c30d377-60c6-4f33-be45-9d8b7fbb7612
Saurabhn16/CP-dsa
dp/dp1d/houserobber.cpp
#include <bits/stdc++.h> long long int houseRobber(vector<int>& v) { int l=v.size(); int dp[l+1]; for (int i = 0; i <l; i++) {for (int j = i+1; j < l; j++) { dp[i]=max(dp[i],v[j%l]+dp[j%l]) ; } } return dp[l]; } int main( )
ALGO
0.999841
4.416449
52f0eb39-ea28-428b-8048-b91d3fe453bc
HimanshuShekhar18/LeetCode-Solutions
TRIE/Implement_Trie.cpp
#include<bits/stdc++.h> using namespace std; /* Your Trie object will be instantiated and called as such: Trie* obj = new Trie(); obj->insert(word); bool check2 = obj->search(word); bool check3 = obj->startsWith(prefix); */ struct Node{ Node* letter[26]; bool flag = false; bool i...
ALGO
0.99964
4.689872
879abed5-c198-4935-9abe-2b39f658a92d
JinhaJjing/Algorithm
Algorithm/Solved/삼각 달팽이.cpp
//https://programmers.co.kr/learn/courses/30/lessons/68645?language=cpp #include <string> #include <vector> using namespace std; vector<int> solution(int n) { vector<vector<int>> arr(n + 1, vector<int>(n + 1)); int state = 0; int x = 0, y = 0, num = 1; for (int i = 0; i < n; i++) { if (state == 0) { for ...
ALGO
0.999988
4.409354
f268b5de-4b66-46a6-b640-8d1e3920f879
samratghosh291/DSA-in-C-CPP-Python
Recursion/substring_ASCII.cpp
// Generate all substring with ASCII values // i/p: "AB" // B // 66 // A // AB // A66 // 65 // 65B // 6566 #include <iostream> using namespace std; void subseqWithASCII(string s, string ans) { if (s.length() == 0) { cout << ans << endl; return; } char ch = s[0]; int code = ch; ...
ALGO
0.999226
5.498079
39994073-fc00-4dbd-a7ec-fafa3e325943
prishitakadam/LeetCode
Problems/1365. How Many Numbers Are Smaller Than the Current Number.cpp
class Solution { public: vector<int> smallerNumbersThanCurrent(vector<int>& nums) { vector<int> smallnumbers; int count; for(int i=0; i<nums.size(); i++){ count = 0; for(int j=0; j<nums.size(); j++){ if((i != j) && (nums[i] > nums[j])...
ALGO
0.999964
6.034082
80fae6e6-7118-4874-ad72-f6be6b120b67
abhidevs/DSA-0toInfinity
intro_to_queue.cpp
#include<bits/stdc++.h> using namespace std; #define n 100 class Queue { int* arr; int front; int back; public: Queue() { arr = new int[n]; front = -1; back = -1; } void push(int x) { if(back == n-1) { cout<<"Que...
ALGO
0.982907
4.090377
caf64f28-e5d0-4c2a-9fe3-5986cd5b3e47
naomi-mcrn/eXperience-Points_xp2
src/timedata.cpp
#include "timedata.h" #include "netbase.h" #include "sync.h" #include "guiinterface.h" #include "util.h" #include "utilstrencodings.h" #include <boost/foreach.hpp> using namespace std; static CCriticalSection cs_nTimeOffset; static int64_t nTimeOffset = 0; /** * "Never go to sea with two chronometers; take one or...
TOOL
0.865073
6.233341
fcdaa7aa-a338-4b13-a81a-56f2875e3a09
DuyetVu2001/OOP_C-
OOP_C++/BaiToanKinhDienKTEAM/5_DemSoChuSoCuaSoNguyenDuong.cpp
#include <iostream> using namespace std; int demSoChuSo(int n) { if (n < 10) return 1; return 1 + demSoChuSo(n / 10); } int main() { int n(1234); cout << demSoChuSo(n); return 0; }
ALGO
0.999156
4.47711
2d199329-8c39-477d-9ae1-3fc4cecb7275
opencv/opencv_contrib
modules/line_descriptor/src/binary_descriptor_matcher.cpp
#include "precomp.hpp" #define MAX_B 37 double ARRAY_RESIZE_FACTOR = 1.1; // minimum is 1.0 double ARRAY_RESIZE_ADD_FACTOR = 4; // minimum is 1 //using namespace cv; namespace cv { namespace line_descriptor { /* constructor */ BinaryDescriptorMatcher::BinaryDescriptorMatcher() { dataset = Ptr<Mihasher>(new Mih...
ALGO
0.996795
5.900602
8aeb2db3-75bf-45c4-a050-9d9e67ff2393
ParrySMS/Exp
DS/ds_seqlist.cpp
#include <iostream> #include <stdio.h> #include <cstring> using namespace std; #define ok 0 #define error -1 class SeqList { private: int *list; int maxsize; int size; public: SeqList(); ~SeqList(); int list_insert(int i,int item); int list_del(int i); int list_get(int i); void list_show(int res...
ALGO
0.999483
3.400247
3f6b0b05-42a0-4fdf-9a16-7ad0253939c7
Alioth-CAF-Device-Tree/frameworks_av
media/utils/MemoryLeakTrackUtil.cpp
//#define LOG_NDEBUG 0 #define LOG_TAG "MemoryLeackTrackUtil" #include <utils/Log.h> #include <mediautils/MemoryLeakTrackUtil.h> #include <sstream> #include <bionic/malloc.h> /* * The code here originally resided in MediaPlayerService.cpp */ // Figure out the abi based on defined macros. #if defined(__arm__) #def...
TOOL
0.897929
7.116609
420d0e8a-e36e-4b43-9bcd-1a43ba1e6302
kokorinosoba/contests
AtCoder/ABC0/ABC050/B.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> t(n); int sum = 0; for (int& e: t) cin >> e, sum += e; int m; cin >> m; for (int i = 0; i < m; i++) { int p, x; cin >> p >> x; int ans = sum - t.at(p - 1) + x; cout << ans << endl; } }
ALGO
0.999887
3.93101
7f6a6a88-b443-471b-875b-663f95e6bb29
okmd/codingblocks
06-challenge-patterns/07-pattern-double-sided-arrow.cpp
#include <iostream> using namespace std; int main(){ int n,row,col,val; cin>>n; for(int i=1;i<=n/2+1;i++){ //top left space for(int j=1;j<=n-2*i+1;j++){ cout<<" "; } //top left number for(int j=i;j>=1;j--){ cout<<j<<" "; } // space middle for(int j=1;j<=2*(i-1)-1;j++){ cout<<" "; } /...
ALGO
0.999961
3.353012
5c411386-2782-4e96-8d23-c06d92330f19
xbhoneybee/ACM_ICPC
算法竞赛入门经典/xt6/uva679.cpp
#include <bits/stdc++.h> #include<cstdio> #include<cstdlib> #include<cstring> #include<string> #include<iostream> #include<algorithm> #include<queue> #include<cmath> #include<stack> #include<set> #include<vector> #include<map> #include<sstream> #define ll long long #define LL long long #define inf 100000000 #define ios...
ALGO
0.999672
3.701644
ab9e66ed-085a-457b-a5ec-572bbbd3e226
adonelick/2048-rl
qLearning.cpp
/** * Written by Andrew Donelick * EELE 577 - Advanced Digital Signal Processing * Final Project */ #include <iostream> #include <fstream> #include <sstream> #include <string> #include <limits> #include <vector> #include <cmath> #include <stdlib.h> #include <time.h> #include "state.hpp" #include "game.hpp" #incl...
ALGO
0.999244
4.781778
9d3aaaf9-5882-4fa8-9491-c009de1a6498
HuyuYasumi/algorithm-cpp
greedy-algorithm/backpack.cpp
#include <iostream> #include <algorithm> #include <vector> using namespace std; struct Good { int id; int v; int w; double u; Good() = default; Good(int id, int v, int w) : id(id), v(v), w(w) { u = (double)v / w; } }; bool compare(Good *a, Good *b) { return a->u >= b->u; } i...
ALGO
0.999901
4.324341
8ea24ea6-6e21-4e09-8d29-f8fd5df9b0d3
lakshyasaxena/CP-Algorithms-in-C_plus-plus
ComponentsOfAGraph.cpp
Connected components in a graph refer to a set of vertices that are connected to each other by direct or indirect paths. In other words, a set of vertices in a graph is a connected component if every node in the graph can be reached from every other node in the graph. Algorithm: step-1 Mark all vertices as non visi...
ALGO
0.999716
6.369019
46120f4d-a133-4605-b1a2-115e84a8f773
paoloshasta/shasta2
src/areSimilarSequences.cpp
// Shasta. #include "areSimilarSequences.hpp" #include "abpoaWrapper.hpp" #include "Base.hpp" #include "isPeriodic.hpp" using namespace shasta; // Standard library. #include "algorithm.hpp" #include "iterator.hpp" // See areSimilarSequences.hpp for comments. bool shasta::areSimilarSequences( const vector<Bas...
ALGO
0.987392
6.584876
c0467025-c1a3-413b-94b1-638d3c8b768d
ishandutta2007/codeforces
sert/normal/290/A.cpp
#include <iostream> #include <algorithm> #include <stdio.h> #include <string> #include <cmath> #define fr(i, n) for(int i = 0; i < n; i++) typedef long long ll; typedef long double ld; const ll N = 1e6 + 7; using namespace std; ll n, m, x, y, a[N], b[N]; int main() { //freopen("a.in", "r", stdin); //freop...
ALGO
0.999735
3.777195
295dac9b-a15d-42b1-af89-3f37d76c2d6f
Tani-09/CPP-Array-Basic-Problems
24[Array] peak element in array.cpp
#include<iostream> using namespace std; int main() { int a[5],i; cout<<"ENTER THE 5 ELEMENT OF ARRAY: "; for(i=0; i<5; i++) { cin>>a[i]; } for(i=0; i<5; i++) { if(a[i]>a[i-1]&& a[i]>a[i+1]) cout<<"THE NUMBER THAT IS PEAK ELEMENT IS: "<<a[i]<<"\n"; } return 0; }
ALGO
0.999932
3.13821
80f6494e-2e99-4e9e-b4d1-9b200f018eb4
1412904892/LeetCode
Medium/new-21-game.cpp
#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; class Solution { public: double new21Game(int N, int K, int W) { if (K==0 || N>=(K+W)) return 1.0; double dp[N+1]; double res=0.0; double sum=0.0; for (int i=1;i<=N;i++){ ...
ALGO
0.999749
3.28283
331c1978-2251-4354-b118-f82d40a7620b
husnain572/Leetcode-Solutions
90-subsets-ii/subsets-ii.cpp
class Solution { public: void getAllSubsets(vector<int>&nums,vector<int>& ans,int i,vector<vector<int>> &allSubsets){ if(i==nums.size()){ allSubsets.push_back(ans); return; } ans.push_back(nums[i]); getAllSubsets(nums,ans,i+1,allSubsets); ans.p...
ALGO
0.999888
5.822235
dd2ac7d1-967f-4dc6-ad91-efb6e5e9ff42
gauravengine/CPP_Freak
Contests/11 DEC #689B/A_String_Generation.cpp
#pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #define db1(x) cout<<#x<<"="<<x<<'\n' #define db2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n' #define db3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","...
ALGO
0.999951
3.677998
5f7bb625-a42c-4051-8c71-46d130beeef6
muskan-aggarwal/DATA-STRUCTURES
exp11.cpp
#include<iostream> using namespace std; struct node { int data; node *left; node *right; }; node *createnode(int x) { node *temp=new node; temp->data=x; temp->left=temp->right=NULL; return temp; } node* ins(node *root,int value) { if(root==NULL) { root=createnode(value); ...
ALGO
0.999807
3.978094
9746f2f2-470c-4f09-912e-fa28f6207f85
JF037/safe-carousel-optimization
code/carousel.cpp
#include <iostream> #include <fstream> #include <vector> #include <cmath> #include <cstdlib> #include <ctime> #include <algorithm> // Function to read input from file void read_input(const std::string& input_file, int& n, std::vector<int>& weights) { std::ifstream infile(input_file); if (!infile) { std...
ALGO
0.999986
6.28807
5e065c9d-2912-4af0-bab5-0e8a250b9cec
Ebeed-cs/Mastering-4-critical-SKILLS-using-CPP-17
05-Operators/04-Medium Level/is even.cpp
#include<iostream> using namespace std; /* The following code reads an integer and computes a boolean if the number is even in 3 different ways. ● Fill in the is_even to solve the problem in 3 ways as following ● Using only %2 ● Using only /2 ● Using only %10 */ int main() { int num; cin >> num; // Is even u...
ALGO
0.99955
3.997164
f2b0da15-afed-4fcd-a8f3-8b871f3f4135
HachasyDados/HD-TCore
dep/g3dlite/source/SplineBase.cpp
#include "G3D/platform.h" #include "G3D/Spline.h" namespace G3D { float SplineBase::getFinalInterval() const { if (! cyclic) { return 0; } else if (finalInterval <= 0) { int N = time.size(); if (N >= 2) { return (time[1] - time[0] + time[N - 1] - time[N - 2]) * 0.5f; ...
ALGO
0.997304
7.841708
8662563b-95f7-433d-906a-e7e44b9252be
Nishant-Pall/C-practice
Hashing Techniques/removeDuplicates.cpp
#include<iostream> #include<vector> #include<unordered_map> using namespace std; vector<int> removeDuplicates(int arr[], int size){ vector<int> output; unordered_map<int, bool> seen; for(int i=0; i < size; i++){ if(seen.count(arr[i]) > 0) continue; seen[arr[i]] = true; output.push_back(arr[i]); } return...
ALGO
0.999868
4.692449
979ba434-30fa-427c-88b4-ebaed458f16d
ATHARVA-GAWAS/DSA
2232-adding-spaces-to-a-string/adding-spaces-to-a-string.cpp
class Solution { public: string addSpaces(string s, vector<int>& spaces) { int n=s.size(); unordered_set<int> st; string ans=""; for(auto it:spaces){ st.insert(it); } for(int i=0;i<n;i++){ if(st.find(i)!=st.end()){ ans+=" "; ...
ALGO
0.999921
6.047551
86bc30cc-e149-4ea5-82b4-6fdf8c3bebdb
ignabelitzky/codeforces
problem-266B.cpp
/* * 266B. Queue at the School * * During the break the schoolchildren, boys and girls, formed a queue of n people in the * canteen. Initially the children stood in the order they eneterd the canteen. However, after a * while the boys started feeling awkward for standing in front of the girls in the queue and they...
ALGO
0.999986
5.800768
2b3de132-0985-4d25-a01b-8106a2f3e741
SebastianFischerr/gem5-SysXelerator
src/systemc/tests/systemc/misc/user_guide/chpt3.1/fsmr.cpp
/***************************************************************************** fsmr.cpp -- Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 *****************************************************************************/ /***************************************************************************** ...
ALGO
0.998598
4.888353