uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
25b8bc30-e983-4f58-b3ad-9790676a25db
mmizer/ProgrammersGuideToTheGalaxy-Reboot
hash_maps/example.cpp
#include <iostream> #include <string> #include <map> using namespace std; int main(){ map <string, string> hashMap; hashMap["Zaphod Beeblebrox"] = "Betelgeuse Five"; // { "Zaphod Beeblebrox":"Betelgeuse Five" } hashMap["Marvin"] = "Sirius"; // { "Zaphod Beeblebrox":"Betelgeuse Five" , "Marvin":"Sirius" } stri...
TOOL
0.920881
4.413036
bde8ab9a-47a3-4381-8d46-f77962595543
Pentacode-IAFA/Quad-Remeshing
libs/quadwild/libs/libigl/include/igl/doublearea.cpp
template <typename DerivedV, typename DerivedF, typename DeriveddblA> IGL_INLINE void igl::doublearea( const Eigen::MatrixBase<DerivedV> & V, const Eigen::MatrixBase<DerivedF> & F, Eigen::PlainObjectBase<DeriveddblA> & dblA) { // quads are handled by a specialized function if (F.cols() == 4) return doublearea...
TOOL
0.986804
7.336882
2ef06d89-abec-428e-830d-34b184594484
mowagdy02/SkyCast
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.9988
6.76073
16b8e620-f7c5-455f-ba5e-c03a93bb358f
ShashiWerdun/competitive-programming
Codeforces/ShiftingStacks.cpp
//COMPLETED #include <bits/stdc++.h> using namespace std; #define ll long long int main() { int t; cin >> t; for (int cases = 0; cases < t; cases++) { int n; cin >> n; ll sum = 0; string ans = "yes"; for (int i = 0; i < n; i++) { ll x; ...
ALGO
0.999149
4.527302
dd1a9b79-7616-4b4d-aa01-91cba9fd0381
Morsiusiurandum/LeetCode
leetcode/editor/en/[706]Design HashMap.cpp
//Design a HashMap without using any built-in hash table libraries. // // Implement the MyHashMap class: // // // MyHashMap() initializes the object with an empty map. // void put(int key, int value) inserts a (key, value) pair into the HashMap. //If the key already exists in the map, update the corresponding value. //...
ALGO
0.998127
6.065625
4a3221a3-fadc-446a-92b8-422383dfd175
Omarkandil1212/Competitive-Programming
MyPrewritten/Bitsetsubsetsum.cpp
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main(){ bitset<100001> dp; ll n,a; cin>>n; for(int i=0;i<n;i++){ cin>>a; dp = dp | (dp<<a); } }
ALGO
0.999695
3.655258
7f93f640-6836-4aef-ab23-0065be9ab771
YoungseokCh/problem-solving
baekjoon/14572.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; pair<unsigned int, unsigned int> segtree[1 << 20 | 1]; int N; void build(){ for (int i=N-1; i>0; --i){ auto [and_1, or_1] = segtree[i << 1]; auto [and_2, or_2] = segtree[i << 1 | 1]; segtree[i] = {and_1 & and_2, or_1 | o...
ALGO
0.999896
4.865596
4391cd3a-a472-4650-8841-06dc8161606e
s-kosugi/FMGameBase
FMGameBase/src/Utility/Easing/Easing.cpp
#include "Easing.h" #include "..\utility.h" #define _USE_MATH_DEFINES #include <math.h> namespace Easing { float InQuad( float t , float totaltime , float max , float min ) { max -= min; t /= totaltime; return max * t*t + min; } float OutQuad( float t , float totaltime , float max , float min ) { max -= ...
ALGO
0.99747
4.883763
18866082-7375-4ec8-8be5-a69e94d8150a
javierdelapuente/ode
ode/demo/demo_plane2d.cpp
// Test my Plane2D constraint. // Uses ode-0.35 collision API. # include <stdio.h> # include <stdlib.h> # include <math.h> # include <ode/ode.h> # include <drawstuff/drawstuff.h> #include "texturepath.h" # define drand48() ((double) (((double) rand()) / ((double) RAND_MAX))) # define...
ALGO
0.921877
4.802376
4c5e5387-c1b1-44f8-b921-6019efce4caa
Archit669/data-structures-and-algorithms
cses problem set/searching_and_sorting/31_array_division.cpp
#include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace chrono; using namespace __gnu_pbds; #define int long long typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> pbds; // find_by_order, o...
ALGO
0.999985
4.980653
5d92a8a8-3bf7-414a-a10a-e9e688c93c30
zjsxzy/Leetcode
Find XOR Sum of All Pairs Bitwise AND/main.cpp
#include <bits/stdc++.h> using namespace std; #define PB push_back #define SZ(v) ((int)(v).size()) #define abs(x) ((x) > 0 ? (x) : -(x)) typedef long long LL; class Solution { public: int getXORSum(vector<int>& arr1, vector<int>& arr2) { int n = arr1.size(), m = arr2.size(); vector<int> cnt2(32); ...
ALGO
0.999948
4.867763
21da59ae-9e3d-446e-affa-92c3f23380b2
weissms/owb-mirror
tags/Doduo1.1.2/JavaScriptCore/wtf/dtoa.cpp
/* Please send bug reports to David M. Gay Bell Laboratories, Room 2C-463 600 Mountain Avenue Murray Hill, NJ 07974-0636 U.S.A. <EMAIL> */ /* On a machine with IEEE extended-precision registers, it is * necessary to specify double-precision (53-bit) rounding precision * before invoking strto...
TOOL
0.932367
4.97124
105cbd61-2bd5-4590-9b67-cb7c2acd5a28
Eng-khaledElsaeed/Data-Structure
selection sort algorithm/Source.cpp
#include<iostream> using namespace std; class sorting { private: int* arr; int size; public: sorting(int size, int* arr) { this->arr = arr; this->size = size; } void selectionSort() { for (int i = 0; i < size - 1; i++) { int min = i; for (int j = i + 1; j < size; j++) { if (arr[j] < arr[min]) { ...
ALGO
0.999848
4.769135
685bbac3-83b2-4e3d-83a3-9f94b658e4dc
ConnectNitish/cp_practice
src/solved/permutationOfArray.cpp
#include<bits/stdc++.h> using namespace std; void permutation(vector<int> &num, int start, vector<vector<int> > &result) { if(start == num.size() - 1){ result.push_back(num); return; } for(int i = start;i < num.size();i++){ swap(num[start], num[i]); permutation(num, start ...
ALGO
0.999671
4.505202
8fd1e1d5-3e31-4a33-9757-66ce27f54a1d
leungll/NENU-Courses
算法分析与设计/17级软件/ebook/源代码/ch8/machineschedule2.cpp
#include <stdio.h> #include <string.h> #define INF 0x3f3f3f3f // #define MAXN 51 //ҵ #define MAXA MAXN*20 #define max(x,y) ((x)>(y)?(x):(y)) #define min(x,y) ((x)<(y)?(x):(y)) //ʾ int n=6; //ҵ int a[]={2,5,7,10,5,2}; int b[]={3,8,4,11,3,4}; //ṹʾ int maxA; int ans=INF; int dp[MAXN][MAXA]; void solve...
ALGO
0.999767
3.266921
7eda6168-e9f2-4e7e-aa8e-8dd0fb8c0345
Vishnu-cse/Todo-flutter
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
25073913-50f6-4bb4-9848-7bb715839787
Pavan12120707/https-github.com-loveBabbar-CodeHelp-DSA-Busted-Series
Lecture034 Recursion Day4/palindromeCheck.cpp
#include<iostream> using namespace std; bool checkPalindrome(string str, int i, int j) { //base case if(i>j) return true; if(str[i] != str[j]) return false; else{ //Recursive call return checkPalindrome(str, i+1,j-1); } } int main() { string name = "BookkooB...
ALGO
0.99956
4.610286
ae1249ec-a8bb-4c7d-8dec-be21fd48ddcf
myousuf65/cpp_webserver
dependencies/boost/libs/graph/example/ospf-example.cpp
namespace boost { enum graph_color_t { graph_color = 5556 }; BOOST_INSTALL_PROPERTY(graph, color); } int main(int argc, const char** argv) { using namespace boost; typedef adjacency_list< vecS, vecS, directedS, property< vertex_name_t, std::string >, property< edge_color_t, std::string, pro...
ALGO
0.991235
4.540612
1cb0072b-a659-49fa-9c7c-fa3a9ced6be1
evandaatang27/Projek-Stage-3_Bismillah-SIC
tensorflow/lite/micro/kernels/maximum_minimum.cpp
#include "tensorflow/lite/kernels/internal/reference/maximum_minimum.h" #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" #include "tensorflow/lite/kernels/internal/common.h" #include "tensorflow/lite/kernels/internal/quantization_util.h" #include "tensorflow/lite/kernels/internal/te...
ALGO
0.998127
7.705653
51682032-6917-41ed-a38f-c69b30916fe1
Gerrytty/parallel-programming-course
openMP/task13.cpp
#include <omp.h> #include <stdio.h> #include <stdlib.h> #include <iostream> #include <string> #include <cmath> int main(int argv, char* argc[]) { int a[30] = {1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1}; int answer = 0; #pragma omp parallel for for (int ...
ALGO
0.99977
3.367407
ca0dc04c-a988-4315-9d52-5cc10a0041bc
ajinkyavn1/Codes
codeforces_Old/Cutting_Recipes.cpp
#include<bits/stdc++.h> taxisypedef long long int ll; #define do_it_fast ios_base::saxisync_with_stdio(0),cin.tie(0),cout.tie(0) #define vll vector<long long int> #define pll pair<long long int, long long int> using namespace std; void solve(){ int n; cin>>n; vll v(n); for(int i=0;i<n;i++) cin>...
ALGO
0.999932
3.156759
f50a2c3c-4e6a-4961-8bf3-ca3ac4db5aa8
Maserhe/Algorithm_practise
算法竞赛进阶指南/0x20「搜索」例题/排书.cpp
#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; const int N = 15; int n; int q[N], w[5][N]; int f() { int res = 0; for (int i = 0; i + 1 < n; i ++ ) if (q[i + 1] != q[i] + 1) res ++ ; return (res + 2) / 3; } bool check() { for (...
ALGO
0.999951
3.962512
23298caa-c0a1-449d-b8dc-d5bae0687fa3
gwanduke/coding-test
acmicpc/sw-1-basic/05-dp/1463/cpp-001.cpp
#include <iostream> int memo[1000001] = {-1}; int dy(int n) { if (n == 1) { return 0; } if (memo[n] >= 0) { return memo[n]; } memo[n] = dy(n - 1) + 1; if (n % 2 == 0) { int temp = dy(n / 2) + 1; if (memo[n] > temp) memo[n] = temp; }...
ALGO
0.999931
4.946798
47abf5a3-a561-48b2-9b53-21c675cd94f7
Epiphany6666/homework
实验5 栈的基本操作及应用/5-1.cpp
#include"sqstack2.cpp" int main() { ElemType str[max]; int D,O,H; sqstack *p;//ջp initstack(p);//ʼp getbinary(str);//ȡһ D = reverse2_10(str, p);// 2ת10 printf("תΪʮƺΪ:% d\n", D); printf("ת˽ƺΪ") ; reverse2_8(str, p);// 2ת8 convert(p); return 0; }
ALGO
0.972925
3.233144
e4773df4-0ae8-4507-a92c-655459c22ffb
vishwaaaaa/Computation_Fluid_Dynamics_Solvers
CFD_airfoil_FVM/FirstOrderSolver.cpp
//AERO623 Project 2 //First-order Solver #include <iostream> #include <fstream> #include <cmath> #include <string> #include <sstream> #include <iomanip> #include <Eigen/Dense> #include <vector> #include <algorithm> #include <chrono> using namespace std; using namespace Eigen; MatrixXd ArraytoMatrix(double* A) { i...
ALGO
0.999775
3.236083
73526427-fb31-4e24-a0b4-a5b648e953bd
FadeDemo/cpp_demo
cpp-primer-plus/sample/chapter-6/if.cpp
// // Created by fade on 2023/4/21. // #include <iostream> int main() { using namespace std; char ch; int spaces = 0; int total = 0; cin.get(ch); while (ch != '.') { if (ch == ' ') { ++spaces; } ++total; cin.get(ch); } cout << spaces << " space...
ALGO
0.969581
3.311973
7da40f31-4ada-4abd-aec5-9d94f1ccfda0
MirrorYuChen/ncnn_example
ncnn-20210525-full-source/src/layer/arm/swish_arm.cpp
#include "swish_arm.h" #if __ARM_NEON #include <arm_neon.h> #include "neon_mathfun.h" #if __ARM_FEATURE_FP16_VECTOR_ARITHMETIC #include "neon_mathfun_fp16s.h" #endif #endif // __ARM_NEON #include <math.h> namespace ncnn { Swish_arm::Swish_arm() { #if __ARM_NEON support_packing = true; #if __ARM_FEATURE_FP16_VEC...
ALGO
0.986281
6.400189
04c6e230-34b0-4e8d-b1d9-c9f444e72a32
ADITYAGABA1322/Daily-LeetCode-Challenge-Solution
0368-largest-divisible-subset/0368-largest-divisible-subset.cpp
class Solution { public: vector<int> largestDivisibleSubset(vector<int>& nums) { sort(nums.begin(), nums.end()); int n = nums.size(); vector<int> dp(n, 0), parent(n, 0), res; int mx = 0, mx_idx = 0; for(int i=n-1; i>=0; i--) { for(int j=i; j<n; j++) { ...
ALGO
0.999994
5.647717
f378057a-0711-4b04-a38c-8bca53263a67
Aman-Sekhon/DSA
Heaps3.cpp
#include<iostream> #include<queue> using namespace std; priority_queue<int, vector<int>, greater<int>> pqmin; priority_queue<int, vector<int>> pqmax; void insert(int x){ if(pqmax.size() == pqmin.size()){ if(pqmax.size() == 0){ pqmax.push(x); } else{ if(x > pqmax.top...
ALGO
0.999942
4.509065
066748b6-e410-4813-a4ed-77e93bcddcaa
12301098-Heminghui/LeetCode-Cpp
array/48.rotateImage.cpp
// https://leetcode-cn.com/problems/rotate-image/ // 题目要求在原数组中旋转(顺时针旋转90度) // 方法一:先沿水平中线上下翻转(-180° +−180°+ 一次镜像),可以实现顺时针 90度的旋转效果 // 再沿右上 - 左下的对角线翻转(270° +270°+ 一次镜像) class Solution { public: void rotate(vector<vector<int>>& matrix) { int n = matrix.size(); // 先上下翻折 for(int i=0; i < n/2; i+...
ALGO
0.99998
7.065954
1ee76632-5b10-4c52-bc09-0de885e736b8
Tronf92/OOB
Sablon Colectie/Sablon Colectie/main.cpp
#include <string> #include <iostream> using namespace std; #include "colectie.cpp" int main() { string nume; Colectie <string> numeAngajati; numeAngajati.Adauga("Dana"); numeAngajati.Adauga("Marius"); cout << "Lista numelor" << endl; while(numeAngajati.Elimina(&nume) ){ cout << nume << endl; } Colectie<>nu...
TOOL
0.863105
4.079915
38d980b7-d012-4de2-9b25-c067e7df1274
dbaumg/competitive-programming
Silver/feb-2020/triangles.cpp
#include <bits/stdc++.h> using namespace std; int main() { ifstream fin("triangles.in"); ofstream fout("triangles.out"); int n; fin >> n; map<pair<int, int>, int> id; map<int, set<int>> m1, m2; for (int i = 0; i < n; i++) { int x, y; fin >> x >> y; id[{x, y}] = i; ...
ALGO
0.999948
4.302478
c0323d68-29e8-4783-845d-920e6454549d
sdruix/AutomaticParallelization
src/tl/omp/nanos4/tl-for.cpp
#include "tl-omptransform.hpp" namespace TL { namespace Nanos4 { void OpenMPTransform::for_preorder(PragmaCustomConstruct for_construct) { Statement construct_body = for_construct.get_statement(); // The construct is in fact a ForStatement in a #pragma omp parallel do ...
TOOL
0.89874
5.416377
5c8f2110-588a-460a-b1bc-8870b01fc306
SW-Community/DS7
6-2 Percolate Up and Down (20 分)/6-2 Percolate Up and Down (20 分).cpp
// 6-2 Percolate Up and Down (20 分).cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> typedef int ElementType; #define MinData -1 typedef struct HeapStruct* PriorityQueue; struct HeapStruct { ElementType* Elements; int Capacity; int Size; }; P...
ALGO
0.999975
4.226259
7007986a-05c8-413c-87e8-039435123c5e
ishandutta2007/codeforces
ronnie007/normal/1530/F.cpp
#include<bits/stdc++.h> using namespace std ; #pragma GCC target ("avx2") #pragma GCC optimization ("O3") #pragma GCC optimization ("unroll-loops") #define MAXN 23 #define MOD 31607 int n ; int a[ MAXN ][ MAXN ] ; int prod[ MAXN ] ; unsigned short dp[ ( 1 << MAXN ) ][ 2 ] ; int ans = 0 ; int lim = 10000 ; int pre...
ALGO
0.999962
3.892954
a2750447-160b-407b-a2a7-e256a093dbd9
suuuzi/Competitive-Programming
SPOJ BR/OBI/8778. Elevador.cpp
// Problem: 8778. Elevador (http://br.spoj.com/problems/ELEVADO2/) #include <iostream> using namespace std; int main() { int qtdLeituras = 0, capMaxima = 0, total = 0; cin >> qtdLeituras >> capMaxima; bool estourouCap = false; for(int i = 0; i < qtdLeituras; i++) { int saiu = 0, entrou = 0; cin >> saiu >> ...
ALGO
0.999894
4.283762
d6fd11db-d56d-428e-b5b0-9b6f87681fc4
raghavsharma30/CaptureGo
CaptureGo_without_GUI/server-1.0.0/game.cpp
#include "game.h" #include <iostream> #include <iomanip> using namespace std; void ChainAndLiberties::print() const { cout << (piece == Piece::BLACK ? "Black" : "White") << " Chain: "; for (const auto& p : chain) { cout << "(" << p.x << ", " << p.y << ") "; } cout << ", Liberties: " << liberties...
ALGO
0.999493
4.547188
50e40ead-41a7-468e-b30b-33821fcb97b4
ithsarasak/Programming
Compettitive programming/BUU camp #14/camp #1/durian binary tree.cpp
#include<bits/stdc++.h> using namespace std; struct node{ int to, dis; }; vector< node > tree[110]; int mark[110], dp[110][110], l[110], r[110], w[110]; int dfs( int curnode ) { mark[curnode] = 1; for( int i = 0 ; i < tree[curnode].size() ; i++ ){ if( mark[tree[curnode][i].to] )continue; i...
ALGO
0.999948
3.929321
8fad4de1-5792-4a24-9445-2cebe1eee538
amikey/vlc-2.2.1.32-2013
win32/include/qt4/src/gui/itemviews/qbsptree.cpp
#include "qbsptree_p.h" QT_BEGIN_NAMESPACE QBspTree::QBspTree() : depth(6), visited(0) {} void QBspTree::create(int n, int d) { // simple heuristics to find the best tree depth if (d == -1) { int c; for (c = 0; n; ++c) n = n / 10; depth = c << 1; } else { depth...
ALGO
0.985362
5.045955
d5097303-7e60-46f9-9117-31bbc5a99690
Samsung/Vyond
chipyard-1.11.0/sims/firesim/platforms/f1/aws-fpga/Vitis/examples/xilinx_2020.1/host/streaming_host_bandwidth/src/host.cpp
#include <algorithm> #include <cstring> #include <iostream> #include <string> #include <thread> #include <unistd.h> #include <vector> // This extension file is required for stream APIs #include "CL/cl_ext_xilinx.h" // This file is required for OpenCL C++ wrapper APIs #include "xcl2.hpp" // Declaration of custom strea...
ALGO
0.940766
6.363568
058118a2-ea62-46e2-aa7f-f97dc99f4453
MoonforDream/Data-Structure-and-Algorithms
all/RedBlacktree.cpp
#include <iostream> #include <queue> #include <math.h> using namespace std; typedef enum {red,black} colortype; struct RBNode{ int data; RBNode *left,*right,*parent; colortype color; //ɫ RBNode(const int val,RBNode* l,RBNode* r,RBNode* p,colortype c=red):data(val), left(l),right(r),parent(p),col...
ALGO
0.999698
4.512495
a3343f35-ef70-48f6-811e-99937f8239db
kylanisrina/Studicasecpp
Hacker Rank/prmtk.cpp
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; int main() { char P,C,M,U,N; float K,Y,L,A,X,S; for (int i=1;i<=3;i++){ cin>>C; cin>>K; cin>>P; cin>>Y; cin>>M; cin>>N; cin>>C; cin>>A; cin>>U; ci...
ALGO
0.995353
3.615291
27dc5d45-634a-4571-a4d9-ff71e3ae9014
dc356/quake4sourcemidterm
mpgame/ai/AAS_Find.cpp
/* =============================================================================== AAS_Find.cpp This file has all aas search classes. =============================================================================== */ #include "../../idlib/precompiled.h" #pragma hdrstop #include "../Game_local.h" #include "AI.h" #i...
ALGO
0.954334
5.913928
7ae41660-99a8-47aa-b886-7ce98963b54a
Mo2Hefny/Competitive_Programming
CodeForces/C++/Codeforces Div. 2, B/B_T_primes.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define fast \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() int dx[4] = {1, -1, 0, 0}; int dy[4] = {0, 0, 1, -1}; ...
ALGO
0.999817
4.327883
16a6e1b8-1ee4-4235-a85c-87e1be6d4e9a
KaranTalreja/LeetCode
src/shortest-unsorted-continuous-subarray/solution.cpp
class Solution { public: int findUnsortedSubarray(vector<int>& nums) { if (nums.size() <= 1) return 0; int size = nums.size(); int firstInversion = -1; int lastInversion = -1; for (int i = 0; i < size-1; i++) { if (nums[i] > nums[i+1]) { firstInversion = i; ...
ALGO
0.999954
5.263402
167e8c58-cdc0-4015-a0fb-56057dbc99e9
ParasJain19/CrackYourInternship
Remove Linked List Elements.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* removeEleme...
ALGO
0.999961
5.736662
4276a031-1bd5-4527-b834-8db2574460f1
M-E-U-E/Current
B. Minor Reduction.cpp
#include<bits/stdc++.h> #define ll long long #define endl "\n" using namespace std; bool cmp(pair<int,int>a,pair<int,int> b) { if(a.first > b.first) return true; else if(a.first == b.first and a.second<b.second) return true; return false; } void solve() { string s; cin >> s; ll ...
ALGO
0.999904
5.529105
fb011be1-4f01-4069-92ea-e5bc124f674f
Maxim12313/cpp-dsa
string/rollingHash.cpp
#include <cassert> #include <climits> #include <cmath> #include <cstdint> #include <deque> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> using namespace std; int p = 9973; in...
ALGO
0.999924
4.581935
ba18cf54-c06c-4c8f-afb1-2bc9010e4815
ME-ON1/dsa-juniorSheet-Solution-
10369uva.cpp
#include<bits/stdc++.h> using namespace std ; int parent[500] ; vector<pair<int,int>> arr ; vector<pair<double, pair<int,int>>> w ; int _size ; void initParent (int p) { for(int i = 0 ; i <= p;i++ ) { parent[i] = i; } _size = p ; } int find(int x) { if(parent[x] == x ) return x ; else { parent[x] = find...
ALGO
0.999905
4.140425
0fddf5de-2d5a-4f00-94f5-6b8046cfb86b
devvrat4522-kan/programs
insertion_sort.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int arr[]={5,1,9,4,0,3,6},i,j,temp; for(int i=1;i<6;i++){ for(j=i-1;j>=0;j--){ temp=arr[i]; if(arr[j]>temp){ arr[j+1]=arr[j]; } else break; } arr[j+1]=...
ALGO
0.999973
3.557165
b38addf6-5746-49b3-87b3-f253bdd3511d
StudyingFather/my-code
Codeforces/1013C.cpp
#include <cstdio> #include <algorithm> #include <iostream> using namespace std; long long n,a[200005]; int main() { ios::sync_with_stdio(false); cin>>n; for(int i=1;i<=2*n;i++) cin>>a[i]; sort(a+1,a+2*n+1); long long ans=(a[n]-a[1])*(a[2*n]-a[n+1]); for(int i=n+1;i<2*n;i++) ans=min((a[i]-a[i-n+1])*(a[2*n]-a[1...
ALGO
0.999752
3.297446
deb3826d-58ce-4494-8272-714adc422190
suqiang0313/leetcodeByChapter
Tree/leetcode993. Cousins in Binary Tree.cpp
''' url: https://leetcode.com/problems/cousins-in-binary-tree/ title: 993. Cousins in Binary Tree describe: In a binary tree, the root node is at depth 0, and children of each depth k node are at depth k+1. Two nodes of a binary tree are cousins if they have the same depth, but have different parents. We are given th...
ALGO
0.999876
5.466825
85bf4574-d472-4f96-b3b7-3cba877555d7
liwei2088/oi
acwing/CCF/第09届/3238.cpp
#include <cstdio> #include <iostream> using namespace std; int get(int s) { if (s <= 3500) return s; int a[] = {0, 1500, 4500, 9000, 35000, 55000, 80000, 1000000}; int b[] = {0, 3, 10, 20, 25, 30, 35, 45}; int A = s - 3500; int tax = 0; for (int i = 1; i <= 7; i++) { if (A >= a[i - 1])...
ALGO
0.998368
3.197828
8f99e8c5-476c-4dd1-b213-35b238575548
aditiiilaturkar/DSA_-
20-Valid-Parentheses.cpp
class Solution { public: bool isValid(string s) { stack<char>st; for(char c: s){ if(c == '(' || c== '{' || c =='[') st.push(c); else { if(st.empty()) return false; if(c == ')' && st.top()!= '(') return false; if(c == '}' && s...
ALGO
0.999614
6.373959
29de216f-cb8e-47fd-8c37-8bfcca27ede1
firzad/COMP6771-Word-Ladder
source/find_word_ladder.cpp
#include <iostream> #include "comp6771/word_ladder.hpp" auto main() -> int { auto const english_lexicon = word_ladder::read_lexicon("./english.txt"); auto const ladders = word_ladder::generate("awake", "sleep", english_lexicon); for (auto const& ladder : ladders) { for (auto const& word : ladder) { std::cout...
TOOL
0.853373
3.864305
a06889db-f654-4c59-bb3f-06efaa7d62dd
moiahm886/Kattis
simon says.cpp
#include<iostream> #include<sstream> #include<vector> #include<string> using namespace std; int main() { cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0); int cases; cin >> cases; while (cases--) { string str; getline(cin>>ws,str); vector<string>vect; string word; istringstream ss(str); while (s...
ALGO
0.999093
3.551318
cbc493ff-d3e9-48b3-b6e4-4c7990b3db67
LightX-Project/frameworks_av
media/codecs/amrwb/dec/src/lagconceal.cpp
/* ------------------------------------------------------------------------------ Filename: lagconceal.cpp Date: 05/08/2007 ------------------------------------------------------------------------------ REVISION HISTORY Description: --------------------------------------------------------------------------...
ALGO
0.99897
7.799687
a897750c-3657-4c29-bc31-1ea7b682b7cb
OGN2017/ogncoin-source
src/rpcnet.cpp
#include "bitcoinrpc.h" #include "alert.h" #include "wallet.h" #include "db.h" #include "walletdb.h" #include "net.h" #include "ntp.h" using namespace json_spirit; using namespace std; Value getconnectioncount(const Array& params, bool fHelp) { if (fHelp || params.size() != 0) throw runtime_error( ...
WEB
0.936215
6.244516
912ee99e-156a-4b46-b1ad-9229777997b7
ishandutta2007/codeforces
al13n/normal/85/C.cpp
#include <vector> #include <cstring> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <queue> #include <iostream> #include <iomanip> #include <cstdio> #include <c...
ALGO
0.999964
3.744067
fef87364-8042-4dcf-9812-04393edba3b4
Rudra2637/DSA-Questions
Binary Search Tree Problems/Normal BST To Balanced BST.cpp
#include<bits/stdc++.h> using namespace std; template <typename T> class TreeNode { public : T data; TreeNode<T> *left; TreeNode<T> *right; TreeNode(T data) { this -> data = data; left = NULL; right = NULL; } ~TreeNod...
ALGO
0.999984
6.098662
8c1018ce-da5c-44bc-99bb-4ff4a78f304c
hieula198/OLP-ICPC
Hackerrank/11340.cpp
#include <iostream> #include <stdlib.h> #include <map> using namespace std; map <char , int> mp; float xuly(float a){ float b = a%100; return(a = a/100+ b); } main(){ freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); int cases; cin >> cases; for(int i = 0; i < cases; ++i) { int nchar...
ALGO
0.914728
3.135131
2003d0f2-28a4-48c1-beeb-c09150c5e567
raincross7/code-similarity
codes/train_code/problem054/problem054_492.cpp
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int,int>; int main() { int a, b; cin >> a >> b; for(int i=1; i<=1250; i++) { int ibuff1=i*0.08; int ibuff2=i*0.10; if (ibuff1==a && ibuff2==b) { ...
ALGO
0.999828
3.417866
3e156c4e-0d6a-4899-bc2f-6c03889e33f9
ashishsoni120/code
9-1.cpp
#include <iostream> #include <limits> // For input validation using namespace std; // Function to safely read numerical input with validation double getValidInput(const string& prompt) { double value; while (true) { cout << prompt; cin >> value; // Check for valid numeric input ...
TOOL
0.89796
6.309366
b38878e3-3dd2-4788-bbd3-53f469ca17de
mwien/problemsolving
gcpc2021/e.cpp
#include<iostream> #include<algorithm> #include<vector> using namespace std; pair<int, pair<int, int>> edges[100005]; pair<int, int> qs[100005]; int dist[100005]; long long res[100005]; int main() { int n, m; cin >> n >> m; for(int i = 1; i <= m; ++i) { int a, d, c; cin >> a >> d >> c; edges[i] = {c,...
ALGO
0.999892
3.983454
8f036d52-1a3b-4ae4-a3f5-d4bac2de3da4
Gurupradeep/Codes
Codechef - Contests/COOK60/COPS.cpp
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int t,a[102],m,s,tm,b; cin>>t; while(t--) { cin>>m>>s>>tm; for(int i=0;...
ALGO
0.999002
3.20662
d1efc83d-b8c8-4779-98ad-ef2eea37e4e1
SETURAJ/LeetCode-Solutions
number-of-matching-subsequences/Wrong Answer/7-20-2022, 5_10_18 AM/Solution.cpp
// https://leetcode.com/problems/number-of-matching-subsequences class Solution { public: int numMatchingSubseq(string s, vector<string>& words) { unordered_map<char,int>umap; unordered_map<char,int>track; for(int i=0;i<s.length();i++) umap[s[i]]++; track=umap; i...
ALGO
0.999992
5.914965
71d84709-4a75-4aaf-a767-4ede5ab1e6a8
Abhishekkumarr2001/C-CPP-Programming
CPP-Intermediate-Level/PassingObjectasFunctionArguments.cpp
// Passing Objects As Function Arguments #include <iostream.h> #include <conio.h> #include <stdlib.h> class Distance { int feet, inches; public: void getdata(int f, int i) { feet = f; inches = i; } void printit(void) { cout << feet << " feet " << inches << " inches "...
TOOL
0.979908
5.888246
ceb5bf85-5b71-42fb-b6ae-d57a230058c1
davidscmx/motion-planning-carla-simulator
project/starter_files/eigen-3.3.7/doc/examples/Tutorial_BlockOperations_corner.cpp
#include <Eigen/Dense> #include <iostream> using namespace std; int main() { Eigen::Matrix4f m; m << 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11,12, 13,14,15,16; cout << "m.leftCols(2) =" << endl << m.leftCols(2) << endl << endl; cout << "m.bottomRows<2>() =" << endl << m.bottomRows<2>() << endl << ...
ALGO
0.999163
4.092313
407c6644-1aff-4b69-84d7-8656b8c72903
hsoft-star/CLeetcode
261. Graph Valid Tree.cpp
class Solution { private: bool hasCycle(vector<vector<int>>& es, int node, int parent, vector<int>& seen) { if (seen[node]) return true; seen[node] = 1; for (const auto& c : es[node]) { if (c != parent && hasCycle(es, c, node, seen)) return true; } return false; ...
ALGO
0.999857
6.48889
e35aa432-c378-4d89-904b-c23eff45ec88
manhhung2111/LeetcodeGrind
Day 049/Problem 55. Jump Game.cpp
class Solution { public: unordered_map<int, bool> dp; bool solve(int index, vector<int> &nums) { if (index == nums.size() - 1) { return true; } if (dp.find(index) != dp.end()) { return dp[index]; } for (int i = 1; i <= nums[index]; i++) { ...
ALGO
0.999992
6.386871
a53574b3-3f11-4848-a28e-6cd4ae9fe1ac
leoplibero/app_bitcoin
app_atm/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.99852
6.76775
569c00cd-06c1-4f94-9528-1abbc80e7ab9
awesomemin/baekjoon
1065/main.cpp
#include <iostream> int isHansu(int num) { if(num < 100) { return 1; } if(num == 1000) { return 0; } int digit_1 = num / 100; int digit_2 = (num / 10) % 10; int digit_3 = num % 10; if(digit_1 - digit_2 == digit_2 - digit_3) { return 1; } else { return 0; } } int main() { int N; std::ci...
ALGO
0.999612
4.786775
f96b2a70-cf8c-44cb-839b-291ed47a366d
kasa021/atcoder-archives
abc247/abc247_c_31316921_WA.cpp
/* * Author: kAsA02 * Submission URL: https://atcoder.jp/contests/abc247/submissions/31316921 * Submitted at: 2022-04-28 04:58:46 * Problem URL: https://atcoder.jp/contests/abc247/tasks/abc247_c * Result: WA * Execution Time: 7 ms */ #include <bits/stdc++.h> using namespace std; void S(int n){ if(n = 1) { ...
ALGO
0.999897
4.648088
d8b30f03-b839-4035-aac9-92322586f645
mariokonrad/maze
MazeGraph.cpp
#include "MazeGraph.hpp" #include <iostream> using namespace std; void MazeGraph::clear() { if (adj) { delete[] adj; adj = 0; } } void MazeGraph::init() { clear(); if (n_n == 0) return; adj = new unsigned char[n_n*n_n]; clean(); } MazeGraph::MazeGraph(const Maze & m, bool do_capture) : adj(0) { n_x = m....
ALGO
0.922814
4.8274
d2bafc0d-f030-46fb-ba1c-49323ad26da8
sarvex/leetcode-clojure
solution/1000-1099/1041.Robot Bounded In Circle/Solution.cpp
class Solution { public: bool isRobotBounded(string instructions) { int dist[4]{}; int k = 0; for (char& c : instructions) { if (c == 'L') { k = (k + 1) % 4; } else if (c == 'R') { k = (k + 3) % 4; } else { +...
ALGO
0.999961
6.130253
862542fa-f9e3-415a-8dd0-fb92135d036e
jimmehc/fyp
new/nice_interface/overhead_to_sequential2.cpp
#include "biasedlock.h" #include "../lib/biased_sync.h" #include "../../lib/timing.h" #include "../constants.h" #include <iostream> #include <pthread.h> #define NUM_ITS 1000000 volatile unsigned long long start; void inc(shared_data<int> * sd, void* params = NULL){ sd->d++; } void foo(threaddata<int> * td) { for(...
TOOL
0.976492
5.438344
eb369b00-ef41-4b79-bb68-7b2750ef3f5c
SURYANSH0123/Assignment_BTech2026_2201921530179
0007-reverse-integer/0007-reverse-integer.cpp
class Solution { public: int reverse(int x) { long long sum =0,ans=0; while(x!=0){ ans = x%10; sum = (sum*10)+ans; x=x/10; } if(sum>INT_MAX || sum < INT_MIN) return 0; return sum; } };
ALGO
0.99996
5.863244
636ff931-31b8-43b2-9656-1f633afbd729
eric-erki/opencv
modules/calib3d/src/ptsetreg.cpp
#include "precomp.hpp" #include <algorithm> #include <iterator> #include <limits> namespace cv { int RANSACUpdateNumIters( double p, double ep, int modelPoints, int maxIters ) { if( modelPoints <= 0 ) CV_Error( Error::StsOutOfRange, "the number of model points should be positive" ); p = MAX(p, 0.); ...
ALGO
0.999086
6.705051
470d0223-ec7f-4bfd-a103-6cdbd36c198f
Ruslan721/SquareSolve
SolveSquare.cpp
#include "SqrHeader.h" #include <cstdio> //----------------------------------------------- void Input_Sqr_Solution(Equality_Coeff* const Sqr_Input) //-> //(*test).a { assert(Sqr_Input != 0); int num = 0, Flag = -1; while (Flag == -1) { printf( "\n \n" ...
ALGO
0.99935
3.8381
1e7fc082-dd77-4dea-bf71-f000874816b3
still-nikk/DSAinCPP
Revisit/lc977SquareOfSortedArray.cpp
#include <bits/stdc++.h> using namespace std; vector<int> sortedSquares(vector<int> &nums) { vector<int> ans; if (nums.empty()) return ans; int s = 0; int e = nums.size() - 1; while (s <= e) { int squares = nums[s] * nums[s]; int squaree = nums[e] * nums[e]; if (...
ALGO
0.999936
5.502836
04b67a52-670f-4445-9daa-9d526dff8243
kasettakorn/Algorithms
Greedy/ColorPair.cpp
#include <iostream> #include <cstring> #include <algorithm> using namespace std; typedef struct { char color; int value; } Item; bool comparator(Item item1, Item item2) { return item1.color < item2.color; } int main() { int n; cin >> n; Item items[n]; int MAX_VALUE[26]; memset(MAX_VALUE,...
ALGO
0.999734
4.879258
1551bf26-8051-43e0-8651-11ca103da447
mostafaelwahsh/Cpp-Labs-ITI-intake-45
Day03/Day03.cpp
#pragma region GeoShape #include <iostream> using namespace std; class GeoShape { protected: float dim1; float dim2; public: GeoShape(float a, float b) { dim1 = a; dim2 = b; } float getDim1() { return dim1; } float getDim2() { return dim2; } virtual float area() = 0; }; ...
TOOL
0.99642
4.325452
6e40f843-50d2-4f97-932c-d7b2f9df2bda
felrock/aoc20
day1/day1.cpp
#include <iostream> #include <fstream> #include <unordered_set> #include <vector> int main(int argc, char** argv) { std::unordered_set<int> previous; std::fstream file("input.txt"); std::string s; std::vector<int> numbers; // part one while(std::getline(file, s)) { int i = std::sto...
ALGO
0.998192
4.249408
e23a00fa-5849-43cf-8f3e-bd4d88ba928d
shyam2520/DSA
743-network-delay-time/743-network-delay-time.cpp
class Solution { public: int networkDelayTime(vector<vector<int>>& times, int n, int k) { vector<int> time(n+1,INT_MAX); int u,v,w; time[k]=0; for(int i=0;i<n;i++) { for(auto& vec:times) { u=vec[0]; v=vec[1]; ...
ALGO
0.999985
5.768024
58761425-c0ae-4691-ba78-9901b1e082bb
RyanAlexanderSingh/TerrainGeneration
octet/open_source/bullet/BulletCollision/CollisionShapes/btConvexShape.cpp
#if defined (_WIN32) || defined (__i386__) #define BT_USE_SSE_IN_API #endif #include "btConvexShape.h" #include "btTriangleShape.h" #include "btSphereShape.h" #include "btCylinderShape.h" #include "btConeShape.h" #include "btCapsuleShape.h" #include "btConvexHullShape.h" #include "btConvexPointCloudShape.h" ///not su...
ALGO
0.994303
7.671949
40dc441d-1da7-44f1-a729-3a2c1e497400
RajMakkad/LeetCode
32-longest-valid-parentheses/32-longest-valid-parentheses.cpp
class Solution { public: int longestValidParentheses(string s) { int n = s.length(); int ans = 0; stack<int> st; vector<int> dp(n + 1,0); for(int i = 1;i<=n;i++){ if(s[i - 1] == '(') st.push(i); else if(!st.empty()) { int x = st.top();...
ALGO
0.999909
5.852859
335de5e6-ec1d-4027-8297-87672f6af31d
cjl3230/SOUI2.backup
SOUI/src/animator/SInterpolatorImpl.cpp
#include "souistd.h" #include "animator\SInterpolatorImpl.h" #include "layout/SLayoutSize.h" //for SLayoutSize::fequal #pragma warning (push) #pragma warning (disable: 4985) // disable the warning message during the include #include <math.h> // this is where I would normally get the warning message #pragm...
ALGO
0.87511
5.062559
39994eee-6245-42a5-a024-2bb06860b419
ishandutta2007/codeforces
kan/normal/822/D.cpp
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #define eprintf(...) fprintf(stderr, __VA_ARGS__) #else #define eprintf(...) 42 #endif using ll = long long; using ld = long double; using D = double; using uint = unsigned int; template<typename T> using pair2 = pair<T, T>; using pii = pair<int, int...
ALGO
0.999945
3.871504
c08ed808-44db-49e8-bd64-fabf1aef824d
greenfox-zerda-sparta/nagyzsuska
week2/day-2/2.06.cpp
#include <iostream> #include <string> using namespace std; int main() { int f[] = {3, 4, 5, 6, 7}; // Please double all the elements, than print all of them int length = sizeof(f)/sizeof(int); for (int i = 0; i < length; i++){ f[i]*=2; cout << f[i] << endl; } return 0; }
ALGO
0.998444
3.535975
84a9a81b-5d84-4bb5-a49d-0c07b0fa09f1
4C-multiphysics/4C
src/fluid_ele/4C_fluid_ele_poro_boundary_evaluate.cpp
#include "4C_fluid_ele_action.hpp" #include "4C_fluid_ele_boundary_calc.hpp" #include "4C_fluid_ele_boundary_factory.hpp" #include "4C_fluid_ele_poro.hpp" #include "4C_inpar_fluid.hpp" #include <Teuchos_StandardParameterEntryValidators.hpp> FOUR_C_NAMESPACE_OPEN int Discret::Elements::FluidPoroBoundary::evaluate(Teu...
TOOL
0.979555
6.459223
1717aad1-d6a6-4c95-9262-c4301d880c62
chiro2001/GEM5-xs-learn
src/systemc/tests/systemc/misc/unit/aproc_halt/disaproc3/disaproc3.cpp
/***************************************************************************** disaproc3.cpp -- Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 *****************************************************************************/ /**************************************************************************...
TOOL
0.938557
5.509825
8e628e54-ce17-4ef3-a13c-7a204fd78276
faiem/Data-Structure-and-Algorithms
10_LinkedList/DoublyLinkedList.cpp
#include <bits/stdc++.h> using namespace std; #define MIN(a,b) (((a)<(b))?(a):(b)) #define MAX(a,b) (((a)>(b))?(a):(b)) struct Node { int data; Node* prev; Node* next; Node(int value) { data = value; prev = NULL; next = NULL; } }; Node* InsertAtBegin(Node* head, int ...
ALGO
0.999205
4.460905
04299af2-e54a-4673-a58e-480ce83b64d7
aKiii017/SolSearch
implementation/z3/src/muz/spacer/spacer_proof_utils.cpp
#include "util/params.h" #include "ast/ast_pp.h" #include "ast/ast_util.h" #include "ast/proofs/proof_checker.h" #include "muz/base/dl_util.h" #include "muz/spacer/spacer_iuc_proof.h" #include "ast/proofs/proof_utils.h" #include "muz/spacer/spacer_proof_utils.h" #include "muz/spacer/spacer_util.h" namespace spacer { ...
ALGO
0.994294
3.421301
323c5d87-cc34-4fc4-a7c5-e17ac4a9759a
speakingIce/leetcode-code
DP/Problem 1139.cpp
1139. Largest 1-Bordered Square Medium 57 20 Favorite Share Given a 2D grid of 0s and 1s, return the number of elements in the largest square subgrid that has all 1s on its border, or 0 if such a subgrid doesn't exist in the grid. Example 1: Input: grid = [[1,1,1],[1,0,1],[1,1,1]] Output: 9 Example 2: Input: gri...
ALGO
0.999975
5.96966
96a5dea8-a1d7-4df6-9435-c7f825d2cb39
marsiitr/Chitrak-2.0
src/CODE/static Walking/kitty_math.cpp
#include <iostream> #include <math.h> using namespace std; double a = 26.0, b = 23.4, c = 0; double x, y, angle; double theta1, theta2; double cosine1(){ return (acos((a*a + c*c - b*b)/(2*a*c)))*90/acos(0); } double cosine2(){ return (acos((a*a + b*b - c*c)/(2*a*b)))*90/acos(0); } int main() { x = 16; y = -4...
ALGO
0.998851
3.571614
fcf4aaa9-df98-4e10-bebb-d5aec65711fa
openkylin/boost1.74
libs/graph/example/actor_clustering.cpp
// Authors: Douglas Gregor // Andrew Lumsdaine // This program performs betweenness centrality (BC) clustering on the // actor collaboration graph available at // http://www.nd.edu/~networks/resources/actor/actor.dat.gz and outputs the // result of clustering in Pajek format. // // This program mimics the B...
ALGO
0.999169
7.541458
b1c7e9fc-cb52-4d96-8e1c-8bf8fc428443
alpha079/LeetCode-Problems
567-permutation-in-string/567-permutation-in-string.cpp
class Solution { public: // Time complexity: O(n * 26) = O(n) // Time space: O(26 * 2) = O(1) bool areVectorEqual(vector<int>&a, vector<int>& b) { for(int i=0; i<26; i++){ if(a[i]!=b[i]) return false; } return true; } bool checkInclusion(string s1, string s2)...
ALGO
0.999967
6.378582
cbcbb4de-820d-4087-8f3d-c87399d94342
antoniocenlaces/programacion2
practica2/funcionesPilaEnt.cpp
#include <iostream> #include <iomanip> using namespace std; // Tipo PilaEnt y operaciones básicas para el trabajo con pilas de datos #include "pilaEnt.hpp" // * Notación empleada en las especificaciones: // p = [] La pila p está vacía, es decir, almacena 0 datos // p = [d_1, d_2, ..., d_K] la pila p almacena K dato...
TOOL
0.992727
4.158334
3fb2fbdd-4c83-4e98-998a-3eb552c2e4bc
hvantil/ParallelMolecularDynamics
src/MolDynSim.cpp
#include "MolDynSim.h" MolDynSim::~MolDynSim() { outProps.close(); outPos.close(); } double MolDynSim::PeriodicBcDist(int i,int j) { double xi,yi,zi; atoms[i].GetPos(xi,yi,zi); double xj,yj,zj; atoms[j].GetPos(xj,yj,zj); Vec3 d; d.Set(xi-xj,yi-yj,zi-zj); if((d.x < -sz.x/2.0) && (d.x > -sz.x)) { d.x += s...
ALGO
0.996704
4.96316
65138026-bc96-402c-97d0-1d7dbd7cadb6
adityajamwal02/LeetcodeProblemSet1
ShortestPathToGetAllKeys.cpp
/* You are given an m x n grid grid where: '.' is an empty cell. '#' is a wall. '@' is the starting point. Lowercase letters represent keys. Uppercase letters represent locks. You start at the starting point and one move consists of walking one space in one of the four cardinal directions. You cannot walk outside the g...
ALGO
0.999837
5.905464