uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
858e87ed-865f-4b6c-8b9f-32fbda7f2631
AOF-Dev/mesa-swdroid
src/gallium/drivers/swr/rasterizer/common/os.cpp
#include "common/os.h" #include <vector> #include <array> #include <sstream> #if defined(_WIN32) #include <shlobj.h> #endif // Windows #if defined(__APPLE__) || defined(FORCE_LINUX) || defined(__linux__) || defined(__gnu_linux__) #include <pthread.h> #endif // Linux #if defined(_MSC_VER) static const DWORD MS_VC_EXC...
TOOL
0.928504
6.246434
d547af36-b439-4ab2-8adc-e9e63a303ea3
adrian-stanciu/adventofcode
2023/07/main.cpp
#include <bits/stdc++.h> using namespace std; static constexpr array Cards{ '2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K', 'A' }; static constexpr auto NumCards{ssize(Cards)}; static constexpr auto CardsWithJoker = []() { array<char, NumCards> cards_with_joker; cards_with_joker[0] = 'J'; ...
ALGO
0.999639
5.262468
709d486c-9408-43eb-ad86-c1399e158e51
2atharva21/c-
4_Loops in C++/revision part1-of-c++/problem-on-loops-part1/solid-triangle.cpp
#include <iostream> using namespace std; int main (){ int n;//rows cout<<"enter the rows k:"; cin>>n; // int m; // cout<<"enter the colums :"; // cin>>m; for(int i=1;i<=n;i++){//rows for(int j=1;j<=n;j++){//colums. cout<<"* "; } cout<<endl; } }
ALGO
0.998287
3.405249
9f46f230-7126-4aaa-b339-f7867b1bcd9b
avinashz14/DSA-Problems
count_binary_digits.cpp
int count_binary_digits(ll a) { int cnt=0; while (a) { cnt++; a>>=1; } return cnt; }
ALGO
0.999014
4.806311
6bbb5549-21f6-428a-97f3-26ababb81c4a
Maiwosz/Vulkan3DEngine
Libs/imgui/misc/fonts/binary_to_compressed_c.cpp
// dear imgui // (binary_to_compressed_c.cpp) // Helper tool to turn a file into a C array, if you want to embed font data in your source code. // The data is first compressed with stb_compress() to reduce source code size. // Then stored in a C array: // - Base85: ~5 bytes of source code for 4 bytes of input data. ...
TOOL
0.934944
7.095417
82b40186-112c-4ccb-a88e-1a5d33d91707
algo-algo/algorithm-practice
yj.l/prev/programmers/2019kakaointern/hotelroom.cpp
//#include<iostream> //#include <string> //#include <vector> // //using namespace std; // //class Room { //public: // long long start, len; // Room(long long start, long long len) : start(start), len(len) {} // bool operator==(const Room &rhs) const { // return rhs.start >= start && rhs.start <= start +...
ALGO
0.999975
4.681555
23ae5d83-80e3-4abc-9eb4-bb4adf1e13ee
tuanduong3001/homework3.5
2.10.cpp
#include<iostream> using namespace std; int flipNumber(int n) { int s = 0; while (n > 0) { int tmp =n % 10; s = s * 10 + tmp; n /= 10; } return s; } int main() { int n; cin >> n; cout << flipNumber(n); }
ALGO
0.999655
4.022243
2bcbc889-8ebf-4445-8a05-2bcc2c8bef39
itspiyush3451/Data-Structure
Array/repeatOnce.cpp
// Given a non-empty array of integers nums, every element appears twice except for one. Find that single one. // You must implement a solution with a linear runtime complexity and use only constant extra space. // Example: // Input: nums = [4,1,2,1,2] // Output: 4 #include<bits/stdc++.h> using namespace std; int o...
ALGO
0.999691
5.872967
55771dc6-e7a5-4327-8d70-67ce518d65b1
gauravasodariya/leetcode_questions
1995-finding-pairs-with-a-certain-sum/1995-finding-pairs-with-a-certain-sum.cpp
class FindSumPairs { public: vector<int>v1; vector<int>v2; unordered_map<int,int>mp; FindSumPairs(vector<int>& nums1, vector<int>& nums2) { v1=nums1; v2=nums2; for(auto num : v2) { mp[num]++; } } void add(int index, int val) { ...
ALGO
0.999882
6.017697
77730652-1aaf-41a8-b0c0-3989e5113118
TheFenrisLycaon/DSA-C--
cp/CodeForces/0100-0199/154A.cpp
#include <cstdio> #include <iostream> #include <iostream> int main(){ std::string input; getline(std::cin, input); int k; scanf("%d\n", &k); long total(0); for(int p = 0; p < k; p++){ std::string forbidden; getline(std::cin, forbidden); //std::cout << "Pair: " << forbidden << std::end...
ALGO
0.999527
3.84982
96470e31-9395-4931-91c7-0679658c6b7d
bienhuynh/Big-Numbers
Lib/Src/Math/Newton.cpp
#include "pch.h" #include <iostream> #include <Math/MathException.h> //#define DEBUGNEWTON /* ------------------ Newton raphson iteration --------- */ /* Implements Newton-Raphson iteration as described in "A first course in numerical analysis", Ralston & Rabinowitz 2. ed. p. 361 */ /* computes x so that f(x) ...
ALGO
0.999537
5.554967
5f470929-3aea-4b0b-a4df-90c926b758d9
ishandutta2007/codeforces
lucyanna2018/normal/768/F.cpp
#include<stdio.h> int F,W,H; int fac[222222],ifac[222222]; #define mod 1000000007 int add(int x,int y){ return (x+=y)<mod?x:x-mod; } int mul(int x,int y){ return (int)((long long int)x*y%mod); } int pw(int x,int y){ int r=1; while(1){ if(y&1)r=mul(r,x); if(y>>=1)x=mul(x,x);else break; } return r; } int in...
ALGO
0.999942
4.261133
0ab69354-dbd9-4816-bde0-86d865cf7072
ishandutta2007/codeforces
vepifanov/normal/86/B.cpp
#include <cstdio> #include <iostream> #include <vector> #include <set> #include <cstring> #include <string> #include <map> #include <cmath> #include <ctime> #include <algorithm> #include <bitset> #include <queue> #include <sstream> using namespace std; #define mp make_pair #define pb push_back #define rep(i,n) for(in...
ALGO
0.99992
3.466244
691543de-3615-4041-a40d-820e593babda
jesuswr/cp-codes-and-problems
H.hurgando.cpp
#include <iostream> #include <vector> #include <queue> #include <stack> #include <algorithm> #include <math.h> #include <string> #include <cstring> #include <set> #include <map> #include <unordered_map> #include <assert.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<int, pair<i...
ALGO
0.999851
4.123405
34d8f65c-9dbd-422c-bdc7-ac9182966f69
siddh61103/DSA
0452-minimum-number-of-arrows-to-burst-balloons/0452-minimum-number-of-arrows-to-burst-balloons.cpp
class Solution { public: int findMinArrowShots(vector<vector<int>>& points) { sort(points.begin(),points.end()); vector<vector<int>> vec; vec.push_back(points[0]); for(int i=1;i<points.size();i++){ if(vec.back()[1]<points[i][0]){ vec.push_back(points[i]); ...
ALGO
0.999993
6.360267
e805bba6-5cf9-4047-8f17-b49983cf468c
xuqing-ict/BackupCode
CC150/p1.3.cpp
#include <bits/stdc++.h> using namespace std; bool isSameWord(string s, string t) { if (s.size() != t.size()) { return false; } int exist[256] = {0}; for(auto c : s) exist[c]++; for(auto c: t) { if(--exist[c] < 0) return false; } return true; } int main() { string s = "12 345 "; string t = "34...
ALGO
0.994674
3.948617
165036c3-25ee-4fd7-84cd-4da15283bdf5
Ujwal-Gaonkar/Ds-Algo-
mathematics/gcdlcm.cpp
#include<bits/stdc++.h> using namespace std; int gcd(int n1,int n2) { return (n2==0 ? n1 : gcd(n2, n1%n2)); } int lcm(int n1,int n2) { return (n1*n2)/gcd(n1,n2); } int main() { int num1,num2; cin>>num1>>num2; cout<<gcd(num1,num2)<<endl; cout<<lcm(num1,num2)<<endl; return 0; }
ALGO
0.999944
3.70869
64bf64c9-3add-4a50-990d-e6aba9d47433
GaussGreen/old-code
JP/code/drlib/products/src/PickRainbow.cpp
//---------------------------------------------------------------------------- // // Group : EDG Derivatives Research // // Filename : PickRainbow.cpp // // Description : Port of DropRainbow and PickRainbowFloor models from EDG // At selected dates can pick or drop a number of the best/wo...
ALGO
0.99304
6.548512
b9bdd328-759a-4478-adf2-ecc741b4ad74
kbc19b02/UD
GameTemplate/Game/bulletPhysics/src/Bullet3OpenCL/BroadphaseCollision/b3GpuParallelLinearBvh.cpp
/* This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it f...
ALGO
0.996896
7.404794
e3318219-e4d7-4869-bed9-eaa9c861a194
CathyF9600/computer-graphics-bounding-volume-hierarchy
libigl/include/igl/sample_edges.cpp
IGL_INLINE void igl::sample_edges( const Eigen::MatrixXd & V, const Eigen::MatrixXi & E, const int k, Eigen::MatrixXd & S) { using namespace Eigen; // Resize output S.resize(V.rows() + k * E.rows(),V.cols()); // Copy V at front of S S.block(0,0,V.rows(),V.cols()) = V; // loop over edges for(int i...
ALGO
0.999224
3.471132
ceb1c75c-9161-4b72-aced-212fb8b0db22
Deepanshu-Sharma-18/leethub
0008-string-to-integer-atoi/0008-string-to-integer-atoi.cpp
class Solution { public: int myAtoi(string s) { long long ans = 0; bool pos = true; bool f = false; bool sign = false; for(auto it : s){ if(it == '-' && !f && !sign){ pos = false; sign = true; f = true; ...
ALGO
0.999695
5.186366
1c0e3dc8-35c4-4c7c-abed-5aa5de0505f8
sarvex/leetcode-erlang
solution/0400-0499/0486.Predict the Winner/Solution.cpp
class Solution { public: vector<vector<int>> f; vector<int> s; bool PredictTheWinner(vector<int>& nums) { int n = nums.size(); s.resize(n + 1); for (int i = 0; i < n; ++i) { s[i + 1] = s[i] + nums[i]; } f.assign(n + 1, vector<int>(n + 1, -1)); ret...
ALGO
0.999995
5.831799
2b253a87-f41b-4d0e-95d4-4140786762d9
magnusjahre/parvec
pkgs/libs/tbblib/src/examples/parallel_for/tachyon/src/triangle.cpp
/* * triangle.c - This file contains the functions for dealing with triangles. * * $Id: triangle.cpp,v <IP_ADDRESS> 2012/03/29 17:22:19 uid42307 Exp $ */ #include "machine.h" #include "types.h" #include "vector.h" #include "macros.h" #include "intersect.h" #include "util.h" #define TRIANGLE_PRIVATE #include "t...
ALGO
0.976109
7.720812
1de10601-e534-4a20-9a66-d79168d2a1c4
Visssky/HPC
HPC-Assignments-main/Parallel_Min_Max.cpp
#include <bits/stdc++.h> #include <vector> #include <omp.h> using namespace std; void min_reduction(vector<int> &arr) { int min_value = INT_MAX; #pragma omp parallel for reduction(min : min_value) for (int i = 0; i < arr.size(); i++) { if (arr[i] < min_value) { min_value = arr[...
ALGO
0.998478
4.632415
7c275bfd-5dce-43b9-bbab-05136a3bbdbb
GuacheSuede/MSSubmission1234567890
submission/rsi/boost_1_69_0/libs/graph/example/cycle_ratio_example.cpp
#include <cassert> #include <ctime> #include <boost/random/mersenne_twister.hpp> #include <boost/random/uniform_real.hpp> #include <boost/graph/adjacency_list.hpp> #include <boost/graph/random.hpp> #include <boost/graph/howard_cycle_ratio.hpp> /** * @author Dmitry Bufistov * @author Andrey Parfenov */ using namesp...
ALGO
0.993697
5.50192
7ad526dc-4cd6-4192-b2ef-af32b244d597
ishandutta2007/codeforces
um_nik/normal/853/B.cpp
#include <iostream> #include <cstdio> #include <cstdlib> #include <algorithm> #include <cmath> #include <vector> #include <set> #include <map> #include <unordered_set> #include <unordered_map> #include <queue> #include <ctime> #include <cassert> #include <complex> #include <string> #include <cstring> using namespace st...
ALGO
0.999944
3.491708
29284e88-3681-4006-8679-4d8ece679088
rrraine/CPP_Programming
16. Finals/2. QuickSort/main.cpp
//#include <bits/stdc++.h> #include <iostream> #include <cstdlib> using namespace std; int* arr; int n; void print(); void sort_pivot(int left, int right); int main(void){ cout << "Enter number of elements: "; cin >> n; arr = (int*) malloc(n * sizeof(int)); for (int i = 0; i < n; i++) { cout <...
ALGO
0.999273
4.422555
83f339bc-7b5d-4d14-8480-7220fd89809b
NIKKU-29/PLACExFREE
ACCENTURE/ACCENTURE(SNAKE_WATER_GUN-2024)/code.cpp
// #include <bits/stdc++.h> // using namespace std; // //aim is to calculate the numer of time 'A' person wins // int find_wins(vector<char>& Turns) // { // int count=0; // for(int i=0;i<Turns.size();i+=2) // { // if(Turns[i]=='s' && Turns[i+1]=='w' || Turns[i]=='w' && Turns[i+1]=='g' || Turns[i]=...
ALGO
0.999698
4.648787
2dbc228d-26ce-4df9-b836-60960741e4ce
Adityag0243/CP-DSA
codeforce/contest4pw/battleCow.cpp
#include <bits/stdc++.h> using namespace std; int search(int a,int j,vector<int> &v){ int ans=v.size(); if(j==v.size()+1){ return ans; } for(int i=j;i<v.size();i++){ if(v[i]>a){ ans=i; break; } } return ans; } int main(){ int t; cin>>t; ...
ALGO
0.999945
3.60831
365fbe39-1b79-491f-9cf4-4a8cc5c46ecb
DolbyLaboratories/caf-platform-frameworks-av
media/libstagefright/codecs/amrnb/enc/src/calc_en.cpp
/* ------------------------------------------------------------------------------ Pathname: ./audio/gsm-amr/c/src/calc_en.c Funtions: calc_unfilt_energies calc_filt_energies calc_target_energy ------------------------------------------------------------------------------ MODULE DESCRIPTION ...
ALGO
0.999328
5.866442
c045383b-6c7e-4091-b01c-2ef5f10a6e14
YEAjiJUNG/AlgorithmPractice
Baekjoon/2292.cpp
#include <iostream> using namespace std; int main() { int n; int sum = 1, cnt = 0; cin >> n; if(n == 1) { cout << 1 << endl; return 0; } for(int i = 0; i < n; i++) { sum += 6 * i; if(sum >= n) { cnt = i+1; break; ...
ALGO
0.999853
3.458755
ae274071-d3f1-492e-9baf-cbaabfea93dc
Marlin-Phone/code
cpp/luogu/Luogu_P_1746.cpp
#include <algorithm> #include <cstring> #include <iostream> #include <queue> using namespace std; #define endl "\n" const int N = 1e3 + 10; int n; char g[N][N]; queue<pair<int, int>> q; int dist[N][N]; int dx[4] = {-1, 0, 1, 0}; int dy[4] = {0, 1, 0, -1}; int x1, y1, x2, y2; int bfs(int x, int y) { q.push({x, y})...
ALGO
0.999684
5.363714
b5cf6a4e-54e7-4b3e-a953-8fe9da8b456c
nguyendangcuong201004/DSA
SAP XEP - TIM KIEM/Bài 38. Liên hoan phim.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; bool cmp(pair<int, int> a, pair<int, int> b){ return a.second < b.second; } int main(){ int n; cin >> n; pair <int, int> a[n]; for (int i = 0; i < n; i++){ cin >> a[i].first >> a[i].second; } sort (a, a + n, cmp); ...
ALGO
0.999961
4.720668
3a5e803d-fc26-4058-b246-e6d3e120205b
dmitry-vlasov/mdl-old
src/mdl/prover/strategy/mdl_prover_strategy_Directed.cpp
/*****************************************************************************/ /* Project name: mdl - mathematics development language */ /* File Name: mdl_prover_strategy_Directed.hpp */ /* Description: directed strategy */ ...
ALGO
0.922323
5.176302
2f0e663d-7934-4459-9056-96556f16c63c
AshrafByte/Digital-Discrete
Task 4/main.cpp
#include <iostream> using namespace std; int modInverse(int a, int m) { for (int x = 1; x < m; ++x) { if ((a * x) % m == 1) return x; } return -1; // No modular inverse exists } int main() { string s; cout<<"enter the string you want to decipher:\n"; getline(cin,s); in...
ALGO
0.999885
4.913148
78718903-83fa-4a39-b9cd-c0169cd6afad
Tarun0312/DSA-Supreme
Week7/Live/RecursionLevel3/2binarySearchUsingRE.cpp
#include<iostream> using namespace std; int binarySearch(int arr[],int start,int end,int target){ if(start>end){ //element not found return -1; } //processing int mid = start + (end-start)/2; if(arr[mid]==target){ return mid; }else if(arr[mid]>target){ //left...
ALGO
0.999904
5.756065
277da8cd-ff43-4232-b62f-6a23895e2fbf
gongtao0607/BlackboxCC3D
BlackboxCC3D-CoIDE/morsecode/morsecode.cpp
#include <stdint.h> #include <stdio.h> #include <stm32f10x.h> #include <string.h> #include "delay.h" #include <ctype.h> #include "morsecode.h" char morse_string[MORSE_STRING_SIZE]={}; static const uint8_t morse_alpha[] = { 0b10000010, 0b01110100, 0b01010100, 0b01100011, 0b10000001, 0b11010100, 0b001000...
TOOL
0.874882
3.57935
d42dfa21-0620-492e-9f47-133710d07d2c
numenoreon/LeetCode
Problems/ImplementstrStr().cpp
class Solution { public: int strStr(string haystack, string needle) { if (needle == "") return 0; auto it = haystack.find(needle); if (it == std::string::npos) return -1; return it; } }; ______________________________________________________________...
ALGO
0.999777
6.198308
f88d5927-7e09-41c0-89f8-77a3de87781c
Lennix/mangoszeroold
dep/src/g3dlite/Crypto_md5.cpp
/** @file Crypto_md5.cpp @author Morgan McGuire, http://graphics.cs.williams.edu Copyright 2006-2007, Morgan McGuire. All rights reserved. @created 2006-03-28 @edited 2006-04-06 */ #include "G3D/platform.h" #include "G3D/Crypto.h" #include "G3D/BinaryInput.h" #include "G3D/BinaryOutput.h" #include <cstring>...
ALGO
0.920852
7.18831
d70db717-ca6e-4938-a769-b0e4504f394a
AmberQZ/homework
2018.11.22/5.3.2.cpp
#include<iostream> #include<cstdlib> #include<ctime> using namespace std; class Dice { public: int run() { return (rand() % 6 + 1); } }; class Gambler { public: void play() { int num1, num2, num3; num1 = a.run(); num2 = b.run(); num3 = c.run(); if (num1 == num2 && num2 == num3) cout << num1 << " "...
ALGO
0.963565
3.529995
96a92eb1-13e6-4378-a238-2fb2444d28dd
morymobile/algos
sort/quick_sort_index.cpp
#include <vector> #include <iostream> #include <algorithm> int sortPartition(std::vector<int> &numbers, int start, int end, std::vector<int> &indices) { const int x = numbers[end]; int i = start - 1; for (int j = start; j < end; ++j) { if (numbers[j] <= x) { i = i+1; if (i !...
ALGO
0.999974
5.365356
dd439924-35a2-48e2-bb0c-994a5c666acf
FabioRocha2227/DA_Project1
src/carrinhas.cpp
// // Created by nmls1 on 13/04/2022. // #include "carrinhas.h" #include "encomendas.h" #include <string> #include <fstream> #include <iostream> #include <iomanip> #include <algorithm> #include <cmath> #include <map> Truck::Truck() {} Truck::Truck(int maxVol, int maxWeight, int cost) { this->maxVol = maxVol; ...
ALGO
0.987438
4.457358
a6b0fc37-01d5-4df1-8b53-c74253c2ae93
Ikra24Sidd/CPP_SEM5
BASIC/Calculator.cpp
#include <bits/stdc++.h> using namespace std; int main() { float a, b; char opr; cout << "\n Enter the operation to perform: "; cin >> opr; cout << "Enter the two values: "; cin >> a >> b; switch (opr) { case '+': cout << "\n" << a << " + " << b << " = " << a + b; break; case '-': cout << "\n" << a << " - "...
TOOL
0.924685
4.032996
b83d8daf-125b-4003-8f42-9ef8fbc22a89
GSuvorov/SentimentAnalysisService
Sources/Core/cpp/NdxProcessor/r_logic.cpp
#include "StdAfx.h" #include ".\r_logic.h" #include ".\arg_res_int.h" #include ".\arg_complex.h" #include ".\prx_union.h" #include <math.h> namespace SS { namespace Core { namespace NdxSE { namespace NdxProcessor { namespace Extracting { namespace Logics { using namespace SS::Interface::Core::CommonContainers; using ...
ALGO
0.95212
5.017248
658a5925-c1e0-44cd-a967-bde85fadc79b
bfakhri/imageprocproject
Final/Fakhri_Som_Project1/Code/SIFT_6-2.cpp
#include <stdio.h> #include <iostream> #include "opencv2/core.hpp" #include "opencv2/features2d.hpp" #include "opencv2/xfeatures2d.hpp" #include "opencv2/highgui.hpp" #include "opencv2/xfeatures2d.hpp" #include "opencv2/xfeatures2d/nonfree.hpp" #include "opencv2/calib3d/calib3d.hpp" #include "opencv2/imgproc/imgproc.hp...
ALGO
0.946304
5.317384
b423a6db-306e-4fec-bb58-f728901a95ab
tamimahmed11/ProblemSolving
A_Find_Minimum_Operations.cpp
#include<bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n, k; cin >> n >> k; } return 0; }
ALGO
0.999665
3.709532
bf1a4b63-4c6d-4745-bf4f-9c51828bd91c
anisharma07/LAB-IV
DSA LAB/.DSA_js/STACK/stackUsingLinkedList.cpp
// Implementing Stack by using linked List: #include <iostream> using namespace std; struct Node { int data; Node *next; }; Node *top = new Node; void linked_list_traversal(Node *tp) { cout << "Stack elements: "; while (tp != NULL) { cout << tp->data << " "; tp = tp->next; } ...
ALGO
0.998128
4.606122
64a5a224-e217-474b-bab5-9901c86cabb9
MKG0007/DSA_Practice_Questions
0083-remove-duplicates-from-sorted-list/0083-remove-duplicates-from-sorted-list.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* deleteDupli...
ALGO
0.999943
5.811807
63cc9200-c92f-4dd6-ba91-39d66b9711d1
ishandutta2007/codeforces
kevin114514/normal/1699/A.cpp
#include<bits/stdc++.h> //#pragma GCC optimize("O2") using namespace std; #define ll long long #define pb push_back #define mp make_pair #define ALL(x) (x).begin(),(x).end() #define rALL(x) (x).rbegin(),(x).rend() #define srt(x) sort(ALL(x)) #define rev(x) reverse(ALL(x)) #define rsrt(x) sort(rALL(x)) #define sz(x) (in...
ALGO
0.999583
3.667778
539da81e-849f-4fc2-8f86-f89bf6e111b0
KapilShandilya20/CPP
Practice/InvertePyramid.cpp
#include<iostream> using namespace std; int main() { int n,i,j; std::cout << "Enter number: "; std::cin >> n; for(i = n ;i > 0;i--) { for(j = 0 ;j < i ; j++) { std::cout << "* "; } std::cout << std::endl; } return 0; }
ALGO
0.999885
3.718373
24f77c85-f6ae-4226-80ec-4925b2bc66df
isac322/BOJ
10265/10265.cpp14.cpp
#include <cstdio> #include <vector> #include <algorithm> #include <unordered_map> #include <unordered_set> using namespace std; vector<vector<size_t>> revMap; vector<size_t> topological; size_t parent[1000], map[1000]; bool visit[1000]; size_t n, current, k; size_t find(size_t p) { size_t &q = parent[p]; if (p == ...
ALGO
0.99995
4.049625
1e5a1e5d-2772-4f67-a665-97872ed7f660
Hahava1/Beecrowd-solutions
Ad-Hoc/CPP/2382.cpp
#include <iostream> #include <cmath> using namespace std; int main() { int l, a, p, r; cin >> l >> a >> p >> r; double diag = sqrt((l*l) + (a*a) + (p*p)); if(diag <= r*2) cout << "S" << endl; else cout << "N" << endl; return 0; }
ALGO
0.999849
3.437482
e4efa521-9075-403c-9674-d192b8e09575
kylej21/CS32Projects
Homework_2/mazestack.cpp
#include <iostream> #include<stack> using namespace std; class Coord { public: Coord(int r, int c) : m_r(r), m_c(c) {} int r() const { return m_r; } int c() const { return m_c; } private: int m_r; int m_c; }; bool pathExists(string maze[], int nRows, int nCols, int sr, int sc, int er, int ec){ ...
ALGO
0.99984
4.640717
68df1fa6-549d-410e-8569-af2b092aa0a6
ArushNo1/Competitive-Programming
CF/561919C.cpp
#pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> ii; typedef vector<ii> vii; typedef long long ll; typedef vector...
ALGO
0.999858
4.701156
a9bd1ab8-545f-422d-b14d-9ca737afffa4
vfolunin/archives-solutions
Kattis/dingdongditch.cpp
#include <iostream> #include <algorithm> #include <vector> #include <set> #include <map> #include <string> #include <numeric> using namespace std; int main() { freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); int size, queryCount; cin >> size >> queryCount; vector<long long> ...
ALGO
0.999988
4.295382
950c0aa1-0278-4c5b-a626-65f85ad366df
quyse/inanity
deps/bullet/repo/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp
#include "btMinkowskiPenetrationDepthSolver.h" #include "BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h" #include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h" #include "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h" #include "BulletCollision/CollisionShapes/btConvexShape.h" ...
ALGO
0.999597
5.899003
35174931-fae7-4be5-923b-d49dbd2d6581
divyansh2212/Practice-Problems
1901. Find a Peak Element II.cpp
// Jai Shree Babosa! #include <bits/stdc++.h> using namespace std; #define ll long long class Solution { public: int bs(vector<vector<int>> &mat, int i, int lo, int hi) { if (hi < lo) return -1; int mid = lo + (hi - lo) / 2; if (mat[i][mid] > mat[i][mid - 1] && mat[i][mid]...
ALGO
0.999947
4.606654
58a9db74-a01f-43f2-82c7-17133a3427fd
Dark-Basic-Software-Limited/GameGuruMAX
GameGuru Core/SDK/BULLET/bullet-3.19/Extras/InverseDynamics/invdyn_bullet_comparison.cpp
#include "invdyn_bullet_comparison.hpp" #include <cmath> #include "BulletInverseDynamics/IDConfig.hpp" #include "BulletInverseDynamics/MultiBodyTree.hpp" #include "btBulletDynamicsCommon.h" #include "BulletDynamics/Featherstone/btMultiBodyConstraintSolver.h" #include "BulletDynamics/Featherstone/btMultiBodyDynamicsWorl...
ALGO
0.988369
5.831728
98226129-7963-4831-ad04-c0a9dd3ed57f
DOMIAXEGDE/cpy
genesis.cpp
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> // Function to generate the C++ source files void generate_files(int n, int k, char a[]) { int nbr_comb = pow(k + 1, n); unsigned long long id = 0; for (int row = 0; row < nbr_comb; row++) { char filename[500]; spr...
ALGO
0.981673
4.691385
0a36880a-529a-4e33-8829-17bb9366146b
RoboTrainerAID/cob_control
cob_twist_controller/src/debug/debug_evaluate_jointstates_node.cpp
#include <string> #include <ros/ros.h> #include <sensor_msgs/JointState.h> #include <std_msgs/Float64.h> #include <geometry_msgs/Twist.h> #include <kdl_parser/kdl_parser.hpp> #include <kdl/chainfksolvervel_recursive.hpp> #include <kdl/chainjnttojacsolver.hpp> #include <kdl/frames.hpp> #include <kdl/jntarray.hpp> #inc...
ALGO
0.952632
6.882201
ad130a46-71f0-4e8f-9ab7-5775abe277a1
shu8Cream/atcoder-archive
atcoder.jp/abc112/abc112_b/Main.cpp
/** * author: shu8Cream * created: 02.01.2021 19:11:09 **/ #include <bits/stdc++.h> using namespace std; #define rep(i,n) for (int i=0; i<(n); i++) #define all(x) (x).begin(), (x).end() using ll = long long; using P = pair<int,int>; using vi = vector<int>; using vvi = vector<vi>; int main() { int n,t; ...
ALGO
0.99998
4.272594
61554d68-5272-41e8-8fa3-c2804d4d929e
Aldebaran638/luogu
2025lanqiao/P12133(1).cpp
// 这道题一开始看是很简单的 // 但是注意到到模拟过程,发现模拟次数大概是TK次. // 而题目中的T最多为1e5,K则为1e9. // 一般情况下认为计算机一秒钟能运行5e8次,所以极端情况会超时 // 所以这道题目直接模拟不能满分.猜测运行一定次数以后数据会逐渐趋近于一个值. // 使用随机数据打表以后发现确实如此,故在原代码的基础上加上判断数据是否保持不变的语句用于退出循环 // 实际上是因为每进行一次迭代,三个数的极差会缩小一半(?) #include <iostream> #include <iomanip> #include <algorithm> #include <vector> #include <set>...
ALGO
0.999857
3.672472
a52d7a8e-e8dd-46b9-9a79-6993904a0c80
EASINTUHA/Coding-Journey-reset
April 2025 past/A_Odd_Divisor.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define ff first #define ss second #define pb push_back #define all(x) x.begin(), x.end() #define sz(x) (int)(x)...
ALGO
0.999871
4.852233
831ee732-63f1-4c19-b334-17f21ca67f65
TheUnbeatable/Homework
JZOJ-optional/5972.cpp
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int N = 300, M = 1e4 + 50; const int S = N - 1, T = N - 2; namespace CostFlow { #define travel(x, i) for (int i = fir[x]; i; i = e[i].nxt) struct edge { int nxt, to, cap; LL len; } e[N * N * 4]; int fir[N], lst[N], cnt = 1; LL d...
ALGO
0.999942
3.805026
f960f3c1-0ab0-4a6b-89d7-c066d8ba0c44
faizan346/Ds-Algo-Cplusplus
hashmap-heap/32findAnagramMapping.cpp
#include<bits/stdc++.h> using namespace std; void solve(vector<int>& a, vector<int>& b) { int n = a.size(); unordered_map<int, queue<int>> umap; // val, ind for(int i = 0; i < n; i++) { umap[a[i]].push(i); } for(auto x : b) { cout << umap[x].front() << " "; umap[x].pop(); ...
ALGO
0.999987
3.916065
4f35ee2b-109d-4212-952c-23b37c77006d
kimurash/aoj
course/ALDS1/topic11/ALDS1_11_B/main.cpp
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define rep(i, s, n) for (int i = s; i <= (int)(n); i++) #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define arrout(a, s, n) rep(i, s, n)cout<<a[i]<<" "; cout<<endl; #define vecout(v) for(auto elm : (v))cout<<elm<<" "; cout<<endl; #define...
ALGO
0.99973
3.726133
46c98d86-c77f-4e2e-802f-dd6d2db54b55
denilsonsa/maratona-eri-2011
src/deboratads/somaprima.tle.cpp
/* * somaprima.cpp * * Created on: Apr 22, 2011 * Author: deborasilva */ #include <stdio.h> #include <string.h> #define MAX 1000000 char ep[MAX]; int primos[MAX]; int np; void crivo() { memset(ep, 1, sizeof(ep)); ep[0] = 0; ep[1] = 0; int i = 2; while (i < MAX) { for (int j = 2 * i; j < MAX; j += ...
ALGO
0.99992
5.170869
99b411e8-08c8-45cb-b59c-30e14d3cff99
ishandutta2007/codeforces
tinsane/normal/624/A.cpp
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <iomanip> #include <cstdio> #include <cstdlib> #include <queue> #include <vector> #include <map> #include <string> #include <cstring> #include <utility> #include <stack> #include <set> #include <algorithm> #include <bitset> #include <functional> #include <cti...
ALGO
0.997147
3.764763
bd2fb9c8-9f9a-408c-8499-7d3a341dedfe
felipesdias/Extractor-URI-Online-Judge
URI-PT/INICIANTE/2674 - Super Primos Ativar!.cpp
// Autor: Felipe Souza Dias<<EMAIL>> // Nome: Super Primos: Ativar! // Nível: 2 // Categoria: INICIANTE // URL: https://www.urionlinejudge.com.br/judge/pt/problems/view/2674 #include <bits/stdc++.h> using namespace std; char nprimo[100001] = {0}; // tamanho = sqrt(maximo) vector<int> primos; int main() { int ...
ALGO
0.999876
3.858842
3e727e45-1d94-4c2d-9dab-6467d2db29ea
SEA-ME-COSS/Control
control_ws/src/stanley/include/stanley/dbcppp/third-party/boost/libs/spirit/classic/example/fundamental/stuff_vector2.cpp
/////////////////////////////////////////////////////////////////////////////// // // This sample demontrates a parser for a comma separated list of identifiers // This is a variation of stuff_vector.cpp. // This is discussed in the "Phoenix" chapter in the Spirit User's Guide. // // [ JDG 1/12/2004 ] // //////////...
TOOL
0.904143
6.964866
a99f43ed-f514-4077-b4a3-0af199d63e39
itsmedona/TimeTableTask
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.99874
6.767714
1a703434-7236-4a2a-b55e-1e115faaa199
alexandraback/datacollection
solutions_1480492_0/C++/Dembel/c.cpp
#include <cstdio> #include <cstdlib> #include <ctime> #include <cstring> #include <string> #include <set> #include <map> #include <vector> #include <algorithm> #include <cmath> #include <cstdarg> using namespace std; #define DBG2 1 #define clr(a) memset(a, 0, sizeof(a)) #define fill(a, b) memset(a, b, sizeof(a)) v...
ALGO
0.999779
4.117427
50185b9f-d5dc-41fe-8f61-1f89106a0b87
luyuancpp/ue5navmesh
Private/DetourCrowd/DetourLocalBoundary.cpp
#include "DetourCrowd/DetourLocalBoundary.h" #include "DetourCrowd/DetourCrowd.h" #include "Detour/DetourAssert.h" dtLocalBoundary::dtLocalBoundary() : m_nsegs(0), m_npolys(0) { dtVset(m_center, FLT_MAX, FLT_MAX, FLT_MAX); } dtLocalBoundary::~dtLocalBoundary() { } void dtLocalBoundary::reset() { dtVset(m_center,...
ALGO
0.998727
6.568944
53d7ecf8-6b1a-4c91-b9b9-eb59b42a78ec
tronbouron123/mathematics101
src/33.cpp
#include <iostream> using namespace std; int main() { int num; cout << "Enter an integer: "; cin >> num; if (num % 2 == 0) { cout << num << " is even"; } else { cout << num << " is odd"; } return 0; }
ALGO
0.979674
4.272617
5ab61068-43e8-420a-a1d7-fed567336c6a
ishandutta2007/codeforces
sevlll777/normal/1284/A.cpp
#include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <unordered_map> #include <numeric> #include <map> #include <set> #include <deque> #include <iomanip> #include <bitset> #include <random> #define int long long #define str string #define pb push_back #define pii pair<int, int> using n...
ALGO
0.999951
4.730575
fa2baea7-e2ec-4ef3-9774-fd217f3bdbbb
jyotideepjee1803/DSA-
Binary Tree/109. Convert Sorted List to Binary Search Tree/Convert_list_to_bst.cpp
#include<bits/stdc++.h> using namespace std; TreeNode* sortedListToBST(ListNode* head) { //Corner case : if(head == NULL){ return NULL; } //only one node : if(head->next == NULL){ return new TreeNode(head->val); } ...
ALGO
0.999994
5.48897
6080b706-8fb9-4433-81a4-c17aa6c0a4d9
bayram33/example_of_textformfield
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
3ec3220a-17b1-4912-9a3a-b05077188205
DibloTempest/ThinhLucifer
CPP/REPLACE.cpp
#include <bits/stdc++.h> using namespace std; long long n, a[1004]; main() { freopen("REPLACE.inp", "r", stdin); freopen("REPLACE.out", "w", stdout); cin >> n; for (int i = 1; i <= n; i++) { cin >> a[i]; } for (int i = 1; i <= n; i++) { if (a[i] < 0) a[i] = 0;...
ALGO
0.99995
3.609057
997f32d2-651e-4e98-92b5-b607f6044eac
manikanta2901/ubuntu
.history/practice/cpp/Codechef/ModeOfFrequencies_20200830132815.cpp
#include<bits/stdc++.h> #include<vector> #include<iostream> #include<cmath> #include<algorithm> #include<iterator> #include<string> #include<map> #define vv vector #define F first #define S second #define MP make_pair #define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define printM...
ALGO
0.999618
3.733505
a82ed7f0-b222-40ec-88f9-93fe49aa1d08
Ayon-SSP/The-SDE-Prep
3]_CP/DP/Equal Sum Partition (top-down).cpp
#include<bits/stdc++.h> using namespace std; #define ll long long int #define MOD 1000000007 #define pb push_back bool subsetSum(int arr[], int n, int sum) { bool dp[n+1][sum+1]; for(int i=0 ; i<=n ; i++) { for(int j=0 ; j<=sum ; j++) { if(i==0) dp[i][j]=false; if(j...
ALGO
0.999992
4.644508
f1e4c9d4-1b58-4647-8cee-622c98eeea7e
gurpartap-singh/Data_Structure_Lab
POSTFIX EVALUATION.cpp
#include <iostream> #include <string.h> using namespace std; int main() { cout<<"Enter the postfix expression"<<endl; char s[100]; int x,y,z; cin.get(s,100); int l=strlen(s); int a[100]; int t=-1; for(int i=0;i<l;i++) { if(isdigit(s[i])) { t++; ...
ALGO
0.999835
3.78419
d437a151-bdc2-46b7-9b26-3f1eab78cb99
Dheerajch9401/c-assignment
program.34c.cpp
#include <stdio.h> #define ARRAY_SIZE 10 int main(void) { int array[ARRAY_SIZE] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; int search_key = 5; int found = 0; int i; for (i = 0; i < ARRAY_SIZE; i++) { if (array[i] == search_key) { found = 1; break; } } if (found) { printf("The search ke...
ALGO
0.99954
4.997853
87fbc33e-a3c8-407b-9af7-a027fc1f02df
ashutosh017/cp_journey
361_treasure_chest.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define forn(i, a, b) for(int i=a;i<=b;i++) #define ford(i,a,b) for(int i=a;i>=b;i--) #define rep(i, n) forn(i, 0, n-1) #define fi first #define se second #define vi vector<int> #define vll vector<ll> #define vb vector<bool> #define vvi vector<vector<in...
ALGO
0.999907
3.879421
0f9d8c94-93cd-4846-bfba-ca9204990178
chicco83/CHIRON-EVO
CHIRON/OLD MARLIN/FW/marlin 2.0.7/Marlin-2.0.7/buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant.cpp
#include "pins_arduino.h" #ifdef __cplusplus extern "C" { #endif // Digital PinName array const PinName digitalPin[] = { PA_0, //D0 PA_1, //D1 PA_2, //D2 PA_3, //D3 PA_4, //D4 PA_5, //D5 PA_6, //D6 PA_7, //D7 PA_8, //D8 PA_9, //D9 PA_10, //D10 PA_11, //D11 PA_12, //D12 PA_13, //D...
CONFIG
0.880237
3.720263
bec40bcc-2782-4b88-bf49-1fae112b7e06
herayola/Praktikum_Algo
Tugas1.cpp
#include <iostream> using namespace std; struct mahasiswa { string nama; int nim; float ipk; }; // menu pilihan void menu(int &pilih) { cout << "1. Tampilkan mahasiswa" << endl; cout << "2. Cari berdasarkan NIM" << endl; cout << "3. Cari berdasarkan nama" << endl; cout << "4. Sort IPK maha...
ALGO
0.999302
5.337264
6ca4dcfb-9268-4ed1-8c4c-5ea63b90591e
najmulhc/grind-station
linked-list/dubly/reverse.cpp
#include <iostream> #include <vector> using namespace std; struct ListNode { int val; ListNode *prev; ListNode *next; ListNode(int data) { val = data; prev = nullptr; next = nullptr; } }; int main() { vector<int> numbers = {1, 2, 3, 4, 5}; ListNode *head = new...
ALGO
0.999958
4.994439
e08e4110-404d-46be-874d-0407f7c85fae
channo39mz/T.Tcodetesting
T.T_testing/n3+1.cpp
#include <iostream> using namespace std; int main() { int a,b,c; int maxval = 0; int stk = 1; int ans = 0; // cout << "Type a number: "; cin >> a; // cout << "Type a number: "; cin >> b; while(a!= b){ c = a; stk = 1; while(c!=1){ if(c%2==0){ c /= 2...
ALGO
0.999943
4.639396
92821ffa-1ab7-4226-9a61-9dbc1f675be9
keshav25201/data-structure-and-algo
linked list/Remove_First_In_Linkedlist.cpp
#include <iostream> #include <string> #include <bits/stdc++.h> using namespace std; struct node { int key; node *next; node(int key) { this->key = key; next = NULL; } }; class linkedlist { public: node *head; node *tail; int size; void addLast(int key) { i...
ALGO
0.99473
5.055937
0ea04803-467a-4801-8376-c7d627f9df1a
lakshitcodes/DSA_Problems
LeetCode/3337_TotalCharactersInStringAfterTransformationsII.cpp
#include <bits/stdc++.h> using namespace std; //Question Link : https://leetcode.com/problems/total-characters-in-string-after-transformations-ii// class Solution { public: using Matrix = vector<vector<long long>>; const int MOD = 1e9 + 7; Matrix multiply(const Matrix& A, const Matrix& B) { Matrix...
ALGO
0.999989
6.318653
3f3953f5-7732-4e7e-8688-7baac05501e4
Normal-pcer/sync_code
P1433_吃奶酪.cpp
/** * @link https://www.luogu.com.cn/problem/P1433 */ #include "./libs/debug_macros.hpp" #include "./lib_v3.hpp" #include "./libs/range.hpp" #include "./libs/bit.hpp" #include "./libs/debug_log.hpp" #include "./libs/rolling_container.hpp" using namespace lib; namespace Solution_8294724057770579 { void solv...
ALGO
0.99967
4.795346
5284f685-19cc-4fb6-b9e6-7952b8c50e6f
Kawser-nerd/CLCDSA
Source Codes/CodeJamData/09/51/17.cpp
#include <cstdio> #include <cstdlib> #include <cmath> #include <string> #include <vector> #include <iostream> #include <map> #include <set> #include <algorithm> #include <queue> #include <sstream> using namespace std; typedef long long ll; typedef pair<int,int> pii; #define SZ(x) (int)(x.size()) #define F0(i,n) for(i=0...
ALGO
0.999924
3.936625
b2a76cab-6c33-4d37-b7b5-da3459747307
KeXen1/ECGR-3180
Assignment3/reverseString/main.cpp
// Homework /* Write a short recursive C++ function that determines if a string s is a palindrome, that is, it is equal to its reverse. For example, "racecar" and "gohangasalamiimalasagnahog" are palindromes. Note: Your implementation has to be recursive. Zero points for non-recursive code even if it's correct. */ #i...
ALGO
0.998715
6.16468
712b9745-bea6-4c1f-af6a-2d4481a1cece
Harsh-710/6Companies30Days
Amazon/best-time-to-buy-and-sell-stock.cpp
class Solution { public: int maxProfit(int k, vector<int>& prices) { int n = prices.size(); if(n <= 1) return 0; vector<vector<vector<int>>> v(n+1, vector<vector<int>>(2, vector<int>(k+1))); for(int i=n-1; i>=0; i--){ for(int tr = 1; tr <= k; tr++){ v[i][0...
ALGO
0.999939
5.897505
0cb3b0b3-28c4-498b-bf69-cdc17beb9d29
Sanskar13/Codeforces-Problems
NextRound158A.cpp
#include<iostream> #include<vector> using namespace std; int main() { int n,k; cin>>n>>k; vector<int> v; for(int i=0;i<n;i++) { int y; cin>>y; //Score Earned by the participant. v.push_back(y); } int cnt=0; for(int j=0;j<n;j++) { if(v[j]>=v[k-1] && v[j]>0) { cnt++; } } cout<<cnt<<endl; re...
ALGO
0.999845
3.277159
06525dfe-d050-47c4-92c1-c8e855c44eb3
acc-cosc-1337-spring-2019/acc-cosc-1337-spring-2019-Choover22
homework/04_vectors/main.cpp
/* Prompt user for 1 for Get Max from vector and 2 for Get primes. Prompt user for a number and return max value or list of primes and display them to screen. Program continues until user decides to exit. */ #include<iostream> #include "vectors.h" int main() { vector<int> primes = vector_of_primes(50); for (int p...
ALGO
0.958837
3.759459
ae5fafaa-a600-4f40-af2e-7b421e18deff
lagadic/visp-debian
modules/core/test/math/testMatrixInverse.cpp
/*! \example testMatrixInverse.cpp \brief Test various matrix inversions. */ #include <visp3/core/vpTime.h> #include <visp3/core/vpMatrix.h> #include <visp3/core/vpColVector.h> #include <visp3/io/vpParseArgv.h> #include <vector> #include <stdlib.h> #include <stdio.h> #include <fstream> #include <iostream> #includ...
TEST
0.921127
5.068068
26fc27f1-b7a1-4137-861b-51c4b4635e50
PriyanshuNaredi/LeetCode
0074-search-a-2d-matrix/0074-search-a-2d-matrix.cpp
class Solution { public: bool searchMatrix(vector<vector<int>>& matrix, int target) { // T.C -> o(log n*m) int n = matrix.size(); int m = matrix[0].size(); int low = 0,high = n*m -1; while(low<=high){ int mid = low + (high - low)/2; int row = mid / m; int col = mid % m; ...
ALGO
0.999972
6.308874
1479e014-afe4-48d2-9c40-d35209b81320
bpmnnit/codes
prob23.cpp
/* * ===================================================================================== * * Filename: prob23.cpp * * Description: Problem 23 of Projecteuler.net * * Version: 1.0 * Created: 08/24/2012 04:53:48 PM * Revision: none * Compiler: gcc * * Author:...
ALGO
0.999119
4.877803
33b91c5e-cd92-4c1d-bb23-84e0a2968249
gyanjd/DSA
bubbleSort.cpp
void bubbleSort(vi &v){ int isSwap = false; for(int i=0; i<v.size(); i++){ isSwap = false; for(int j=0; j<v.size()-1-i; j++){ if(v[j] > v[j+1]){ swap(v[j], v[j+1]); isSwap = true; } } if(!isSwap) break; } }
ALGO
0.999803
5.171884
737cb915-9133-4f60-8dea-a39e7f1bba53
sarvex/leetcode-tcsh
solution/2200-2299/2290.Minimum Obstacle Removal to Reach Corner/Solution.cpp
class Solution { public: int minimumObstacles(vector<vector<int>>& grid) { int m = grid.size(), n = grid[0].size(); deque<tuple<int, int, int>> q{{0, 0, 0}}; bool vis[m][n]; memset(vis, 0, sizeof vis); int dirs[5] = {-1, 0, 1, 0, -1}; while (1) { auto [i, ...
ALGO
0.999967
6.180961