uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
069d9dc9-7e0b-4e4a-ba89-f19808798ef0 | andreiarnautu/Algorithmic-Problems | crescator2.cpp | /**
* Worg
*/
#include <cmath>
#include <cstdio>
#include <vector>
#include <algorithm>
FILE *fin = freopen("crescator2.in", "r", stdin); FILE *fout = freopen("crescator2.out", "w", stdout);
const int mod = 700001;
int N, sol;
std::vector<std::vector<int > > a, b;
int main() {
scanf("%d", &N);
int rad = st... | ALGO | 0.999954 | 4.136481 |
b7d2fb13-41d8-4b1a-8932-afe5a705f07b | rupav/cp | competitive_coding/contests/globalRound9/C_Element_Extermination.cpp | #include<bits/stdc++.h>
using namespace std;
#define watch(x) cout << (#x) << " is " << (x) << endl
#define fr(i,n) for(int i=0; i<n; i++)
#define rep(i, st, en) for(int i=st; i<=en; i++)
#define repn(i, st, en) for(int i=st; i>=en; i--)
#define sq(a) (a) * (a)
typedef long long ll;
typedef pair<int, int> pii;
typedef... | ALGO | 0.999971 | 4.180867 |
040b0669-7095-4667-aa7d-9adc4715df4d | aaryan6789/cppSpace | LinkedList/add_two_lists_2.cpp | /*
* add_two_lists_2.c
*
* Created on: Apr 29, 2018
* Author: Harsh
*/
/*
Recursion is used here to calculate sum from right to left.
Following are the steps.
1) Calculate sizes of given two linked lists.
2) If sizes are same, then calculate sum using recursion.
Hold all nodes in recursion call stack till... | ALGO | 0.997325 | 5.314044 |
03a21976-82d9-4856-b40e-148991f46045 | TashinParvez/Competitive-Programming-Journey | Some-URI-and-Codechef-Solutions/2.12.22/first.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
for(int i=0; i<t; i++)
{
int a,b;
cin>>a>>b;
int count =0;
for(int ii=a; ii<b; ii++)
{
// cout<<(int)sqrt(ii)<<" ";
int flag =0;
for(int j=2;j<(int)sqrt(i... | ALGO | 0.999619 | 3.965762 |
a5f5a377-9929-422f-b642-d3407c322560 | ibrahim-debugger1/problem-solving | Best Time to Buy and Sell Stock.cpp | int maxProfit(vector<int>& prices) {
int n=prices.size(),sol=0;
int dp[n];
memset(dp,0,sizeof dp);
for(int i=n-2;i>=0;i--){
dp[i]=max(0,(prices[i+1]-prices[i])+dp[i+1]);
}
for(int i=0;i<n;i++){
sol=max(sol,dp[i]);
}
return sol;
} | ALGO | 0.999646 | 5.802723 |
bc13f875-2c53-442a-83dc-0f8825647176 | talinke/lammps_langevin | src/BPM/bond_bpm_spring_plastic.cpp | /* ----------------------------------------------------------------------
Contributing author: Joel Clemmer (SNL)
------------------------------------------------------------------------- */
#include "bond_bpm_spring_plastic.h"
#include "atom.h"
#include "citeme.h"
#include "comm.h"
#include "domain.h"
#include "e... | ALGO | 0.869447 | 7.038021 |
10e2ec19-5c2d-4cb3-ad19-8b494e8c53ea | PollockCR/School | CS302-Data-Structures/PA07-L9/show9.cpp | //--------------------------------------------------------------------
//
// Laboratory 9 show9.cpp
//
// Linked implementation of the showStructure operation for the
// Binary Search Tree ADT
//
//--------------------------------------------------------------------
//-------... | ALGO | 0.999428 | 5.900695 |
8a1bcd2d-5a68-4ae2-8b3f-d1bc971d31b5 | ArchieMeng/debian-mesa | src/amd/compiler/aco_print_asm.cpp | #include "aco_ir.h"
#include "util/u_debug.h"
#if AMD_LLVM_AVAILABLE
#if defined(_MSC_VER) && defined(restrict)
#undef restrict
#endif
#include "llvm/ac_llvm_util.h"
#include "llvm-c/Disassembler.h"
#include <llvm/ADT/StringRef.h>
#include <llvm/MC/MCDisassembler/MCDisassembler.h>
#endif
#include <array>
#include <... | TOOL | 0.876779 | 7.421905 |
a0fb984d-d7a4-4534-a5ad-9b03cff2f1db | JinYeJin/algorithm-study | June~October, 2020/2020-07-24/1477_휴게소세우기_이상옥.cpp | #include <stdio.h>
#include <algorithm>
using namespace std;
int N,M,L,station[100];
bool check(int m){
int p=0, s_cnt=0, M_cnt=0; //p현재 위치.,
while(p<L){
if(M<M_cnt) return false;
if(s_cnt==N or (p+m)<station[s_cnt]){
M_cnt++;
p+=m; //p+m 지점에다가 휴게소를 설치.
}
... | ALGO | 0.999996 | 3.751971 |
17af9a8d-cf3f-4f4c-994b-aba26d85ef63 | yoogledev/DataStructure | ExpressionTree/ExpressionTree/main.cpp | #include <iostream>
#include "ExpressionTree.hpp"
using namespace std;
int main(int argc, const char * argv[]) {
char exp[] = "12+7*";
BTreeNode * eTree = MakeExpTree(exp);
cout << "전위 표기법의 수식: ";
ShowPrefixTypeExp(eTree);
cout << endl;
cout << "중위 표기법의 수식: ";
ShowInfixTypeExp(eT... | ALGO | 0.999279 | 4.638647 |
4670e0c8-e718-4a48-ae80-7ac9ef94e61f | varshneyanushka/codeforces | 1971E.cpp | #include<bits/stdc++.h>
#include <iostream>
#define ll long long
using namespace std;
void solve() {
int n,k,q;
cin>>n>>k>>q;
int a[k];
for(int i=0;i<k;i++)
{
cin>>a[i];
}
int b[k];
for(int i=0;i<k;i++)
{
cin>>b[i];
}
int c[k];
c[0]=a[0]/b[0];
for(int... | ALGO | 0.999897 | 3.008907 |
ba22e967-8857-4cd6-a11e-df3a96e85c8e | notjik/mipt-cpp-dsa | semester-1/week-04--function-references-and-simple-sorting/d--the-perimeter-of-the-triangle.cpp | /*
* D. Периметр треугольника
Ограничение времени 1 секунда
Ограничение памяти 256Mb
Ввод стандартный ввод или input.txt
Вывод стандартный вывод или output.txt
Напишите функцию, вычисляющую длину отрезка по координатам его концов. С помощью этой функции напишите программу, вычисляющую периметр треугольника по координа... | ALGO | 0.998709 | 4.763074 |
e74bb2c3-5808-484a-971b-6433ccceded1 | naimqayyim/nswitch | src/video_core/renderer_vulkan/wrapper.cpp | #include <algorithm>
#include <exception>
#include <memory>
#include <optional>
#include <utility>
#include <vector>
#include "common/common_types.h"
#include "video_core/renderer_vulkan/wrapper.h"
namespace Vulkan::vk {
namespace {
void SortPhysicalDevices(std::vector<VkPhysicalDevice>& devices, const InstanceDis... | TOOL | 0.882598 | 7.634802 |
ac5fe647-17c2-4fc6-bf8a-92107b2f0334 | kovdan01/otus-cpp | 09-bayan/src/main.cpp | #include "mask_filesystem_traverser.h"
#include "duplicate_finder.h"
#include "hash/crc32.h"
#include "hash/crc16.h"
#include <boost/program_options.hpp>
#include <iostream>
#include <filesystem>
#include <regex>
namespace fs = std::filesystem;
template <typename Hash>
void job(std::size_t block_size, my::IFilesyst... | ALGO | 0.92934 | 5.899792 |
2e532856-873f-4393-aca1-ed0bf106ae8c | Siddhimahajan5801/Assignment43 | 43-10.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
int required_length(int a[], int k, int N)
{
priority_queue <int> pq;
int sum=0,count=0;
for(int i=0; i<N; i++)
{
pq.push(a[i]);
}
while(!pq.empty() && sum<k)
{
sum = sum + pq.top();
pq.pop();
... | ALGO | 0.999789 | 4.416961 |
b04ebe11-6561-4819-a566-f4fff021eb85 | limon2009/ACM-UVA-Online-Judge-solution | 300.cpp | #include <stdio.h>
#include <string.h>
char X[20][10]={"imix","ik","akbal","kan","chicchan",
"cimi","manik","lamat","muluk","ok",
"chuen","eb","ben","ix","mem","cib",
"caban","eznab","canac","ahau"};
int ResolveMonth (char P[100])
{
char X[19][10]={"pop","no","zi... | ALGO | 0.997557 | 3.326099 |
bad99591-1fcc-4266-96b2-a690474a9c85 | Lesords/ACM | hdoj/刷题/Ignatius and the Princess III.cpp | #include<iostream>
using namespace std;
int main() {
int n,a[121]={0};
a[0]=1;
for(int i=1;i<=120;i++) {
for(int j=0;j<121;j++)
if(a[j]!=0&&i+j<121) a[i+j]+=a[j];
}
while(cin>>n) cout<<a[n]<<endl;
return 0;
}
| ALGO | 0.999843 | 3.039402 |
5acbd863-f5ad-4892-8d33-f2c3729f5279 | javidhsueh/character_anim_combo | mocap/mocapPlayer/vector.cpp | /*
Revision 1 - Steve Lin (CMU), Jan 14, 2002
Revision 2 - Alla Safonova and Kiran Bhat (CMU), Jan 18, 2002
Revision 3 - Jernej Barbic and Yili Zhao (USC), Feb, 2012
*/
#include <cmath>
#include <cstdio>
#include "transform.h"
#include "types.h"
#include "vector.h"
vector operator-( vector const& a, vector const& b ... | ALGO | 0.95358 | 4.018229 |
89312edc-d2a3-4318-9e5b-675081872465 | Mustafa-Noor/PF-First-Semester | Programming Day/PDWeek07/task8.cpp | #include <iostream>
#include <iomanip>
using namespace std;
void transportation(int count);
main()
{
int count;
cout << "Enter the count of cargo for transportation: ";
cin >> count;
transportation(count);
}
void transportation(int count)
{
float tonnage;
float mini=0;
float truck=0;
... | TOOL | 0.992822 | 3.998334 |
10cf7647-cb02-4e2f-96a2-6422d3ad5270 | saubhaggya-srivastava/Gfg-Dpp | Medium/Node at distance/node-at-distance.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
#define MAX_HEIGHT 100000
// Tree Node
struct Node
{
int data;
Node* left;
Node* right;
};
// Utility function to create a new Tree Node
Node* newNode(int val)
{
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
... | ALGO | 0.999608 | 6.287182 |
8a9c1562-5254-44d3-b91e-0c1261598367 | shackiru/C_Programming | Data Structure/Session 03/stackLinkedList.cpp | #include <stdio.h>
#include <stdlib.h>
#define MAX 5
struct node
{
int val;
struct node * next;
};
struct node * stack = NULL;
int countEl;
struct node * createNode(int val)
{
struct node *temp = (struct node *) malloc(sizeof(struct node));
temp->val = val;
temp->next = NULL;
return temp;
}
... | ALGO | 0.997001 | 4.17823 |
927e0e88-349d-4032-8273-6f7663c86920 | ALK222/ED | Ejercicios_Colas/Recorrer-Lista-Enlazada_V2/recorrer_lista_enlazada.cpp | // Nombre del alumno Alejandro Barrachina Argudo
// Usuario del Juez A08
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include "queue_eda.h"
#include "horas.h" // Ejercicio 2
class propSerPar
{
public:
bool operator()(horas h)
{
horas aux = horas(12, 00, 00);
retu... | ALGO | 0.998348 | 4.82198 |
26f94b62-2e4c-4b95-8777-c798a62327bb | astro-heree/DSA | B_Matrix_Stabilization.cpp | #include<bits/stdc++.h>
#define fast_io() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
#define ll long long
#define ss second
#define ff first
#define endl '\n'
int MOD = 1e9+7;
bool isValid(int x, int y, int n, int m){
if(x < 0 || x >= n || y < 0 || y >= m) return false;
... | ALGO | 0.999976 | 4.941715 |
9efb184a-24e5-4f13-8a16-5265c136a1b1 | nimaohamdi/class_project | Untitled-11.cpp | #include<iostream>
using namespace std;
int set(int a,int b,int c,int d,int e) {
return (a + b + c + d + e) / 5;
}
int main(){
int a,b,c,d,e,avrage;
cout<<"Enter 5 numbers: ";
cin>>a>>b>>c>>d>>e;
avrage=set(a,b,c,d,e);
cout<<"Average: "<<avrage<<endl;
return 0;
} | ALGO | 0.990495 | 3.502102 |
8b55f726-266b-4e84-97a4-002d8c84f5f7 | ikuo-suyama/competitive-programming | atcoder-problems/abc114_c.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repi(i, s, n) for (int i = (s); i < (n); i++)
#ifdef LOCAL
#define INPUT_FILE \
ifstream in("atcoder-problems/abc114_c.txt"); \
cin.rdbuf(in.rdbuf());
#define print_vec(v) ... | ALGO | 0.99939 | 3.901673 |
dc4e8c34-a6c3-4286-865e-367c8d47292a | DDongYeop/Algorithm | C++/BAEKJOON/1874 - 스택 수열.cpp | #include <iostream>
#include <vector>
#include <stack>
using namespace std;
int main()
{
int num, input, index = 0;
stack<int> stk;
vector<char> chVec;
cin >> num;
for (int i = 0; i < num; ++i)
{
cin >> input;
while (stk.empty() || stk.top() < input )
{
++in... | ALGO | 0.999996 | 3.934527 |
926e06f0-1a73-4793-9b23-07c610a1c755 | jatinsharrma/Practice | check-for-bst.cpp | /**
* @author Jatin Sharma
* @date 24 Jul 2024
* @problem https://www.geeksforgeeks.org/problems/check-for-bst/1
*/
#include <iostream>
#include <vector>
#include <queue>
#include <string>
#include <sstream>
using namespace std;
// Tree Node
struct Node {
int data;
Node* left;
Node* right;
Node(int ... | ALGO | 0.999943 | 6.565797 |
a8135353-d3c3-4d91-b129-1e1f2a133107 | Michoumichmich/Moteur-Graphique | src/raytracer/RT_RayEnvIntersector.cpp | #include "RT_RayEnvIntersector.h"
#include <config.h>
#include <cmath>
#include <optional>
RT_RayEnvIntersector::RT_RayEnvIntersector(Environment *env) {
this->environment = env;
}
std::optional<struct RT_IntersectorResult> RT_RayEnvIntersector::RT_RayFindIntersection(const Point3D origin, const Vector direction)... | ALGO | 0.985391 | 5.544242 |
de1e2b9b-c530-46bd-8cea-08b2ddbcdc49 | sshadr/chaotic-fractals | lib/diff-isogaussian-rasterization/third_party/glm/test/gtx/gtx_pca.cpp | #define GLM_ENABLE_EXPERIMENTAL
#include <glm/glm.hpp>
#include <glm/gtx/pca.hpp>
#include <glm/gtc/epsilon.hpp>
#include <glm/gtx/string_cast.hpp>
#include <cstdio>
#include <vector>
#if GLM_HAS_CXX11_STL == 1
#include <random>
#endif
template<typename T>
T myEpsilon();
template<>
GLM_INLINE GLM_CONSTEXPR float myEp... | TEST | 0.967616 | 6.783124 |
de62454d-4dd9-44d3-851f-972cee99ff94 | NaimSS/ICPC-Summer-2025 | bapc2021/l.cpp | #include <bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<(b);++i)
using namespace std;
typedef long long ll;
int32_t main(){
ios_base::sync_with_stdio(0);cin.tie(0);
int n;
cin >> n;
vector<pair<ll,ll> > s;
rep(i,0,n){
ll x=0;
rep(j,0,n){
int c;cin >> c;
x... | ALGO | 0.999834 | 3.650705 |
153cf362-9da9-4cc9-8422-20c74f212a02 | MichaelGaraev/QuickSort | Quicksort/main.cpp | #include <iostream>
#include <algorithm>
#include "quicksort.h"
int main(int argc, char* argv[])
{
const int len = 10;
int array_test[len] = { 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
sort(array_test, array_test + len - 1, comparator_lambda);
for (int i = 0; i < len; i++)
{
std::cout << array_test[i] << " ";
}
ret... | ALGO | 0.998739 | 5.417949 |
327f4219-03be-476e-9540-b5f4aa199c92 | breadyzhang/CS225 | lab_btree/btree.cpp | /**
* @file btree.cpp
* Implementation of a B-tree class which can be used as a generic dictionary
* (insert-only). Designed to take advantage of caching to be faster than
* standard balanced binary search trees.
*/
/**
* Finds the value associated with a given key.
* @param key The key to look up.
* @return T... | ALGO | 0.999807 | 7.283325 |
9dfb66f5-5bf7-4c3c-8db1-96f087fe07fc | ahirwarvivek19/LeetCode-Repo | find-all-possible-recipes-from-given-supplies/find-all-possible-recipes-from-given-supplies.cpp | class Solution {
public:
vector<string> findAllRecipes(vector<string>& recipes, vector<vector<string>>& ingredients, vector<string>& supplies) {
vector<string> res;
int n = recipes.size();
unordered_set<string> s;
for(auto x:supplies)
{
s.insert(x);
}
... | ALGO | 0.99996 | 5.699477 |
b8ff6973-3fcb-4337-a12e-bd34ae76a55f | lbryio/lbrycrd-dependencies | boost_1_59_0/libs/geometry/example/c04_a_custom_triangle_example.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
#include <iostream>
#include <boost/array.hpp>
#include <boost/geometry/algorithms/area.hpp>
#include <boost/geometry/algorithms/centroid.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/register/ring.hpp>
#include <boost... | TOOL | 0.994476 | 7.904403 |
b575a2f4-f63f-479c-acec-90ca96af7bdc | BinElvan3126/MyFirstRepo | Week4/Linkedlist.cpp | #include <iostream>
#include <cassert>
using namespace std;
struct NODE
{
int key;
NODE *p_next;
};
struct List
{
NODE *p_head;
NODE *p_tail;
List(NODE *head = nullptr, NODE *tail = nullptr) : p_head(head), p_tail(tail) {}
};
// --- Define function prototypes ---
NODE *createNode(int data);
List *... | ALGO | 0.991857 | 5.007146 |
8cf7769a-5250-4411-ac2d-09e8ec423789 | webaverse-studios/avatars-wasm | physx/source/physxextensions/src/tet/ExtDelaunayTetrahedralizer.cpp | #include "ExtDelaunayTetrahedralizer.h"
#include "foundation/PxSort.h"
#include "foundation/PxHashMap.h"
#include "ExtUtilities.h"
namespace physx
{
namespace Ext
{
using Triangle = Gu::IndexedTriangleT<PxI32>;
//http://tizian.cs.uni-bonn.de/publications/BaudsonKlein.pdf Page 44
static const PxI32 neighborFaces[4... | ALGO | 0.996493 | 6.72449 |
ffa01b7b-a9de-46b7-94e6-3b2696110eb3 | jorcame/testing | 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 |
4cf1c448-75b3-438a-abcf-8e74064910d0 | annereinarz/ExaHyPE-Workshop-Engine | Submodules/Peano/src/toolboxes/matrixfree/solver/Smoother.cpp | #include "matrixfree/solver/Smoother.h"
#include "tarch/Assertions.h"
#include <cmath>
matrixfree::solver::Smoother::Smoother():
_omega(1.0),
_normOfSolutionMax(0.0),
_normOfSolutionH(0.0),
_measureUpdateUInMaxNorm(0.0),
_measureUpdateUInHNorm(0.0),
_residualInMaxNorm(0.0),
_residualInEukledianNorm(0.0)... | ALGO | 0.996967 | 5.825782 |
677d5cad-4569-4596-aff7-15d79712e657 | shuba400/warehouse-optimization | Version0/multiple_destination/codes/checkerV0.cpp | /*
Input Format
ROWS COLUMNS DOCKING_TIME VELCOCITY
NUM_OF_ROBOTS NUM_OF_ORDERS
(for each of next NUM_OF_ORDERS)
SIZE_OF_NEW_ORDER
(for SIZE_OF_NEW_ORDER)
COORD_X COORD_Y
*/
/*
Docking time ==> time required pick a single time from rack/cell
t = dist/v + x*d
v*t = di... | ALGO | 0.99946 | 5.101389 |
396677c2-40d5-4064-93af-b6ed7044750b | shahfaiz-07/dsa_archives | BinaryTree/Leetcode/Medium/ValidateBST/ValidateBST.cpp | // https://leetcode.com/problems/validate-binary-search-tree/
#include<bits/stdc++.h>
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,... | ALGO | 0.999977 | 6.423957 |
1c4e57c6-e1e8-46b1-a135-b6861d301301 | Tavares194/c-classes | Listas 1/Lista 1 sala/Exercício 6 da Lista executada em sala de aula.cpp | #include <stdio.h>
#include <conio.h>
#include <locale.h>
int main()
{
setlocale(LC_ALL, "Portuguese");
float A, B, C, D;
printf("Vou calcular a prestao em atraso, digite o valor:");
scanf("%f", &A);
printf("Digite a Taxa:");
scanf("%f", &B);
printf("Digite o Tempo em meses:");
scanf("%f", &C);
D= A+(A*(B/100... | TOOL | 0.968084 | 3.034431 |
a5c0febd-29e7-4a4a-a78f-f0f4fec0091a | sakshamchecker/DSA | Stack/Stack.cpp | #include <iostream>
#include <stack>
using namespace std;
void print(stack<char> s1){
while(s1.empty()==0){
cout<<s1.top()<<endl ;
s1.pop();
}
}
// void mer(stack<char> s1,stack<char> s2){
// string a[s1.size() + s2.size()];
// int i=0;
// while(s1.empty()==0){
// a[i]=s1.top();
// s1.pop();
// i++;
// ... | ALGO | 0.999822 | 4.303791 |
baffb2c7-d4eb-4b49-8fea-e3f81d073e2e | Prajjwal-5432/Leetcode-Solutions | DP/Hard/23.Maximum Height by Stacking Cuboids.cpp | //Link: https://leetcode.com/problems/maximum-height-by-stacking-cuboids/
class Solution {
public:
int dp[111][111];
vector<vector<int>> v;
int dfs(int ind, int prev) {
if(ind == v.size()) return 0;
if(dp[ind][prev] != -1) return dp[ind][prev];
int ans = dfs(ind + 1, p... | ALGO | 0.999953 | 6.097048 |
1153b854-2cd2-49c2-9cd9-56edb368cfff | AnantGabhane/Array-Problems | Doubt class problems/fistrepeat.cpp | #include <iostream>
using namespace std;
int firstrepeat(int arr[],int n){
unordered_map<int,int> cnt;
int currentelement = arr[i];
} | ALGO | 0.998766 | 4.333076 |
0cc0f9a8-5fb6-42b0-ac5c-0a339a140d4f | sunnyajit/My_Leetcode_sol | 1577-42-2401-longest-nice-subarray/1577-42-2401-longest-nice-subarray.cpp | class Solution {
public: // code written by sunny
int longestNiceSubarray(vector<int>& nums) {
int left = 0, bitMask = 0, maxLen = 0;
for (int right = 0; right < nums.size(); right++) {
while ((bitMask & nums[right]) != 0) {
bitMask ^= nums[left];
lef... | ALGO | 0.999985 | 5.78509 |
606749e4-827b-404c-a2f5-2db27988d8c5 | HEltim7/cpcode | Archive/ucup/ucup2023Shandong/A.cpp | #include <algorithm>
#include <array>
#include <cassert>
#include <cstring>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <tuple>
#include <vector>
using namespace std;
#define endl '\n'
using LL=long long;
constexpr int N=1e5+10;
template<typename I,typename L,I mod> ... | ALGO | 0.999673 | 4.438766 |
f96ddc4b-80be-4f06-833f-a06d6ffc7bff | bitcoinanatomy/bitcoinanatomy | src/codebase/bitcoin-0.5.1 Github b12fc3e11/src/protocol.cpp | #include "protocol.h"
#include "util.h"
#ifndef WIN32
# include <arpa/inet.h>
#endif
// Prototypes from net.h, but that header (currently) stinks, can't #include it without breaking things
bool Lookup(const char *pszName, std::vector<CAddress>& vaddr, int nServices, int nMaxSolutions, bool fAllowLookup = false, int p... | TOOL | 0.859474 | 4.504156 |
8286af16-a696-416a-b048-a983ce6618cb | mohamedbadr12/Bookly | 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 |
080be8f0-9c23-4ac9-ba3b-9c68c106b572 | GaisaiYuno/OI-Record-exe-deleted | Grade 10-12/2018 autumn/NOIP/NOIP2018提高组Day1程序包/GD-Senior/answers/GD-0027/money/money.cpp | #include <stdio.h>
#include <stdlib.h>
#include <algorithm>
const int MAX_N = 100 + 10 , MAX_S = 25e3 + 10 ;
bool f[MAX_S] ;
int T , n , m , ma , a[MAX_N] ;
inline int read() {
char c = getchar() ;
int num = 0 , f = 1 ;
for (; c < '0' || c > '9' ; c = getchar()) if (c == '-') f = -f ;
for (; c >= '0' && c <= '9... | ALGO | 0.999711 | 4.560847 |
77b3fa6d-d009-429c-8ef3-b6bb5371aa1e | LanFear-Li/GAMES202-QUIZ | PA2/prt/ext/eigen/doc/examples/Tutorial_BlockOperations_colrow.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::MatrixXf m(3,3);
m << 1,2,3,
4,5,6,
7,8,9;
cout << "Here is the matrix m:" << endl << m << endl;
cout << "2nd Row: " << m.row(1) << endl;
m.col(2) += 3 * m.col(0);
cout << "After adding 3 times the first colu... | ALGO | 0.985313 | 3.586171 |
d3b4da7d-73ad-4b21-b1cb-cc256c4ad62f | TanvirHasanEmn/Movie_UI | 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 |
c1c3ffe9-025e-433c-866c-d1e6b3137c86 | kasra/vp-g2o | g2o/solvers/csparse/solver_csparse.cpp | #include "linear_solver_csparse.h"
#include "g2o/core/block_solver.h"
#include "g2o/core/solver.h"
#include "g2o/core/optimization_algorithm_factory.h"
#include "g2o/core/sparse_optimizer.h"
#include "g2o/core/optimization_algorithm_gauss_newton.h"
#include "g2o/core/optimization_algorithm_levenberg.h"
#include "g2o/... | ALGO | 0.998725 | 6.420414 |
113ecbc3-c0b1-4605-bc13-9392c4e7f023 | fsichetti/bezier | src/validity/lagvec/lagrangeVector_3_2_1.cpp | #include "../lagrangeVector.hpp"
#define R(p, q) (Interval(p) / q)
#define I const Interval
namespace element_validity {
template<>
void lagrangeVector<3, 2, 1>(const span<const fp_t> cpFP, const span<Interval> out) {
assert(cpFP.size() == 18);
assert(out.size() == 9);
std::array<Interval, 18> cp;
for (uint i = ... | ALGO | 0.988534 | 4.952613 |
c52326d0-ca08-4e5d-b52a-36bad56e21fb | mdtalhaba/algorithms | Week_4 (week_1_2_3 Recap Module)/BFS.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 1e3+5;
vector<int> adj[N];
bool visited[N];
int level[N];
void bfs(int s)
{
queue<int> q;
q.push(s);
visited[s] = true;
level[s] = 0;
while (!q.empty())
{
int u = q.front();
q.pop();
cout<<"Visiting Node : "<<u... | ALGO | 0.99996 | 4.510707 |
b7264191-cff3-406b-b97f-92bd190c6ff3 | PhuocVinhLee/LuanVan_CNTT | online_exam_system_backend/temp/4k5cpyt1.cpp | #include <stdio.h>
int main() {
int number1, number2, sum;
// printf("Enter two integers: ");
scanf("%d %d", &number1, &number2);
// calculate the sum
sum = number1 + number1;
printf("%d",sum);
return 0;
}
| TOOL | 0.995185 | 3.534392 |
6c865fdc-06a6-4d71-b4dd-b56b563c4003 | ishandutta2007/codeforces | aropan/normal/461/B.cpp | #include <iostream>
#include <cstdio>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <vector>
using namespace std;
template <typename T> T sqr(T x) { return x * x; }
template <typename T> T abs(T x) { return x < 0? -x : x; }
template <typename T> T gcd(T a, T b) { return b? gcd(b, a % b) : a; }
#de... | ALGO | 0.999949 | 3.875565 |
db3040b8-6933-442e-be43-26229387ccb8 | ashmit27j/DSA | Patterns/Reverse-EquilateralTriangle.cpp | /*
5 4 3 2 1
4 3 2 1
3 2 1
2 1
1
*/
#include <iostream>
using namespace std;
int main()
{
for (int i = 5; i >= 1; i--)
{
for (int k = i; k < 5 ; k++)
{
cout << " ";
}
for (int j = i; j >= 1; j--)
{
cout << j << " ";
}
cout... | ALGO | 0.999954 | 3.568124 |
c23ae75d-7a7f-4753-bfee-8921e3c86055 | mcmachado/b-pro | B-PROST/common/Mathematics.cpp | /****************************************************************************************
** Mathematical tools that may be useful across several applications, even outside ALE
** environment. This class is meant to be static since ideally this should only implement
** functions. Adding non-static objects should be fur... | ALGO | 0.984306 | 4.697136 |
a478900e-7ce9-4f81-8ece-9cd3d251e2a1 | anubhav-bhard/Competitive-Programming-June-Course- | Aman/Arrays & strings/Longest Consecutive Sequence.cpp | class Solution {
public:
int longestConsecutive(vector<int>& nums) {
if(nums.size() < 2) return nums.size();
unordered_map<int,int> m;
int c = 0;
for(int i=0;i<nums.size();i++)
{
m[nums[i]]++;
}
for(int i=0;i<nums.siz... | ALGO | 0.999924 | 5.565809 |
7f7b0340-9851-4cf2-98ca-aa23d05fd048 | egorserdyuk/telegram-bot-api-arms | telegram-bot-api/td/td/telegram/ConfigManager.cpp | #include "td/telegram/AuthManager.h"
#include "td/telegram/ConnectionState.h"
#include "td/telegram/Global.h"
#include "td/telegram/JsonValue.h"
#include "td/telegram/LinkManager.h"
#include "td/telegram/logevent/LogEvent.h"
#include "td/telegram/MessageReaction.h"
#include "td/telegram/misc.h"
#include "td/telegram/ne... | TOOL | 0.917154 | 7.162559 |
8e3999a8-cebd-4778-8e05-4c84d3b97925 | Ajy74/google_map_integration | 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.998809 | 6.763549 |
6468f60d-9d2f-4e80-bea1-68c4fc2e8dc9 | k--chow/DataStructuresandAlgorithms | Algorithms/C++/Prims.cpp | #include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <math.h>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sstream>
#include <unordered_map>
#include <queue>
#include <tuple>
using namespace std;
typedef pair<int, int> pii;
typedef tuple<int, in... | ALGO | 0.999966 | 4.404606 |
41c4b885-cd47-49a9-9e14-e7e274071d34 | shinypantzzz/treebook | desktop/treebook/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.995554 | 6.772262 |
948592f0-d2bc-42ff-a2f6-d006b52208de | yja938882/CSE | coding_problem/baekjoon_14499.cpp | #include <iostream>
using namespace std;
const int EAST = 1;
const int WEST = 2;
const int NORTH = 3;
const int SOUTH = 4;
const int TOP = 0;
const int BOTTOM = 1;
const int EAST_SIDE = 2;
const int WEST_SIDE = 3;
const int NORTH_SIDE = 4;
const int SOUTH_SIDE = 5;
struct dice{
int n; // 행
int m; // 열
int elem[6];... | ALGO | 0.999743 | 3.971871 |
75aad2a3-cec6-4d6c-92ff-f321ddfb2974 | Kinter/TIL | Algorithm/BOJ/Math/1629번 곱셈.cpp | #pragma warning(disable:4996)
#include <stdio.h>
long long a, b, c;
long long int mp(int a, int b)
{
if (b == 0) {
return 1LL;
}
else if (b == 1) {
return a%c;
}
else if (b % 2 == 0) {
long long temp = mp(a, b / 2) % c;
return (temp*temp) % c;
}
else {
return (a*mp(a, b - 1)) % c;
}
}
int main()
{
... | ALGO | 0.999984 | 4.095914 |
b8502d7a-9f01-40f0-935d-3754280154ab | yellowHatpro/Codes-Practice | Graphs/CheapestFlightsWithinKStops.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int CheapestFLight(int n, vector<vector<int>>& flights, int src, int dst, int K) {
vector<vector<pair<int,int>>> adj(n);
for (auto itr : flights) {
adj[itr[0]].push_back({itr[1],itr[2]});
}
queue<pair<int,pair<... | ALGO | 0.999935 | 5.428144 |
b7e2efb1-0af0-45e9-a66b-e5b625dd8104 | ShadowIsNotTim/TradingBot | TradingBot.cpp | #include <iostream>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <fstream>
#include <thread>
using namespace std;
using ll = long long;
using dl = long double;
const ll INF = 3e18;
... | DATA | 0.991706 | 3.901224 |
cc0a969b-212a-4bbd-9ed0-d44d54efbdd8 | project64/project64 | Source/3rdParty/asmjit/src/asmjit/core/rapass.cpp | #include "../core/api-build_p.h"
#ifndef ASMJIT_NO_COMPILER
#include "../core/formatter.h"
#include "../core/ralocal_p.h"
#include "../core/rapass_p.h"
#include "../core/support.h"
#include "../core/type.h"
#include "../core/zonestack.h"
ASMJIT_BEGIN_NAMESPACE
// RABlock - Control Flow
// ======================
Err... | TOOL | 0.899092 | 6.441599 |
da63d893-ef79-4f9d-90ed-f60a5a40e088 | Nakxtra/6Companies30Days | Goldman Sachs[Day 1-5]/04_Run_Length_Encoding.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
string encode(string src);
int main() {
int T;
cin>>T;
while(T--)
{
string str;
cin>>str;
cout<<encode(str)<<endl;
}
return 0;
}// } Driver Code Ends
/*You are required to complete this function */
string encode(string src)
... | ALGO | 0.999948 | 6.291175 |
4dbb2078-2f59-4fd9-9d85-c61600adf792 | yzcmf/Interview | LeetCode-Solutions/C++/searchMatrix2.cpp | // Time Complexity: O(log(mn))
// Space Complexity: O(1)
class Solution {
public:
bool searchMatrix(vector<vector<int> > &matrix, int target) {
if(matrix.empty()) return false;
const size_t m = matrix.size();
const size_t n = matrix.front().size();
int star... | ALGO | 0.999924 | 6.164112 |
a0eee489-33b5-49ea-8731-daa41c04e23b | hblee12294/algorithm-prc | List/deduplicate.cpp | template <typename T>
int List<T>::deduplicate()
{
if (_size < 2)
return 0;
int oldSize = _size;
Posi(T) p = first();
Rank r = 1;
while (trailer != (p = p->succ))
{
Posi(T) q = find(p->data, r, p); // 代码重用,里面含循环了,外面一层循环就够了
q ? remove(q) : r++; // 找到-》删除; 未找到-》秩+1
}
return oldSize - _size; ... | ALGO | 0.999268 | 3.5832 |
0a12660a-2bf4-49fb-9a50-37719363003c | 192211284/CSA5151--Cryptography | 192211284-24 RSA system.cpp | #include <stdio.h>
// Function to calculate the greatest common divisor
int gcd(int a, int b) {
while (b != 0) {
int temp = b;
b = a % b;
a = temp;
}
return a;
}
// Extended Euclidean Algorithm to find the multiplicative inverse
int extended_gcd(int a, int b, int *x, int *y) {
... | ALGO | 0.999945 | 5.13828 |
27acafe1-2c2b-4f04-b96d-f49e582265ea | patilrohit1964/Dsa-With-C- | if_else_ladder/neg_pos_neu.cpp | #include <iostream>
using namespace std;
int main()
{
int num;
cout << "Enter a number: ";
cin >> num;
if (num > 0)
{
cout << num << " is a Positive number." << endl;
}
else if (num < 0)
{
cout << num << " is a Negative number." << endl;
}
else
{
co... | ALGO | 0.982681 | 4.008067 |
23f7edc0-034f-4619-84aa-e9f3f56cb1ce | samarjeet/cses | src/coinCombinationsII.cpp | #include<iostream>
#include<vector>
#include<algorithm>
typedef long long ll;
#define INF 1e7
int main(int argc, char** argv){
const int M = 1e9 + 7;
unsigned int n, x;
std::cin >> n >> x;
std::vector< int> c;
for (int i=1; i <= n; ++i){
int ci;
std::cin >> ci;
c.pu... | ALGO | 0.999974 | 4.72991 |
dd6b04b1-a568-434e-aeb1-8aab5f80ea53 | Nabisuke/Coding-Problems | Casual Problems/A_Boy_or_Girl.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string s;
cin>>s;
set<char> st;
for(int i=0;i<s.size();i++)
{
st.insert(s[i]);
}
if (st.size()%2==0)
{
cout<<"CHAT WITH HER!"<<"\n";
}
else
{
... | ALGO | 0.999256 | 3.825082 |
77d216f9-9230-4c8a-a414-0e8cb70c4033 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_4807_3.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n, num[maxn];
bool vis[maxn];
int main() {
ios::sync_with_stdio(0);
cin >> n;
for (int i = 0; i < n; ++i) {
cin >> num[i];
}
sort(num, num + n);
if (num[n - 1] >= num[n - 2] + num[n - 3]) {
cout << "NO\n";
return 0;
}
... | ALGO | 0.999992 | 3.455791 |
402a9e72-b642-4367-afe7-50f6cd954080 | siddharthkadu/LeetCode | 2232-adding-spaces-to-a-string/2232-adding-spaces-to-a-string.cpp | class Solution {
public:
string addSpaces(string s, vector<int>& spaces) {
string str;
str.reserve(s.size() + spaces.size()); // Reserve space for efficiency
int j = 0; // Pointer for the `spaces` vector
for (int i = 0; i < s.size(); i++) {
if (j < spaces.size() && i == ... | ALGO | 0.999652 | 6.987682 |
f9d50c07-2c08-4393-9e50-683dda9e3df6 | Aryan-747/YeetCode | 73-set-matrix-zeroes/set-matrix-zeroes.cpp | class Solution {
public:
void setZeroes(vector<vector<int>>& matrix) {
int n = matrix.size(); // number of rows
int m = matrix[0].size(); // number of columns
vector<bool> rowcheck(n,false); // track of rows
vector<bool> colcheck(m,false); // track of columns
for(int i=0 ... | ALGO | 0.999142 | 6.263148 |
f373ea6a-b7dd-450d-b98f-a60653c6d3cf | pneto29/sgd_icp | src/utils.cpp | #include <cmath>
#include <random>
#include <pcl/registration/registration.h>
#include "utils.h"
std::vector<double> get_translation_roll_pitch_yaw(
Eigen::Matrix4d const& transformation_matrix
)
{
double x = transformation_matrix(0, 3);
double y = transformation_matrix(1, 3);
double z =... | ALGO | 0.994804 | 5.738631 |
84b351a4-6f9e-4610-878d-7bcbafe15b70 | salotch/Data-Structure | queue/queue.cpp | #include <iostream>
using namespace std;
template<class t>
class array_queue{
int index;
int size;
int qsize;
t* front;
t* rare;
t* arr;
public:
array_queue():size(100), index(0), qsize(0)
{
arr = new t[size];
front = nullptr;
rare = nullptr;
}
array_queue... | TOOL | 0.948031 | 4.048503 |
15ce2cc7-aa51-4a28-aa4e-d4d6589b8a60 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_10174_14.cpp | #include <bits/stdc++.h>
using namespace std;
template <class T>
inline void chkmin(T &a, T b) {
if (a > b) a = b;
}
template <class T>
inline void chkmax(T &a, T b) {
if (a < b) a = b;
}
double dp[1100][1100];
inline void prepare() {
int i, j, s;
double a, b, c, d, p;
dp[0][0] = 1;
for (i = 0; i < 1100; i+... | ALGO | 0.999953 | 3.770039 |
22c2ee8c-54db-40c8-80f9-a57ccea9010b | AymanAkashi/Problem-set | cses/DP/Coin_Combinations_I.cpp | // #include <bits/stdc++.h>
#include <cstdint>
#include <iostream>
#include<vector>
using namespace std;
#define int long long
#define mod 1000000007
void solve()
{
int n,x ;cin>>n>>x;
vector<int> v(n);
for(int i = 0; i < n; i++)
cin >> v[i];
vector<int> dp(x + 1);
dp[0] = 1;
for (int i = 1; i <= x; i++){
f... | ALGO | 0.999992 | 4.92953 |
2eb6a763-a8c2-48e6-a9b9-5ec293ce57bb | 44alexsmith/UMKC | CS201L/Lab9/Vector/Partb/Lab9-Map.cpp | // Alexeo Smith
// 4/08/2014
// Lab 9
#include <fstream>
#include <iostream>
#include <string>
#include <map>
using namespace std;
//Create a map for the Words
map<string, int> myMap;
// Starting point
int main()
{
// File I/O
ifstream fin("input.txt");
ofstream fout("output.txt");
// Read in file
string word... | TOOL | 0.942578 | 4.589289 |
e551fe83-9a5a-497f-865a-d63445520e52 | maxscharwath-heig/PIN-2021-Projet-Final | src/utils/Validator.cpp | #include <iostream>
#include <algorithm>
#include "Validator.h"
bool Validator::itemsOverlapping(const std::vector<Object *>& objects)
{
for (const auto* a : objects) {
for (const auto* b : objects) {
if (a == b) continue;
if (areOverlapping((Object *) a, (Object *)b))
return tru... | TOOL | 0.916627 | 5.553068 |
fada6af1-e292-44ba-91c5-e8710c480b2c | yqliving/Practice | 225-Implement-Stack-using-Queues/solution.cpp | //only use single queue
class Stack {
queue<int> q;
public:
void push(int x) {
q.push(x);
for (int i=1; i<q.size(); i++) {
q.push(q.front());
q.pop();
}
}
void pop() {
q.pop();
}
int top() {
return q.front();
}
bool empty... | ALGO | 0.999431 | 4.733347 |
c94e1b07-0ac4-4663-b65d-48ca5095cef2 | efeslab/nvm-file-indexing | api/p-hot/boost_1_73_0/libs/circular_buffer/example/circular_buffer_sum_example.cpp | //[circular_buffer_sum_example_1
/*`This example shows several functions, including summing all valid values.
*/
#include <boost/circular_buffer.hpp>
#include <numeric>
#include <assert.h>
int main(int /*argc*/, char* /*argv*/[])
{
// Create a circular buffer of capacity 3.
boost::circular... | TEST | 0.912906 | 6.428323 |
89651697-4270-4ed5-a496-25b7e88636b3 | stakecube/stakecubecoin-archive | src/crypto/pkcs5_pbkdf2.cpp | #include "pkcs5_pbkdf2.h"
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "hmac_sha512.h"
#include "support/cleanse.h"
#include <memory>
int pkcs5_pbkdf2(const uint8_t* passphrase, size_t passphrase_length,
const uint8_t* salt, size_t salt_length, uint8_t* key, size_t key_... | ALGO | 0.994264 | 6.629952 |
def4f22e-7cbc-4927-b798-6b5f0bd84923 | davehorton/pcap_ripper | deps/boost_1_65_1/libs/math/example/find_mean_and_sd_normal.cpp | // find_mean_and_sd_normal.cpp
// Example of finding mean or sd for normal distribution.
// Note that this file contains Quickbook mark-up as well as code
// and comments, don't change any of the special comment mark-ups!
//[normal_std
/*`
First we need some includes to access the normal distribution,
the algorithms... | ALGO | 0.999917 | 5.794353 |
114fa4dd-eee1-4aae-ac57-a05fdcdd1b08 | AshharImam/Pedesterian-Counter | dlib-19.20/tools/imglab/src/cluster.cpp | #include "cluster.h"
#include <dlib/console_progress_indicator.h>
#include <dlib/image_io.h>
#include <dlib/data_io.h>
#include <dlib/image_transforms.h>
#include <dlib/misc_api.h>
#include <dlib/dir_nav.h>
#include <dlib/clustering.h>
#include <dlib/svm.h>
#include <dlib/statistics.h>
// ----------------------------... | ALGO | 0.976791 | 6.83602 |
a4579b75-65b0-43ff-9e73-33a84f3d1b87 | mu9enn/eyes_piper | catkin_ros/piper_ros/src/piper_moveit/moveit-1.1.11/moveit_core/trajectory_processing/src/ruckig_traj_smoothing.cpp | /* Author: Jack Center, Wyatt Rees, Andy Zelenak, Stephanie Eng */
#include <algorithm>
#include <cmath>
#include <Eigen/Geometry>
#include <limits>
#include <moveit/trajectory_processing/ruckig_traj_smoothing.h>
#include <vector>
namespace trajectory_processing
{
namespace
{
const std::string LOGNAME = "moveit_traje... | ALGO | 0.998949 | 7.470706 |
6ee0af70-25bf-4639-992e-95f93e208f65 | 192110481/DSA0150-C- | assignment3 5Q.cpp | #include<bits/stdc++.h>
using namespace std;
int main ()
{
int a = 15, b = 20;
printf("max = %d\n", ((a + b) + abs(a - b)) / 2);
printf("min = %d", ((a + b) - abs(a - b)) / 2);
return 0;
}
| ALGO | 0.998691 | 3.697234 |
fd988a65-f285-489c-b037-f741cc98e258 | ShashaankS/Codeforces-Repo | 1857A.cpp | using lli=long long int;
using ll= long long;
using ull=unsigned long long;
#define fori for(ll i=0; i<n; i++)
#define forj for(ll j=0; j<n; j++)
#define form for(ll i=0; i<m; i++)
#define fors for(ll i=0; i<s.length(); i++)
#define forv for(ll i=0; i<v.size(); i++)
#define forst for(auto i=st.begin(); i!=st.end(); i++... | ALGO | 0.999783 | 4.658017 |
0430c566-9a53-417a-8678-1e5f13c6b330 | haiguanplayer/ACM-ICPC | ZOJ/ZOJ-3956.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
const int MOD = 1e9+7;
const int N = 1005;
int h[N],c[N];
long long dp[50005];
int main()
{
int t,n;
cin>>t;
while(t--)
{
memset(dp,0,sizeof(dp));
scanf("%d",&n);
... | ALGO | 0.999913 | 3.276545 |
690f4e5d-ade0-4c08-bb8d-1b8a942352c1 | piyush1146115/Competitive-Programming | Light oj/1066 - Gathering Food.cpp | #include<bits/stdc++.h>
using namespace std;
#define mxx 13
#define mp make_pair
#define ff first
#define ss second
#define pii pair<int, int>
int fx[] = { 0, 1, -1, 0};
int fy[] = { 1, 0, 0, -1};
int n;
int cnt, c;
int vis[mxx][mxx], dis[mxx][mxx];
char ara[100];
string s[mxx];
int posx, posy;
bool valid(int x, in... | ALGO | 0.999665 | 3.989722 |
470da65b-bdd4-43b0-bed9-2bb2b5912585 | OmkarDSawant/CPP | Recursion/powerLinear.cpp | #include<iostream>
using namespace std;
int powerLin(int &x, int n){
if(n==0){
return 1;
}
return x * powerLin(x,n-1);
}
int main(){
int x,n;
cin>>x>>n;
cout<<powerLin(x,n);
return 0;
} | ALGO | 0.999991 | 4.885547 |
a3f81370-2698-4e5f-b625-e0f2c8fd0c52 | ishandutta2007/codeforces | waynetuinfor/normal/407/E.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int N, k, d;
cin >> N >> k >> d;
vector<int64_t> a(N);
for (int i = 0; i < N; ++i) {
cin >> a[i];
}
if (d == 0) {
pair<int, int> ans = {0, -1};
for (int i = 0, j = 0; i < N; i = j)... | ALGO | 0.999985 | 4.943513 |
ef73c9d5-2ae0-404f-9028-db8cf976ca9b | EricJeffrey/myleetcode | leetcode/22-10-29/d.cpp | #include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
... | ALGO | 0.999996 | 5.151699 |
38c32eb1-4224-438e-a44d-a0174dc2ed99 | rastabrandy02/Programming2 | Pointers/Basics.cpp | #include <iostream>
using namespace std;
#define ELEMENTS 3
void Function(int* num);
int SumAllElements(int* array, int size);
int main()
{
int vect[ELEMENTS] = { 1, 2, 3};
int* p = 0;
int value = 0;
p = vect;
cout << p << endl;
cout << *p << endl;
for (int i = 0; i < 3; i++)
{
cout << p[i] << endl;
}
... | ALGO | 0.996499 | 3.428596 |
a451b95f-2c33-4933-8a2f-affa7b815070 | FantomZong/git-course | Laba3/3,1/3,1/3,1.cpp |
#include <iostream>
#include"DSU.h"
using namespace std;
struct R
{
int v1, v2;
int weight;
};
void sort(R*, int);
void Kras();
int main()
{
Kras();
}
void Kras() {
cout << "Enter number of vertexes : ";
int vs;
cin >> vs;
cout << endl;
cout << "Enter number of ribs : ";
int... | ALGO | 0.999213 | 3.591314 |
0274c0a1-c5f8-4cec-ab3f-42ca2e56f863 | shivaapratim/DSA_Daily | 0985-sum-of-even-numbers-after-queries/0985-sum-of-even-numbers-after-queries.cpp | class Solution {
public:
vector<int> sumEvenAfterQueries(vector<int>& nums, vector<vector<int>>& queries) {
int sum=0;
for(int i=0; i<nums.size();i++){
if(nums[i]%2==0)sum+=nums[i];
}
vector<int>ans;
for(auto it: queries){
int a=it[0];
i... | ALGO | 0.999948 | 6.235197 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.