uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
76973d7b-6a9c-4a21-b938-133e72f2eb55 | y9miao/ConsistentPanopticSLAM | mapping_ros_ws/src/consistent_panoptic_mapping/depth_segmentation_py/src/depth_segmentation_py_previous.cpp | #include "depth_segmentation_py/depth_segmentation_py.h"
/***compute depth map with depth images
input type: (depth_image, CV_32FC1)
output type: (depth_map, CV_32FC3) ***/
pybind11::array DepthSegmentation_py::computeDepthMap_py( pybind11::array &depth_image_np){
// convert numpy array to cv::mat
cv::... | ALGO | 0.953338 | 7.544035 |
b8eb1db6-4055-4b0c-a67b-8d48a449b736 | smallkirby/procon | aoj/itp1/itp1_1d/a.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
int main(void)
{
int S, h, m, s;
cin >> S;
h = S / (60*60);
S -= h*60*60;
m = S / 60;
S -= m*60;
s = S;
cout << h << ":" << m << ":" << s << endl;
} | ALGO | 0.939602 | 4.095983 |
2af4ba4a-539d-4360-9c63-45532a5a9e78 | rayansiingh/DSA-CPP | 16_bin_to_decimal.cpp | #include <iostream>
using namespace std;
// code to convert decimal to binary
int main()
{
int num, rem, ans = 0, mul = 1;
cout << "Enter num: ";
cin >> num;
while (num > 0)
{
// remainder
rem = num % 2;
// rem = num & 1; // can also use bitwise operator
// num
... | ALGO | 0.992189 | 4.841315 |
80922afd-6b05-4259-8877-f5a6274196ef | rudrashisgorai/Random-Codes-in-Cpp | template.cpp | #include <bits/stdc++.h> // This will work only for g++ compiler.
#define for0(i, n) for (int i = 0; i < (int)(n); ++i) // 0 based indexing
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i) // 1 based indexing
#define forc(i, l, r) for (int i = (int)(l); i <= (int)(r); ++i) // closed interver from l to r r inclu... | ALGO | 0.998636 | 4.179471 |
250df073-ec8e-464f-91f4-6b2754a70b0f | anjalipathak13/Practice-Leetcode-Question | 206-reverse-linked-list/206-reverse-linked-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* reverseList... | ALGO | 0.99936 | 5.628911 |
117c00a0-bf29-42db-b56e-6b40f7bfbadd | eulrho/algorithm_study_group | 24_4_week2/7.cpp | // 레벨 햄버거 bj.16974
#include <iostream>
using namespace std;
#define fast ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
typedef unsigned long long u_ll;
u_ll find_cnt_patty(u_ll x, u_ll layer, u_ll patty, int level)
{
if (layer / 2 >= x) {
if (x >= 2)
return (find_cnt_patty(x - 1, (layer - 3) / 2, (... | ALGO | 0.999983 | 3.781698 |
d8e16068-772a-4928-bd1b-195f910f92c3 | KAVYANSHTYAGI/pytorch | torch/csrc/lazy/core/ir_util.cpp | #include <torch/csrc/lazy/core/ir_util.h>
#include <stack>
#include <c10/util/Logging.h>
namespace torch::lazy {
std::vector<const Node*> Util::ComputePostOrder(
const Node* node,
EmissionMap* emap) {
std::vector<const Node*> post_order;
std::stack<const Node*> node_stack;
node_stack.push(node);
whi... | ALGO | 0.998834 | 7.600013 |
e8ec6eb1-7d43-461c-a8c9-4c02b7f837e4 | PrabhakarKulkarni7/Leetcode_submissions | 1333-sort-the-jumbled-numbers/sort-the-jumbled-numbers.cpp | class Solution {
private:
long long mapStringToInt(string num, vector<int> &mapping){
long long res = 0;
for(int i = 0; i < num.size(); i++){
int idx = num[i] - '0';
res = (res + mapping[idx]) * 10;
}
res = res / 10;
return res;
}
public... | ALGO | 0.999979 | 6.292754 |
7e72077f-bc95-466d-8a11-cf93da28a436 | sarvex/leetcode-csh | solution/1800-1899/1868.Product of Two Run-Length Encoded Arrays/Solution.cpp | class Solution {
public:
vector<vector<int>> findRLEArray(vector<vector<int>>& encoded1, vector<vector<int>>& encoded2) {
vector<vector<int>> ans;
int j = 0;
for (auto& e : encoded1) {
int vi = e[0], fi = e[1];
while (fi) {
int f = min(fi, encoded2[j][... | ALGO | 0.999966 | 5.087219 |
81fc7c84-35d1-4912-8d1f-f2314d82769d | bushlionzs/learn3D | 3rd/Opcode/OPC_BoxPruning.cpp | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////... | ALGO | 0.999873 | 5.923243 |
a50072a8-bfa5-44da-995d-76df218dbb79 | Mrsandman327/windows-book-code-c- | VC2010Samples/C++/MFC/general/DBVList/EmpView.cpp | #include "stdafx.h"
#include "DBVList.h"
#include "DBVListSet.h"
#include "DBVListDoc.h"
#include "EmpView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CEmpView
IMPLEMENT_DYNCREATE(... | TOOL | 0.857248 | 5.64708 |
865ba2c5-a29f-43be-87d6-edffd2f567a3 | Aryan-Satija/DSA | LINKED LIST/singly linked list/reverse2.cpp | // recursive method
#include <bits/stdc++.h>
using namespace std;
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) {}
};
ListNode* rev(ListNode* prev, ListNode* curr, ListN... | ALGO | 0.999924 | 4.779328 |
2840c337-ef06-4247-b605-61969e3f4b29 | AlleyNawaz/366DaysofLeetcode | 0242_P947_Most_Stones_Removed_with_Same_Row_or_Column.cpp | /*
Day: 242
Problem Number: 947 (https://leetcode.com/problems/most-stones-removed-with-same-row-or-column)
Date: 29-08-2024
Description:
On a 2D plane, we place n stones at some integer coordinate points. Each coordinate point may have at most one stone.
A stone can be removed if it shares either the same row or the s... | ALGO | 0.999752 | 6.92612 |
7ea69da9-5a4a-4510-8d24-fac748b38e20 | anmoljhamb/leetcode | 15thJune2024/424_longest_repeating_character.cpp | #include <algorithm>
#include <bits/stdc++.h>
using namespace std;
class Solution {
int pos(char ch) { return (int)ch - (int)'A'; }
public:
int characterReplacement(string s, int k) {
int left = 0, right = 0, ans = 0, max_el;
vector<int> hash(26, 0);
for (right = 0; right < s.size(); right++) {
... | ALGO | 0.999985 | 5.901539 |
8e797fc6-bb12-4751-9253-96c2c874406e | Intiser/ProblemSolvingAndContest | UvaOnlineJudge/11857.cpp | /***********Template Starts Here***********/
//#include <bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <deque>
#include <functional>
#include <string>
#include <iostream>
#include <cctype>
#include <s... | ALGO | 0.999895 | 3.941449 |
f7b90824-12be-4603-854e-e4b1d0d58231 | Spengarcor/numelectrostatics | CPU_boundary_analysis/cpucon.cpp | //cpucon.cpp
//Determines CPU consumption and total CPU time for numerical solver. Iterally saves results to csv file for each number of iteration used in solver.
//Need to declare vectors of data type CPUdata to store CPU data fetched from /proc/stat, in main
///* std::vector<CPUData> snapshot1;
// std:... | DATA | 0.880139 | 3.287143 |
382a09e1-0ce0-4518-a902-0f19059361cb | nimit1jain/DSA-Questions | matrix/spiral_traversal.cpp | #include <iostream>
using namespace std;
int main()
{
int arr[3][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
int top = 0, bottom = 2, left = 0, right = 2;
int dir = 0;
while (top <= bottom && left <= right)
{
if (dir == 0)
{
for (int i = left; i <= right; i++)
{
... | ALGO | 0.999972 | 3.404105 |
627ae9a9-8a96-409a-975a-156eb14fef76 | krysz123/safe_gallery | 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 |
de10434f-3366-4f3d-a492-ee38373a8212 | notmyst33d/ahsg | thirdparty/recastnavigation/Recast/Source/RecastFilter.cpp | #define _USE_MATH_DEFINES
#include <math.h>
#include <stdio.h>
#include "Recast.h"
#include "RecastAssert.h"
/// @par
///
/// Allows the formation of walkable regions that will flow over low lying
/// objects such as curbs, and up structures such as stairways.
///
/// Two neighboring spans are walkable if: <tt>rcAb... | ALGO | 0.97961 | 6.925026 |
3b7c18fa-3a00-4f7b-ae7a-6ce5811636b7 | melwinalm/leetcode-cpp | lowest-common-ancestor-of-a-binary-search-tree.cpp | /*
Title: Lowest Common Ancestor of a Binary Search Tree
Link: https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree
*/
class Solution {
public:
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
while(root != NULL){
if(p->val < root->val &... | ALGO | 0.999999 | 6.63043 |
b1f61efa-6b29-42aa-9e75-a1c3570ef2cd | Sc-lab-2016/lab4 | lib/symbolic/examples/cumu.cpp | // cumu.cpp
#include <iostream>
#include "symbolicc++.h"
using namespace std;
Symbolic Taylor(Symbolic u,const Symbolic &x,int n)
{
Symbolic series = u[x==0];
int fac = 1;
for(int j=1;j<=n;j++)
{
u = df(u,x); fac = fac * j;
series += (u[x==0]*(x^j)/fac);
}
return series;
}
int main(voi... | ALGO | 0.99984 | 5.111445 |
d683c480-c0e3-4574-a323-584f0efa8510 | akram8540/DataStructure-and-Algorithms | Matrix/antiClockwiseMatrixRotate.cpp | #include<iostream>
using namespace std;
void rotateMatrix(int arr[4][4]){
for(int i = 0; i < 4; i++){
for(int j = i+1; j < 4; j++){
swap(arr[i][j] , arr[j][i]);
}
}
for(int i = 0; i < 4 ; i++){
int low = 0, high = 3;
while(low < high){
swap(arr[low][... | ALGO | 0.999957 | 4.527093 |
481812fb-6504-4500-9fad-8d0769fd9c63 | sudarshanvm/problem-solving | premium-algo-100/array-string/lc624.cpp | //problem statement : https://leetcode.com/problems/maximum-distance-in-arrays/description/
class Solution {
public:
int maxDistance(vector<vector<int>>& arrays) {
// for each array, we need to find the max element from remaining arrays and min element from current array and find the diff and compare with ... | ALGO | 0.999671 | 5.48185 |
8205597b-394a-4bcb-93d1-ba465a0d3eba | iCodeIN/CodingLab | CppLab/cpplabs/stl_container/set_multiset/set_define.cpp | #include <iostream>
#include <string>
#include <set>
using namespace std;
// 将自定义数据结构对象插入set的方法
// 使用如下方法,则相同的 score 不会重复插入
struct Item
{
int id;
int score;
};
bool operator<(const Item &lhs, const Item &rhs)
{
return lhs.score < rhs.score;
}
bool compareItem(const Item &lhs, const Item &rhs)
{
return lhs.scor... | TOOL | 0.947703 | 4.508385 |
4453dd5c-c1b5-4ecb-b72e-8a5ed3e20ac4 | FrankieLi/IceNine | XDM++/libXDM/3dMath.cpp | /********************************************************************
created: 2004/09/25
authors: Shan-Min Chao & Frankie Li
purpose: General purpose math class for standard 3d math.
*********************************************************************/
#include "Debug.h"
#include <math.h>
#include <stdio.h>
#i... | TOOL | 0.865696 | 7.371526 |
90209f56-4538-411a-bf32-09560e02acf6 | lakshyajit165/DS_and_ALGO | Perfect_Number/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
//code
int t,num,sum;
cin>>t;
while(t--){
sum = 0;
cin>>num;
for(int i = 1; i<sqrt(num); i++)
{
if(num % i == 0)
sum += i;
}
if(sum == num)
cout<<"1"<<endl;
else
cout<<"0"<<endl;
}
retur... | ALGO | 0.999951 | 4.659731 |
7f766b42-ee39-4f29-bc3d-55483c4c998f | aioc/codebreaker | problems20dec/tennis/2.cpp | #include<cstdio>
#include/*gap*/<algorithm>
#define for for(int i=1;i<=B;i++)
using namespace std;int B, N, A[100005],lo,
hi=1111111111,mid,best,placed,ans;int main(){
scanf("%d%d",&B,&N);for scanf("%d", &A[i]);lo=1,hi=N-B-2;while(lo<=hi){
mid=(lo+hi)/2;for placed+=min(A[i],mid);if(placed<N)best=... | ALGO | 0.999977 | 3.161364 |
01815992-30c2-4284-8a7e-27c93937d447 | Mstf466/flutter_weather_app | 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 |
4bc23355-7803-4a68-be1b-901872848a8c | Techriss/leetcode | 617.cpp | #include <iostream>
#include <queue>
#include <string>
using namespace std;
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 *righ... | ALGO | 0.999994 | 5.945474 |
f4044b50-743b-4fbc-8c23-30cfac52410b | DdunhamITC/3183_CPU_PROJECT_Ball_Dunham_Howard | abs.cpp | #include "abs.h"
#include <iostream>
#include <vector>
using namespace std;
vector <int> absV (vector <int> a)
{
if (a[0]==1)
a[0]=0;
else
a[0]=0;
return a;
} | ALGO | 0.998593 | 3.579846 |
f980cf30-3095-4500-a765-d9faf34f6fc0 | kobefaith/leetcode | Generate Parentheses/Generate Parentheses .cpp | class Solution {
public:
void stackparenthesis(int n,vector<string> &result,int l,int r,string temp)
{
int i=0;
if(l == n ){
while (i < (l-r)){
temp += ')';
i++;
}
result.push_back(temp);
return ;
}
stackp... | ALGO | 0.999751 | 6.204817 |
8d868236-9210-44d9-803d-290a93a6899a | Mussabat/_CP_ | Number_Theory/CSES_Distributing_Apple.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
inline void normal(ll &a) {if(a>=MOD)a %= MOD; (a < 0) && (a += MOD); }
inline ll modMul(ll a, ll b) {normal(a), normal(b); return (a*b)%MOD; }
inline ll modAdd(ll a, ll b) {normal(a), normal(b); return (a+b)%MOD; }
inline ll mo... | ALGO | 0.999982 | 4.151086 |
72f6e6e1-3b0d-48b7-aa95-54e0a9645238 | lucasw0908/SchoolCodingHomework | 113-1/a106.cpp | #include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(0);std::cin.tie(0);std::cout.tie(0);
#define int long long
#define F first
#define S second
#define pii pair<int, int>
const int MAXN = 25;
const int c_size = 4;
vector<set<pii>> c(c_size*2+2);
vector<vector<vector<int>>> v(MAXN, v... | ALGO | 0.9999 | 3.997556 |
dd5f95a4-f23e-4992-ab72-ea351173d430 | nkirov/nkirov.github.com | 2012/NETB151/sources/ch14/heap.cpp | #include <iostream>
#include <vector>
using namespace std;
/**
This class implements a heap.
*/
class Heap
{
public:
/**
Constructs an empty heap.
*/
Heap();
/**
Adds a new element to this heap.
@param new_element the element to add
*/
void push(int new_element);
/**
... | ALGO | 0.99977 | 5.597356 |
1e9f196b-90bb-4984-b620-463845d3925b | Tinyshellzz/leetcode | Q0235. Lowest Common Ancestor of a Binary Search Tree.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <iostream>
using namespace std;
#include "utils/TreeNode.h"
class Solution {
TreeNode *p, *q;
TreeNode *ans;
public:
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
this->p = p;
... | ALGO | 0.999993 | 5.325328 |
68fcbd18-7ce4-423f-8afd-3479bd441df1 | Sound-Linux-More/sacd | libdstdec/ac_data.cpp | #include "ac_data.h"
#define PBITS AC_BITS //number of bits for Probabilities
#define NBITS 4 //number of overhead bits: must be at least 2! Maximum "variable shift length" is (NBITS-1)
#define PSUM (1 << (PBITS))
#define ABITS (PBITS + NBITS) // must be at least PBITS+2
#define MB 0 // if (MB) print max buffer use
#d... | ALGO | 0.986882 | 4.474458 |
36812e45-c5cb-4631-8fcb-9279f45bc1e5 | leofarhi/CasioMini3D | ModelRenderer/Versions/v6/src/shapes/triangle.cpp | #include "shapes.hpp"
struct Edge { int x, y; fixed_t u, v; };
inline Edge CalcEdge(VertexLocal a, VertexLocal b, int y)
{
const int deltaY = b.y - a.y;
if (deltaY == 0) return {a.x, y, a.u, a.v};
const int factor = ((y - a.y) << PRECISION) / deltaY;
const int x = a.x + (int)((b.x - a.x) * factor);
... | ALGO | 0.977865 | 5.750386 |
b7a52c26-16d1-4934-8b33-313888ac694a | jl-lc/2nd-yr-DSA-repo | p1/main.cpp | #include <iostream>
#include "jlc2lam_p1.hpp"
//helper functions
void success() {
std::cout << "success" << std::endl;
return;
}
void failure() {
std::cout << "failure" << std::endl;
return;
}
int main() {
std::string cmd{};
List list(0);
unsigned int N{};
while (std::cin >> cmd) {
... | TOOL | 0.978424 | 4.335606 |
fcefbcb9-9c96-453e-b8e8-9d63439bbd9b | VANDAL/SynchroTrace-gem5 | src/systemc/tests/systemc/misc/unit/data/datawidth_bool_to_signed/extension/datawidth.cpp | /*****************************************************************************
datawidth.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.9623 | 5.61622 |
0b1ecd1e-d044-4d64-989a-4f197940709e | ndbaolam/Algorithms | DSA/2Darray/bai21.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define MAX 105
int n, m, s, t, u, v;
int a[MAX][MAX];
int dx[8] = {-2,-2,-1,-1,1,2,2,1};
int dy[8] = {-1,1,-2,2,-2,-1,1,2};
void nhap()
{
cin >> n;
m=n;
cin >> s >> t >> u >> v;
for(int i=1;i<=n;i++)
for(int j=1;j<=m;j++)
cin >> a[i][j];
}
... | ALGO | 0.999744 | 5.142878 |
4f402744-cb69-4e9b-b521-c05f45c2c4cf | KeXen1/C-ECGR-2103 | example4/main3.cpp | #include <iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
int main(){
srand(time(0));
int reel1 = (rand() % 4) + 1;
int reel2 = (rand() % 4) + 1;
int reel3 = (rand() % 4) + 1;
cout << reel1 << " " << reel2 << " " << reel3 << endl;
if(reel1 != reel2){
... | ALGO | 0.996809 | 3.388882 |
4fdcee1d-4f53-4f11-9c4e-fec80683648c | chaocaonhan/codeCpp | Buoi4/HinhTron.cpp | #include<iostream>
#include<iomanip>
using namespace std;
int main(){
int r;
cin>>r;
float chuvi = 2*3.14*r;
float dienTich = 3.14*r*r;
cout<< fixed <<setprecision(2)<<chuvi<<" "<<dienTich;
} | ALGO | 0.982329 | 3.892648 |
6d03399d-1f54-4769-8656-a60416f2d8c3 | Sapthak101/Design-And-Analysis-Of-Algorithms | DAA/Class 1/Q3.cpp | #include <iostream>
#include <unordered_map>
#include <vector>
using namespace std;
int main()
{
int n;
cout << "Enter the size of the array: ";
cin >> n;
vector<int> arr(n);
cout << "Enter the elements of the array: ";
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
u... | ALGO | 0.999655 | 5.708377 |
ff4ca38e-2ac9-4cb5-9d90-0c70dfb96c1c | sheeluofficial/practice | OthersCode/LeetCode-Solutions-master/LeetCode-Solutions-master/C++/bulb-switcher.cpp | // Time: O(1)
// Space: O(1)
class Solution {
public:
int bulbSwitch(int n) {
// The number of full squares.
return static_cast<int>(sqrt(n));
}
};
| ALGO | 0.999915 | 6.555437 |
f470e2be-2a01-4658-bf13-ab74e8cedb0f | berndpfrommer/gtsam-tagslam | gtsam/linear/PCGSolver.cpp | /*
* @file PCGSolver.cpp
* @brief Preconditioned Conjugate Gradient Solver for linear systems
* @date Feb 14, 2012
* @author Yong-Dian Jian
* @author Sungtae An
*/
#include <gtsam/linear/PCGSolver.h>
#include <gtsam/linear/GaussianFactorGraph.h>
#include <gtsam/linear/Preconditioner.h>
#include <gtsam/linear/Vec... | ALGO | 0.999245 | 7.108617 |
1457b6c3-ef39-4cdb-b5fe-8316e8192c92 | miko0030/Mikolaj-Simon | Algorytmy.cpp | #include <iostream>
#include <vector>
#include <stack>
#include <algorithm>
#include <conio.h>
#include <cstdio>
#include <fstream>
#include <sstream>
#include <ctime>
using namespace std;
vector<int> answers;
int mxWeight, mxValue;
const bool print = 1;
struct Przedmiot {
int weight;
int value;
int id;
};
bool ... | ALGO | 0.999887 | 3.584315 |
340ee93c-c14e-47f3-9df8-9bdf2cb78ef9 | uukh22/Problem-Solving | sheets ICPC ASSUIT/2# Loops/L - GCD/main.cpp | /************************************************************************بسم الله الرحمن الرحيم*************************************************************************/
/** "وما توفيقي الا بالله" ... | ALGO | 0.999969 | 4.397713 |
61567ea0-7659-4a6b-ab61-228b22d52d70 | RiddhiBarhate/DSA-in-Cpp | leetcode/2076-sum-of-digits-of-string-after-convert/2076-sum-of-digits-of-string-after-convert.cpp | class Solution {
public:
int getLucky(string s, int k) {
string num = "";
for(char ch : s){
int char_int = ch - 'a' + 1;
num += to_string(char_int);
}
int sum = 0;
while(k > 0){
sum = 0;
for(char ch : num){
sum ... | ALGO | 0.999929 | 6.250176 |
67154f02-902a-4cb9-a4b4-90757513d329 | Vidit-Ostwal-zz/DSA-Codes | 239-sliding-window-maximum/239-sliding-window-maximum.cpp | class Solution {
public:
vector<int> maxSlidingWindow(vector<int>& nums, int k) {
priority_queue<pair<int,int>> pq;
int ed = 0;
int st = 0;
while (ed < k && ed < nums.size())
{
pq.push(make_pair(nums[ed],ed));
ed++;
}
vector<int> final_vecto... | ALGO | 0.99999 | 5.939359 |
9483edd6-232c-4e48-8731-036bb5ba37da | ehnryx/acm | bad_code_from_long_ago/naq17/i.cpp | #include <bits/stdc++.h>
using namespace std;
#define _USE_MATH_DEFINES
//#define DEBUG
//#define USE_MAGIC_IO
#define ll long long
#define pii pair<int,int>
#define pdd pair<double,double>
#define ldouble long double
#define nl '\n'
const ll MOD = 1e9+7;
const int INF = 0x3f3f3f3f;
const ll INFLL = 0x3f3f3f3f3f3f3f3... | ALGO | 0.999782 | 4.134976 |
a672fd71-d1cc-4a6d-a1e2-3ef4f8689a8a | eTakazawa/procon-archive | atcoder.jp/agc003/agc003_a/Main.cpp | #include <bits/stdc++.h>
using namespace std;
int main(void){
string S;
cin >> S;
int n,s,e,w;
n = s = e = w = 0;
for(int i=0;i<S.size();i++){
if( S[i] == 'N' )n++;
else if( S[i] == 'S' )s++;
else if( S[i] == 'E' )e++;
else if( S[i] == 'W' )w++;
}
if( s > 0 && n == 0 || s == 0 && n > 0 ||
e > 0 && w ... | ALGO | 0.999988 | 3.908439 |
11742ef3-2ef8-49fa-acf4-49d8c3829bd0 | VedantVas/Basic-Patterns | pattern11.cpp | #include<iostream>
using namespace std;
void pattern11(int n){
int start =1;
for(int i=0;i<n;i++){
if(i%2==0) start = 1;
else start =0;
for(int j=0;j<=i;j++){
cout<<start<<" ";
start = 1-start;
}
cout<<endl;
}
cout<<endl;
}
int main(){
... | ALGO | 0.999988 | 3.560451 |
3c5669da-4443-4c3d-b476-3fec267e6c20 | aishaker129/Codeforces | Problem/A_Jagged_Swaps.cpp | /*
Alhamdulillah For Everything
Author --> Md. Akhlakul Islam
Date --> 02/03/2024
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl '\n'
int main(){
optimize();
int t; cin>>t;
int n;
... | ALGO | 0.999672 | 4.89222 |
73822973-02a9-4550-a445-6289b8526c6c | asdsteven/cuhkacm_storage | contests/week2/4.cpp | #include <cstdio>
#include <cstring>
char s[100001], q[200001];
int main() {
while (scanf("%s", s) == 1) {
int h = 100000, t = 100000;
int si = strlen(s);
for (int i = 0; i < si; i++) {
if (s[i] == '[') {
int j = ++i;
while (i < si && s[i] != '[' && s[i] != ']')
i++;
h -= i - j;
memcpy(q + h... | ALGO | 0.999531 | 3.19284 |
6492f78c-0c10-4ac8-b016-b5567103e4c1 | BOBSTK/LeetCode | 动态规划/M-322-零钱兑换/solution.cpp | class Solution {
public:
int coinChange(vector<int>& coins, int amount) {
if(coins.size() == 0)
return 0;
vector<int> dp(amount+1,amount+1); //dp[i]代表达到金额i时最少使用的硬币个数
dp[0] = 0; //初始值
for(int i=1;i<=amount;i++){
for(int j =0;j<coins.size();j++){
if(i-co... | ALGO | 0.999988 | 5.730991 |
9271336b-3cf3-4bd5-a5d7-16d71d938bd2 | ishman04/DSA-questions | linkedList/remove_nth_node_from_end_of_list.cpp | #include<iostream>
#include<vector>
#include<string>
#include<sstream>
#include<algorithm>
#include<stack>
#include<queue>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNo... | ALGO | 0.999924 | 5.465153 |
7d55a6e0-faf4-4d45-aded-6911409607de | neelchoudhury/cp | Codechef and Spoj/L-Z/STACK.cpp | #include<bits/stdc++.h>
using namespace std;
//Stacks implemented using Linked Lists
class stackLL{
struct node{
int info;
node *next;
};
typedef struct node* node_ptr;
node_ptr top;
public:
stackLL();
void push(int x);
int pop();
int size();
bool isEmpty();
void showStack();
};
stackLL::s... | ALGO | 0.994792 | 4.121447 |
0f690a0a-1d69-4eb5-b430-9b41e74c102c | qiaozishun4/CSP2024_BJ | BJ-Junior/answers/BJ-J01681/sticks/sticks.cpp | #include<bits/stdc++.h>
using namespace std;
int h[]={6,2,5,5,4,5,6,3,7,6};
int ans=1e9;
void dfs(int f,int x,int sum){
if(x==f){
if(sum!=0) ans=min(ans,sum);
return ;
}
for(int i=0;i<=9;i++){
if(x==0&&i==0) continue;
if(h[i]+x<=f){
dfs(f,x+h[i],sum*10+i);
}
}
}
int main(){
freopen("sticks.in","r",std... | ALGO | 0.99946 | 4.283475 |
3f8242b4-6479-4d48-8afa-26a576160cc2 | Eng-Gamal-megahed/Problem_Solving | friends.cpp | //
// DATE : Created by Gamal on 6/8/2024.
// LINK : https://vjudge.net/contest/586365#problem/Z
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define nl '\n'
#define all(a) a.begin(),a.end()
#define allr(a) a.rbegin(),a.rend()
#define f1(n)... | ALGO | 0.99994 | 5.054302 |
4f8fc35f-66e7-4733-a7df-20eaae7590c7 | xombra/pam-face-authentication | qtbranch/src/tracker.cpp | // #include <cstdio>
#include "cv.h"
#include "tracker.h"
//------------------------------------------------------------------------------
tracker::tracker() : trackerModelFeatureSizeX(0), trackerModelFeatureSizeY(0),
trackerModelFeatureVARIANCEX(0), trackerModelFeatureVARIANCEY(0),
trackerModelFeatureINTEGRALX(0)... | ALGO | 0.996782 | 5.071348 |
04a658ba-579e-49df-8dbc-ea7f794125e2 | manikanta2901/ubuntu | .history/practice/cpp/codeforces/moveBrackets_20200630165013.cpp | #include<bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#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 printVect(vect,dataStruc... | ALGO | 0.999375 | 3.853225 |
59d95e59-f8d2-4db3-aaa5-1703979f04af | markniu/PandaZHU | Marlin-2.0.x/Marlin/src/feature/bedlevel/hilbert_curve.cpp | /*********************
* hilbert_curve.cpp *
*********************/
#include "../../inc/MarlinConfig.h"
#if ENABLED(UBL_HILBERT_CURVE)
#include "bedlevel.h"
#include "hilbert_curve.h"
constexpr int8_t to_fix(int8_t v) { return v * 2; }
constexpr int8_t to_int(int8_t v) { return v / 2; }
constexpr uint8_t lo... | ALGO | 0.999676 | 5.682351 |
378c143d-97e7-4f57-8b97-13cb5f8b2f51 | Dudubraga/Competitive-Programming | Codeforces/dragons/dragons.cpp | #include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
using namespace std;
int main(){
vector<pair<int, int>>dragon;
pair<int, int>temp;
int S, N, x, y;
cin >> S >> N;
for(int i = 0; i < N; i++){
cin >> x >> y;
temp.first = x;
temp.second = y;
... | ALGO | 0.999978 | 3.831024 |
12ed5320-d1fc-446c-97e5-58824c4c795a | vidhi-kiet/Codechef | WATERCOOLER1.cpp | #include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
while(t--)
{
int x, y, m;
cin >> x >> y >> m;
if(x*m < y){
cout<< "YES" << endl;
}
else{
cout << "NO" << endl;
}
}
return 0;
}
| ALGO | 0.999782 | 3.802523 |
23565b47-2456-4fbd-8b7b-011e88d0435e | helloobaby/llvm_msvc | libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/ranges.remove.pass.cpp | // <algorithm>
// UNSUPPORTED: c++03, c++11, c++14, c++17
// template<permutable I, sentinel_for<I> S, class T, class Proj = identity>
// requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
// constexpr subrange<I> ranges::remove(I first, S last, const T& value, Proj proj = {});
// ... | TEST | 0.911419 | 7.885208 |
a9a364fa-87e3-4d43-9c55-0529c2b6f5d8 | Richard-m-j/LeetCode | 1786-CountTheNumberOfConsistentStrings/1786-CountTheNumberOfConsistentStrings.cpp | // Last updated: 7/24/2025, 8:26:02 AM
class Solution {
public:
int countConsistentStrings(string allowed, vector<string>& words) {
ios::sync_with_stdio(0);
cin.tie(0);
int res=0;
vector<int> mp(26,0);
for(char& c:allowed)
mp[c-'a']++;
for(auto& word: word... | ALGO | 0.999906 | 5.892437 |
8a722eba-8874-4c66-927a-72405f9be1d4 | sunilkumarswami/LeetCode-Pratice | Make Zeroes - GFG/make-zeroes.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:
void MakeZeros(vector<vector<int> >& a) {
// Code here
int n=a.size(),m=a[0].size();
vector<vector<int> > b=a;
... | ALGO | 0.999751 | 5.381414 |
7a2a12e7-45bd-4eee-8ecd-31c189974734 | uchiha-satyam/Codes | Delete a Node in Single Linked List - GFG/delete-a-node-in-single-linked-list.cpp | //{ Driver Code Starts
// C program to find n'th Node in linked list
#include <stdio.h>
#include <stdlib.h>
#include<iostream>
using namespace std;
/* Link list Node */
struct Node
{
int data;
struct Node* next;
Node(int x){
data = x;
next = NULL;
}
};
void append(struct Node** he... | ALGO | 0.999951 | 6.0847 |
51591291-0589-4f7f-9594-5faf612c34d8 | Polandr/algo_repo | genetic_algorithm/elements/crossover_uniform.cpp | [title]
Равномерное скрещивание
[details]
Равномерное скрещивание
[params]
double p_swap 0.1 вероятность обмена значениями выбранной пары генов
[code]
//:LOAD randreal.cpp
void crossover(population& P, int x, int y, parameters& par)
{
int n = P.n;
for( int k=0; k<n; k++ )
if( randreal(0,1) < par.p_swap )
swa... | ALGO | 0.999958 | 3.903288 |
319075c2-b386-4bd7-9c0b-599cdfce8b9f | aaiss0927/codetree-TILs | 240220/최소 점프 횟수/min-num-of-jumps.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
using namespace std;
int n;
vector<int> nums;
int ans = INT_MAX;
void process(int cur, int cnt) {
if (cur == n - 1) {
ans = min(ans, cnt);
return;
}
for (int i = 1; i <= nums[cur]; i++) {
if (cur + i <= ... | ALGO | 0.999771 | 4.035507 |
65a8a3c3-f621-4f77-948d-6a06fd589115 | sharmadeepak1999/leetcode-problems | 11-container-with-most-water/11-container-with-most-water.cpp | class Solution {
public:
int maxArea(vector<int>& height) {
// Using two nested loop, go through every combination of area we can generate and get the maximum area.
// We will use two pointer technique, we will calculate the area using left and right pointer, and compare it with the max are... | ALGO | 0.999985 | 6.814498 |
c2f07ffe-51b0-436d-9d26-3e183c7b4174 | ryanberckmans/topicmapping | Sources/Infomap-0.15.7/src/Infomap.cpp | #include <iostream>
#include <sstream>
#include <fstream>
#include <stdexcept>
#include "utils/Logger.h"
#include "io/Config.h"
#include "infomap/InfomapContext.h"
#include "utils/Stopwatch.h"
#include "io/ProgramInterface.h"
#include "io/convert.h"
#include "utils/FileURI.h"
#include "utils/Date.h"
#include <iomanip>
... | DATA | 0.985296 | 5.652705 |
2c5cfba7-1293-4008-99e5-8cc364626950 | danieltrt/SBFL | benchmarks/java/MINIMUM_INSERTIONS_TO_FORM_A_PALINDROME_WITH_PERMUTATIONS_ALLOWED.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <queue>
#include <fstream>
#include <iomanip>
#include <vector>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <numeric>
#include <algorithm>
#include <cstdlib>
#include <stri... | ALGO | 0.999139 | 5.381078 |
cea3383b-9bdb-4df0-b33b-a410411f3092 | imoncoc/C-and-C-plus-plus | Anisul Islam/C++ program/Calculating area of triangle.cpp | #include<iostream>
using namespace std;
int main()
{
double base,height,area;
cout<<"Enter Base : ";
cin>>base;
cout<<"Enter height : ";
cin>>height;
area= .5*base*height;
cout<<"Area of triangle = "<<area;
return 0;
}
| TOOL | 0.941344 | 4.425559 |
86b7de94-fd0d-48fa-8be7-573f21e95f02 | pablo-Acha/Progra-Competitiva | contest/div12-10-24/a.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;cin>>t;
while (t--){
int n,a,b;cin>>n>>a>>b;
int dis = abs(a-b)-1;
cout<<(dis%2 == 0? "NO": "YES")<<endl;
}
return 0;
} | ALGO | 0.999079 | 4.362436 |
84ad443c-02af-43c3-9016-768dc56a81f8 | palakbatra1999/DS_practice | 231-power-of-two/231-power-of-two.cpp | class Solution {
public:
bool isPowerOfTwo(int n) {
if(n==0)
return false;
if(n==1)
return true;
if(n%2==0)
return isPowerOfTwo(n/2);
else return false;
}
}; | ALGO | 0.992697 | 5.844255 |
4289c9ab-72b8-41fb-ae7b-0e62768ec588 | flanglet/kanzi-cpp | src/transform/RLT.cpp | #include <algorithm>
#include <cstring>
#include "RLT.hpp"
#include "../Global.hpp"
using namespace kanzi;
using namespace std;
const int RLT::RUN_LEN_ENCODE1 = 224; // used to encode run length
const int RLT::RUN_LEN_ENCODE2 = (255 - RUN_LEN_ENCODE1) << 8; // used to encode run length
const int RLT::RUN_THRESHOLD =... | ALGO | 0.996882 | 5.920406 |
65e73f10-0ece-40c9-a181-82aa13255284 | WindZQ/C_Plus_Plus_Concurrency_in_Action | Chapter_9_Advanced_Thread_Management/9.3.cpp | template<typename Iterator,typename T>
T parallel_accumulate(Iterator first, Iterator last, T init)
{
unsigned long const length = std::distance(first, last);
if(!length)
return init;
unsigned long const block_size = 25;
unsigned long const num_blocks = (length + block_size - 1) / block_size;
... | ALGO | 0.999893 | 5.635615 |
ef05e850-8411-46a5-902e-676f7c4df1c6 | priyansh19/data-structures-and-algorithms | non-linear-ds/BinarySearchTree.cpp | /*
* File: main.cpp
* Author: Priyanka
*
* Created on June 5, 2019, 6:12 AM
*/
#include <iostream>
#include<queue>
#include<climits>
using namespace std;
class Node
{
public :
int data;
Node *left;
Node *right;
};
Node* getNewNode(int a)
{
Node *temp = new Node();
temp->data=a;
temp->... | ALGO | 0.99961 | 4.203958 |
e8c25640-77ca-45c6-a282-4ee25805b80f | priyanshu-73/DSA-sheet | Arrays/sort012.cpp | #include<iostream>
#include<vector>
using namespace std;
void sort012(int a[], int n)
{
// code here
int s = 0;
int e = n - 1;
int mid = 0;
while(mid <= e){
if(a[mid] == 0){
swap(a[mid], a[s]);
s++;
mid++;
}
... | ALGO | 0.999802 | 4.519733 |
a6c6aae3-3a89-4557-bad5-d61c15f7451f | khushboosinghal25/learning-dsa- | decryptMessage.cpp | #include<iostream>
using namespace std;
int main(int argc, char const *argv[])
{
string str;
int key;
cout<<"Enter the string"<<endl;
cin>>str;
cout<<"Enter the key "<<endl;
cin>>key;
for(int i=0;i<str.length();i++)
{
char ch = str[i];
if(ch>='a' && ch<='z')
{
... | ALGO | 0.999852 | 4.598386 |
5f4561a4-7553-4b33-8efb-5753d0cac0db | fkjslee/leetcode | 525/main.cpp | #include <iostream>
#include <stack>
#include <vector>
using namespace std;
class Solution {
public:
int findMaxLengthCore(const vector<int>& nums) {
vector<int> sum;
sum.push_back(0);
for (int u : nums) {
sum.push_back(*(--sum.end()) + (u == 0 ? -1 : 1));
}
//... | ALGO | 0.999929 | 5.504446 |
36ff8460-b145-47c7-b3cf-dca1834ee2bf | khan-yin/leetcode | src/每日一题/2021-08/学生出勤记录I/solution.cpp | #include<string>
#include<iostream>
using namespace std;
class Solution {
public:
bool checkRecord(string s) {
int absents = 0, lates = 0;
for (auto &ch : s) {
if (ch == 'A') {
absents++;
if (absents >= 2) {
return false;
... | ALGO | 0.997723 | 4.584077 |
4acba983-c46c-4520-8cf3-7670858aa772 | heechan3006/CS | BOJ/BOJ_16920/BOJ_16920/소스.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <deque>
#include <vector>
#include <string>
#include <tuple>
#include <queue>
#include <algorithm>
#define MAXN 1000
using namespace std;
char map[MAXN][MAXN];
int N, M, P;
int S[10];
int dx[] = { 0,0,1,-1 };
int dy[] = { 1,-1,0,0 };
queue<int> q1;
queue<tup... | ALGO | 0.999982 | 3.331049 |
119a8683-21c1-4677-b794-36a34164f37d | varunnitian/data-structures-and-algorithms | bubble_sort.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int a[n];
for (int i = 0; i < n; i++)
{
cin>>a[i];
}
for (int i = 0; i < n-1; i++)
{
int flag=0;
for (int j = 0; j < n-1-i; j++)
{
if (a[j]>a[j+1])
{
int temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
flag=1;
if (flag==0)
{
return -1;
}
}
}
}
for ... | ALGO | 0.999989 | 3.516731 |
6b076a8f-3182-4942-9503-684c69d1932b | amrita40/SDE-SHEET | SDE Sheets/linked list/conversion_array_ll.cpp | // #include<bits/stdc++.h>
// using namespace std;
// class node{
// public: //its very neccsary inoder for declaring the as new node() otherwise it will give error.
// int data;
// node* next;
// node(int data1, node*next1=nullptr){
// data=data1;
// next=next1;
// }
// ... | ALGO | 0.999599 | 5.303877 |
4893f702-b20a-4265-8648-0e6464f3efe9 | rainbow-auto/rainbow-codes | Luogu/P2657.cpp | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <queue>
#define fastread ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define endl "\n"
using namespace st... | ALGO | 0.999846 | 3.983922 |
8fd3fe4d-b0fa-4de3-aea7-91b54f6548ea | iam-abbas/cs-algorithms | Sorting Algorithm/insertionsort.cpp | // C++ program for insertion sort
#include <bits/stdc++.h>
using namespace std;
/* Function to sort an array using insertion sort*/
void insertionSort(int arr[], int n)
{
int i, key, j;
for (i = 1; i < n; i++)
{
key = arr[i];
j = i - 1;
/* Move elements of arr[0..i-1], that are
greater than key,... | ALGO | 0.999991 | 6.167593 |
95948cd0-71cc-4870-b97c-edf0051325bf | Rebus2307/CursoCppProgramacionATS | Prac51_BusquedaBinaria.cpp | #include <iostream>
#include <conio.h>
using namespace std;
int main(){
int numeros[]={1,2,3,4,5};
int inf, sup, mitad, dato;
char band = 'F';
dato = 2;
//Algoritmo de la busqueda binaria
inf = 0;
sup = 5;
while (inf <= sup){
mitad = (sup+inf)/2;
if (numeros[mitad]... | ALGO | 0.999715 | 3.629206 |
c911efd0-145f-421b-91bc-fda794374da1 | praveenmehta010/dsa-c | Q1/QueueUsingLinkedList.cpp | #include <iostream>
using namespace std;
struct Node
{
int val;
Node *next;
Node(int val)
{
this->val = val;
next = NULL;
}
};
class Queue
{
private:
Node *front;
Node *back;
public:
Queue();
void enQueue(int x);
void deQueue();
void peekQueue();
void d... | ALGO | 0.978839 | 3.918882 |
e31ded4e-3c73-44c4-a3fb-f1919e821256 | tokisamu/btcoin-ng | src/bitcoin-cli.cpp | #if defined(HAVE_CONFIG_H)
#include <config/bitcoin-config.h>
#endif
#include <chainparamsbase.h>
#include <clientversion.h>
#include <optional.h>
#include <rpc/client.h>
#include <rpc/mining.h>
#include <rpc/protocol.h>
#include <rpc/request.h>
#include <tinyformat.h>
#include <util/strencodings.h>
#include <util/sys... | WEB | 0.969897 | 7.585812 |
b747fefb-2498-4035-b08d-45d214188522 | ranak8811/Codeforces | WayTooLongWords.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
int n;
cin>> n;
for (int i=0; i<n; i++) {
string s;
cin >> s;
if (s.length() > 10) {
cout << s[0] << s.length()-2 << s[s.length()-1] << endl;
}
else {
cout << s << endl... | ALGO | 0.998931 | 4.004179 |
9666b601-a4b4-4f2b-8fee-6a1a38ce2cad | PerKen127/Essential-Math-Assignment-2 | Essential Math Tutorial 6/Essential Math Tutorial 6 Starter/SpriteLib3.0-v2.0/include/Box2D/Collision/b2CollideEdge.cpp | #include "Box2D/Collision/b2Collision.h"
#include "Box2D/Collision/Shapes/b2CircleShape.h"
#include "Box2D/Collision/Shapes/b2EdgeShape.h"
#include "Box2D/Collision/Shapes/b2PolygonShape.h"
// Compute contact points for edge versus circle.
// This accounts for edge connectivity.
void b2CollideEdgeAndCircle(b2Manifold*... | ALGO | 0.999861 | 7.450849 |
a344f5a2-d170-4a92-a4c0-c864a79d4a6d | ajayjangid-51/dsa | dsasolve/solve/leetcode/minimum_characters_to_append_tomake_string_palindrome.cpp | #include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define sz(x) x.size()
#define ll long long
#define pint unsigned int
#define pb push_back
#define vb vector<bool>
#define vi vector<int>
#define vs vector<string>
#define vvi vector<vi>
#defin... | ALGO | 0.999952 | 4.511733 |
53b86e2d-03a5-417a-ab04-bf3b3c3c837a | ishandutta2007/codeforces | wxhtzdy/normal/1742/D.cpp | /**
* author: wxhtzdy
* created: 13.10.2022 16:39:29
**/
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int tt;
cin >> tt;
while (tt--) {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
... | ALGO | 0.999893 | 4.554544 |
5ffaf992-a61e-41eb-88d9-aaa00b23e882 | CSdlwr/OJ | POJ/3624/12894678_WA.cpp | #include <iostream>
using namespace std;
#define MAX_NUM 1000
#define MAX_M 13000
int n, m;
int w[MAX_NUM], d[MAX_NUM];
int v[MAX_NUM][MAX_M];
int maxValue(int i, int j);
int main() {
cin>>n>>m;
int i;
for (i = 0; i < n; ++i)
cin>>w[i]>>d[i];
memset(v, -1, sizeof(v));
cout<<maxValue(n-1, m)<<endl;
return 0;
... | ALGO | 0.999958 | 3.992985 |
159d0c7a-bcb7-4c6e-ac8a-2c06035e4dfe | JonJSON/cocos2d-x | Box2D/Dynamics/Joints/b2FrictionJoint.cpp | #include <Box2D/Dynamics/Joints/b2FrictionJoint.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2TimeStep.h>
// Point-to-point constraint
// Cdot = v2 - v1
// = v2 + cross(w2, r2) - v1 - cross(w1, r1)
// J = [-I -r1_skew I r2_skew ]
// Identity used:
// w k % (rx i + ry j) = w * (-ry i + rx j)
//... | ALGO | 0.989129 | 7.570709 |
294e26e2-d7ba-42dc-bb09-3f76cc7ff988 | Edge51/algorithm-practice | practise/others/016_bytedance.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <limits.h>
using namespace std;
pair<int, int> searchParent(vector<int>& nodes, int i, int left_right);
pair<int, int> searchChild(vector<int>& nodes, int i);
int main(){
int n, m;
cin >> n >> m;
vector<int> nodes(n + 1);
vector<int> ... | ALGO | 0.999923 | 3.99531 |
12452e6f-7466-40a4-8f39-8afe6d5e5db3 | Aayush2492/Codeforces-Problems | Live/07-09-2023/D.cpp | #include <bits/stdc++.h>
using namespace std;
using LLI = long long int;
template <typename T>
using VEC = vector<T>;
template <typename T>
using VV = VEC<VEC<T>>;
using PII = pair<int, int>;
int main()
{
int t;
cin >> t;
while (t--)
{
LLI n, x, y;
cin >> n >> x >> y;
LLI x... | ALGO | 0.999903 | 3.684835 |
b7b04e62-017c-445e-9c63-f9457bc268e4 | cjaques/ilastik-ssvm | lib/libDAI024/src/factorgraph.cpp | #include <iostream>
#include <iomanip>
#include <iterator>
#include <map>
#include <set>
#include <fstream>
#include <string>
#include <algorithm>
#include <functional>
#include <dai/factorgraph.h>
#include <dai/util.h>
#include <dai/exceptions.h>
#include <boost/lexical_cast.hpp>
namespace dai {
using namespace std;... | ALGO | 0.869086 | 6.876962 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.