uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
bbee6e7f-feca-4cca-87d2-40472d285600 | sejalrai23/DSA-Practise | 1048-longest-string-chain/1048-longest-string-chain.cpp | class Solution {
public:
int longestStrChain(vector<string> &words) {
unordered_map<string, int> dp;
int res = 1;
sort(words.begin(), words.end(), [](const string &l, const string &r) { return l.size() < r.size(); });
for (string word : words) {
dp[word] = 1;
... | ALGO | 0.999968 | 5.751929 |
e65a4c47-29b1-40db-8e07-39ac56e1f2c8 | Rudrakshyadav1/CSES-PROBLEMSET | Introductory-Problems/permutations.cpp | #include<iostream>
using namespace std;
int main(){
long long n;
cin>>n;
if(n==2 ||n==3){
cout<< "NO SOLUTION";
}
else if(n==1){
cout<<1;
}
else if(n==4){
cout<<3<<" "<<1<<" "<<4<<" "<<2;
}
else{
long long odd=1;
long long even=2;
... | ALGO | 0.999991 | 3.661901 |
5dc32d08-3e89-4559-a70c-2d541b0b23cc | Priyanshu-Batham/competitive_programming | CodeForcesContests/Div2/Round931/A_Too_Min_Too_Max.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
//code here
int n;
cin>>n;
vector<int> arr(n);
for(int i = 0; i<n; i++) cin>>arr[i];
sort(arr.begin(), arr.end());
int i = 0, j = n-1, k = 1, l = ... | ALGO | 0.999725 | 4.817901 |
5649cf30-595a-4d51-9bc8-3e729b563711 | KSP-07/LeetCode-Questions | Move Last Element to Front of a Linked List - GFG/move-last-element-to-front-of-a-linked-list.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
class ListNode{
public:
int val;
ListNode *next;
ListNode(int x){
val=x;
next=NULL;
}
};
// } Driver Code Ends
//User function Template for C++
class Solution{
public:
ListNode *moveTo... | ALGO | 0.999896 | 5.95324 |
2366da8d-2555-4f67-83a3-a4f191a7e23f | maruf-hossain74/Codeforces_problem_Solve | Rating_1000-1100/Maximum Sum.cpp | #include <bits/stdc++.h>
using namespace std;
#define int int64_t
int32_t main() {
// your code goes here
int t; cin>> t; while(t--) {
int n, k; cin>> n>> k;
int A[n],sum[n];
for(int i = 0; i < n; i++) cin>> A[i];
sort(A, A+n);
for(int i = 0; i < n; i++) {
if(i =... | ALGO | 0.999906 | 4.491186 |
9f3b1301-28bc-457f-a118-0c5353f11420 | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/july/missingApoint_20200703173441.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.999646 | 3.269342 |
45474318-f8b7-4ed5-aba3-4ca11a075aa8 | yzzupgo/MFTCG | Data/abc127_a/vikasgc09/ac/16619552.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
long long x,y;
cin >> x >> y;
if(x < 6){
cout << 0;
}else if(x < 13){
cout << y/2;
}else{
cout << y;
}
}
| ALGO | 0.999647 | 3.174243 |
e2977315-fdeb-4e4a-a091-b93455afaacc | kaushalvivek/programming-practice | Lib.cpp | //Vivek Kaushal
//Library
#include <iostream>
using namespace std;
int main () {
int daya,montha,yeara,daye,monthe,yeare;
cin >> daya >> montha >> yeara >> daye >> monthe >> yeare;
if (yeara < yeare) cout << 0;
else if (yeara != yeare)
cout << 10000;
else if (montha < monthe) cout << 0;
... | ALGO | 0.998775 | 3.704626 |
02a5bdee-5cfa-40e6-8d5e-e46b6802bbf4 | ishandutta2007/codeforces | pavel.savchenkov/normal/712/E.cpp | #include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <utility>
#include <cstdlib>
#include <memory>
#include <queue>
#include <cassert>
#include <cmath>
#include <ctime>
#include <complex>
#include <bitset>
#include <fst... | ALGO | 0.999755 | 3.904672 |
0c03dd25-bab5-4e51-a857-83835c615a9f | nodchip/icfpc2021 | libs/boost_1_76_0/libs/graph/example/implicit_graph.cpp | #include <boost/concept/assert.hpp>
#include <boost/graph/adjacency_iterator.hpp>
#include <boost/graph/dijkstra_shortest_paths.hpp>
#include <boost/graph/graph_concepts.hpp>
#include <boost/graph/properties.hpp>
#include <boost/iterator/counting_iterator.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <boo... | ALGO | 0.999697 | 5.483081 |
b3211a3d-2f4f-4233-9991-6bba951a8fd3 | danyalmendigali/programming_scientific_codes | sorting_scientific_codes/quick_sort.cpp | #include <iostream>
using namespace std;
/// Функция для разбиения массива на подмассивы
int partition(int arr[], int low, int high) {
int pivot = arr[high]; /// Выбираем последний элемент в качестве опорного элемента
int i = low - 1; /// Инициализируем индекс меньшего элемента
for (int j = low; j < high;... | ALGO | 0.999951 | 5.927903 |
855ce44c-d5f7-4656-853d-dbf865e8189e | falcon1614/DSA-Learning | STL/MultiSet.cpp | #include<bits/stdc++.h>
using namespace std;
// This code demonstrates the use of multiset in C++
// Contain multiple Elements
// Elements are stored in sorted order
// Duplicate elements are allowed
// Elements are stored in sorted order
int main(){
multiset<int> ms;
ms.insert(1);
ms.insert(2);
ms.insert(3);
... | TOOL | 0.912861 | 4.824348 |
9d064d15-6f6e-419a-83cd-e294d019c77a | raincross7/code-similarity | codes/train_code/problem240/problem240_490.cpp | /**
* author : UshanGhosh
* created : 2020-09-20 15:01:00
**/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int,int>
#define vii vector<int>
#define vcc vector<char>
#define pll pair<long long, long long>
#define mem memset
#define ... | ALGO | 0.999988 | 4.006348 |
51f84f38-5758-487f-b04a-9f0e7b93a8fd | pramesh-kumar/DS-and-Algorithm | Array/array_searching.cpp | #include<bits/stdc++.h>
using namespace std;
int Linearsearch(int a[],int key,int n){
for(int i=0;i<n;i++){
if(a[i]==key){
return i;
}
}
return -1;
}
int binarysearchkey(int a[],int key,int n){
int s=0;
int e=n-1;
while(s<=e){
int ... | ALGO | 0.999974 | 5.396483 |
05c9b6fa-8712-48d7-9268-f405e546e6b7 | ishandutta2007/codeforces | i_love_tigersugar/normal/407/C.cpp | //This solution is based on rng_58's solution
#include<bits/stdc++.h>
#define MAX 100100
#define MAXK 111
#define FOR(i,a,b) for (int i=(a);i<=(b);i=i+1)
#define FORD(i,b,a) for (int i=(b);i>=(a);i=i-1)
#define REP(i,n) for (int i=0;i<(n);i=i+1)
const int mod=(int)1e9+7;
int f[MAX][MAXK];
int a[MAX];
int inv[MAXK];... | ALGO | 0.999955 | 3.97912 |
dc3e2ecd-bf5d-47f4-8731-fe29a7bb4730 | Deus1704/1337C0D3_6r1ND | 312-burst-balloons/312. Burst Balloons.cpp | class Solution {
public:
int rec(int i, int j, vector<int>&a, vector<vector<int>>&dp ){
// base case;
if (i>j) return 0;
if (dp[i][j]!=-1) return dp[i][j];
int max_cost = INT_MIN;
for (int index=i; index<=j; index++){
int cost = a[i-1]*a[index]*a[j+1] + rec(i,inde... | ALGO | 0.999991 | 5.016148 |
c84e1f1a-70d2-44a1-9278-9319336f00a0 | Shadat-tonmoy/ACM-Problem-Solution | UVa/895.cpp | #include<bits/stdc++.h>
using namespace std;
int main ()
{
int i,j,k,l,m=0,n,match;
string dictionary[10000],puzzle;
while(cin>>dictionary[m])
{
match = 0;
while(1)
{
if(dictionary[m][0]=='#')
break;
cin>>dictionary[++m];
}
... | ALGO | 0.994562 | 3.496439 |
b8877ed5-9a9c-4580-99c8-007ec4091b42 | Shravani512/Data_Structures_and_Algorithms | Arrays/insertionSort.cpp |
// inserrt element in sorted part of array
void insertionSort(int arr[], int n)
{
int key,j;
for(int i=1;i<n;i++)
{
key=arr[i];
j=i-1;
// Move elements of arr[0..i-1],
// that are greater than key,
// to one position ahead of their
// current position
while(arr[j]>key &... | ALGO | 0.999973 | 3.753803 |
08bce07d-012a-4782-9f63-e9c130de5eaf | raincross7/code-similarity | codes/train_code/problem312/problem312_283.cpp | #include<bits/stdc++.h>
using namespace std;
const int mod=1e9+7;
void add(int& a,int b)
{
a=(a+b)%mod;
}
int main()
{
int N,M; cin>>N>>M;
vector<int> a(N),b(M);
for(int i=0;i<N;i++) cin>>a[i];
for(int i=0;i<M;i++) cin>>b[i];
vector<vector<int>> dp(N+1,vector<int>(M+1));
for(int j=0;j<=M;j++) d... | ALGO | 0.999997 | 3.952104 |
1fadf2f3-ba63-4d4c-9a36-c871c4e72513 | schardong/Splines | src/BSplineSurface.cpp | /**
* File: BSplineSurface.cpp
* Author: Guilherme Gonalves Schardong
* Implemantation of the BSpline surface.
* File created on 08 August 2011, 18:27
*/
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <GL/glfw.h>
#include <GL/gl.h>
#include "BSplineSurface.h"
BSplineSurface::BSplineSurface(i... | TOOL | 0.88367 | 4.922072 |
029a87d8-45f1-4eea-8b10-024279eb7b8a | aaronkarp123/visuals | opencv-2.4.13/samples/cpp/stereo_match.cpp | #include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/contrib/contrib.hpp"
#include <stdio.h>
using namespace cv;
static void print_help()
{
printf("\nDemo stereo matching converting L and R images into disparity and point clouds\n"... | ALGO | 0.976555 | 4.59545 |
8d8c5db0-afb8-4a67-aa59-99c5b673b896 | autowarefoundation/autoware_universe | planning/autoware_path_smoother/src/elastic_band.cpp | #include "autoware/path_smoother/elastic_band.hpp"
#include "autoware/motion_utils/trajectory/conversion.hpp"
#include "autoware/motion_utils/trajectory/trajectory.hpp"
#include "autoware/path_smoother/type_alias.hpp"
#include "autoware/path_smoother/utils/geometry_utils.hpp"
#include "autoware/path_smoother/utils/tra... | ALGO | 0.999747 | 6.855956 |
bcb8af6a-884d-47ef-ac88-c05e56e86c94 | manyanxinghecanyi/miniob | src/observer/sql/optimizer/predicate_merge_rewriter.cpp | #include "sql/optimizer/predicate_merge_rewriter.h"
#include "sql/operator/logical_operator.h"
#include "sql/operator/predicate_logical_operator.h"
#include "sql/expr/expression.h"
RC PredicateMergeRewriter::rewrite(std::unique_ptr<LogicalOperator> &oper, bool &change_made)
{
RC rc = RC::SUCCESS;
if (oper->type() ... | ALGO | 0.998942 | 5.58638 |
9d8d1a78-91ff-43a0-93ee-2daf13425e77 | intfloat/AlgoSolutions | hackerrank/HourRank2/D.cpp | #include <bits/stdc++.h>
#define FOR(i, n) for (int i = 0; i < (int)n; ++i)
using namespace std;
typedef unsigned long long ll;
typedef pair<int, int> pii;
const int MAX_N = 1000005;
const int r = 29;
// MOD needs to be large to avoid collision...
const ll MOD = 1000000000000009ll;
vector<vector<int> > fac(MAX_N);
vect... | ALGO | 0.999881 | 4.143849 |
49d3de9b-b82d-4f26-a37f-935f67caf001 | zhangwang1377/CppPrimerPlus-six-src | chapter_07/19_arfupt.cpp | // arfupt.cpp -- an array of function pointers
#include <iostream>
// various notations, same signatures
const double * f1(const double ar[], int n);
const double * f2(const double [], int);
const double * f3(const double *, int);
int main()
{
using namespace std;
double av[3] = {1112.3, 1542.6, 2227.9};
... | TOOL | 0.946706 | 5.719766 |
38e0efe1-82e4-4622-8f22-7a509d9fc4f6 | namkazt/cocos2dx-lite | cocos/base/ccUTF8.cpp | #include "base/ccUTF8.h"
#include "platform/CCCommon.h"
#include "base/CCConsole.h"
#include "ConvertUTF.h"
NS_CC_BEGIN
namespace StringUtils {
std::string format(const char* format, ...)
{
#define CC_MAX_STRING_LENGTH (1024*100)
std::string ret;
va_list ap;
va_start(ap, format);
char*... | TOOL | 0.942511 | 6.183704 |
68e6ff9d-ff51-415b-ad27-af772db60af6 | SomeFeaKOS/android_frameworks_av | media/libstagefright/codecs/amrnb/dec/src/pstfilt.cpp | /*----------------------------------------------------------------------------
; INCLUDES
----------------------------------------------------------------------------*/
#include <string.h>
#include "pstfilt.h"
#include "typedef.h"
#include "mode.h"
#include "basicop_malloc.h"
#include "basic_op.h"
#include "weight_a.h... | ALGO | 0.992426 | 4.795448 |
1084c979-97ba-44b6-b16c-354c4454396c | osmanhassan/DataStructureandAlgorithm | selection_sort.cpp | #include<iostream>
using namespace std;
void main(){
int arr[10]; int n = 0,n1;
while (n != 10){
cin >> arr[n];
n++;
}
n1 = 10;
for (int i = 0; i < n1-1; i++){
cout << "phase : " << i+1 << endl;
for (int j = i; j < n1-1; j++){
if (arr[i]>arr[j + 1]){
int s = arr[i];
arr[i] = arr[j + 1];
arr[... | ALGO | 0.99984 | 3.231291 |
0c6bbb95-d770-4e75-a777-97883774e610 | goodchai0/Problems | 542-01-matrix/542-01-matrix.cpp | class Solution {
public:
vector<vector<int>> updateMatrix(vector<vector<int>>& mat) {
queue<pair<int,int>>q;
vector<vector<int>>ans(mat.size(),vector<int>(mat[0].size(),-1));
for(int i=0;i<mat.size();i++)
{
for(int j=0;j<mat[0].size();j++)
{
... | ALGO | 0.999963 | 6.257607 |
1b0ce129-391b-4acf-b01a-88a5e85e84e7 | k4rtsen/AaSoD | Sort/QuickSort.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#define forn(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
int Partition(vector<int> &values, int l, int r)
{
int x = values[r];
int less = l;
for (int i = l; i < r; ++i)
{
if (values[i] <= x)
... | ALGO | 0.999588 | 4.969459 |
60eb36c2-ae52-43a0-9cf3-ec700d3d7c6a | Hesh0629/solved_boj_problems_in_army | boj/1328.cpp | // dp[n][l][r]로 놓고 구하기...?
// 빌딩을 내림차순으로 정렬 dp[1][1][1] = 1
// dp[i=2][1~i][1~i]를 차례대로 구해서 dp[n][l][r]을 구하면 되긴 하는데....
// dp[i][l][r] = dp[i-1][l][r-1]+dp[i-1][l-1][r]+(현재 숫자를 숨기는 경우의 수)
// 숨길 숫자를 미리 선정하는게 나을까 <- 헛소리, (현재 숫자를 숨기는 경우의 수) = (i-2)*dp[i-1][l][r] 이다. 앞서 나온 숫자들이 자신보다 크니까 놓을 수 있는 위치는 i-2임
#include <iostream>
... | ALGO | 0.999951 | 3.914914 |
4c30a99d-e225-4e78-b5ec-3d6fba13ba06 | ishandutta2007/codeforces | dreamoon_love_aa/normal/869/A.cpp | #include <bits/stdc++.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y... | ALGO | 0.999395 | 3.694512 |
c64d1b22-dac1-4acb-aac3-5a0c85e2dfb3 | amjadkhanniazi/cpp_practice | functionsPassArrayInParam.cpp | #include <iostream>
using namespace std;
void printarray(int arr[],int size);
int main(){
int x[5]={1,2,3,4,5};
printarray(x,5);
return 0;
}
void printarray(int arr[],int size){
for(int i=0;i<size;i++){
cout<<arr[i]<<" ";
}
} | TOOL | 0.870683 | 4.225526 |
584010ef-98e6-411c-a322-21da2dc00515 | sandialabs/opendiventi | src/ServersideCli.cpp | /*
* Main server code that processes cli and options
* then starts a server ingesting data and answering
* questions.
*
* example cli invocation:
* ServersideCli -debugLvl 2 --d /database/ -w
*
*/
#include "diventi.h"
#include "ServersideCli.h"
#include "TokuHandler.h"
#include "Control.h"
#inc... | WEB | 0.956148 | 3.885802 |
c037a4b2-e770-41ed-9177-6babed4abad5 | vagisha04/Leetcode | 0207-course-schedule/0207-course-schedule.cpp | class Solution {
public:
bool canFinish(int numCourses, vector<vector<int>>& prerequisites) {
int V = prerequisites.size();
vector<vector<int>> adj(numCourses);
vector<int> count(numCourses,0);
for(auto it: prerequisites)
{
adj[it[1]].push_back(it[0]);
... | ALGO | 0.999723 | 6.271693 |
0dfe687a-a845-412a-83f9-2d995f1539b6 | squaresLab/BatFix | results/transcoder/translations/py/PRINT_EQUAL_SUM_SETS_ARRAY_PARTITION_PROBLEM_SET_2.cpp | void printEqualSumSets ( int arr [ ] , int n ) {
int sum_array = sum ( arr ) ;
if ( ( sum_array & 1 ) != 0 ) {
cout << "-1" << endl ;
return ;
}
int k = sum_array >> 1 ;
bool dp [ n + 1 ] [ k + 1 ] ;
for ( int i = 1 ;
i <= k ;
i ++ ) dp [ 0 ] [ i ] = false ;
for ( int i = 0 ;
i < n + 1 ;
i... | ALGO | 0.999799 | 3.945273 |
a0de5a86-4cc3-46fa-983b-1c06a7971c95 | Akshat-07-ux/GfG-Questions | Difficulty: Basic/Size of Binary Tree/size-of-binary-tree.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *left;
struct Node *right;
Node(int val) {
data = val;
left = right = NULL;
}
};
// Function to Build Tree
Node* buildTree(string str)
{
// Corner Case
if(str.length() =... | ALGO | 0.999412 | 7.203996 |
596acd9c-044a-4b99-87c0-4dcca5c8407f | brinzaalina/Homeworks-and-others | First Year/Semester 2/Object Oriented Programming/Exam/Written/Exercise 18 Message/main.cpp | #include <string>
#include <iostream>
#include <vector>
class Message {
private:
std::string text;
public:
Message() = default;
explicit Message(std::string& text): text{text} {}
virtual std::string getMessage() {
return this->text;
}
~Message() = default;
};
class ShortMessage: public... | TOOL | 0.906506 | 4.915392 |
01c5e349-4e15-475b-9458-ad54149592c3 | Xacor/Cpp-Labs | Lab5.1/Matrix.cpp | #include "Matrix.h"
Matrix::Matrix()
{
columns = 0;
rows = 0;
elements = nullptr;
}
Matrix::Matrix(size_t rows, size_t columns)
{
this->rows = rows;
this->columns = columns;
elements = new double[rows * columns]{ 0 };
}
Matrix::Matrix(size_t rows, size_t columns, const double* arr)
{
this->rows = rows;
this... | TOOL | 0.979384 | 3.457484 |
90a8cfe9-83d7-48d1-9b25-dd63e643c1d9 | Soumyaworks/Competitive-Programming | codeforces_1099C.cpp | //Author : Soumya Banerjee
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("Ofast")
#define ll long long int
#define pb push_back
#define mp make_pair
#define ld long double
#define fi first
#define se second
#define mod 1000000007
#define fill(a... | ALGO | 0.999972 | 3.419675 |
86d05a3e-e108-4b64-83db-4e60fa72ee1e | Fneger/BSD_MDVR_UGD | boost_1_77_0/libs/graph/example/topo-sort-with-leda.cpp | int main()
{
using namespace boost;
typedef GRAPH< std::string, char > graph_t;
graph_t leda_g;
typedef graph_traits< graph_t >::vertex_descriptor vertex_t;
std::vector< vertex_t > vert(7);
vert[0] = add_vertex(std::string("pick up kids from school"), leda_g);
vert[1] = add_vertex(std::strin... | ALGO | 0.998728 | 4.450026 |
4ffb6dfd-ddf2-4dd3-b410-7c7b0d41367d | muaadh-hasan/FCAI_CairoUniversity_Assignments-Year1Term2_Year2Term1 | Assignment-operator-overloading-Cairo-University-/main.cpp | #include <iostream>
#include <cassert>
#include <cmath>
// Course: CS213 - Programming II - 2018
// Title: Assignment I - Task 1 - Problem 1
// Author: Dr. Mohammad El-Ramly
// by : Muaath Hasan ID:20170411
using namespace std;
struct matrix
{
int* data;
int row, col;
};
void createMatrix (int row, int... | ALGO | 0.954622 | 3.621926 |
6a18f04f-0199-440e-9b51-e0d8e6bb6de2 | yashkandpal98/CPP | Year-1/Prime.cpp | #include <iostream>
using namespace std;
int main()
{
int m,n,flag;
cout<<"Enter starting value: ";
cin>>m;cout<<endl;
cout<<"Enter ending value: ";
cin>>n;cout<<endl;
flag=0;
while (m<n)
{
for(int i=2;i<m;i++)
{
if (m%i==0)
{
flag=1;
break;
}
else
flag=0;
}
if (flag==0)
{
c... | ALGO | 0.99961 | 3.47436 |
9a47dbac-46a1-4e39-8b28-8af0b74e6540 | hasibulxd/flutter_application_1 | 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.998799 | 6.776823 |
0ef84e92-accd-4e85-bba4-001cdf00b047 | DeepRoboticsLab/Lite3_MotionSDK | lib/eigen3/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_colwise.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::MatrixXf mat(2,4);
mat << 1, 2, 6, 9,
3, 1, 7, 2;
std::cout << "Column's maximum: " << std::endl
<< mat.colwise().maxCoeff() << std::endl;
}
| ALGO | 0.999667 | 3.779679 |
e9331b44-fc16-4417-80bc-cbce8e1ac7c2 | guilhermeafonsoch/cpp-files | Lista-de-exercicios-1/ex6.cpp | // Nome: Guilherme Afonso
// TIA: 32030657
#include <iostream>
using namespace std;
int main (){
int fatorial, num;
cout << "Digite o numeor para ver seu fatorial: ";
cin >> num;
for(fatorial = 1; num > 1; num -= 1){
fatorial *= num;
}
cout << "O fatorial calculado = " << fatorial... | ALGO | 0.999574 | 4.187119 |
cabb5db2-551f-4ee5-9927-f9d21d161c5c | Adil-Anzarul/cpp-pc | pattern prining/pattern12.cpp | /*
1
2 1 2
3 2 1 2 3
4 3 2 1 2 3 4
5 4 3 2 1 2 3 4 5
*/
#include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=n-i;j++)
{
cout<<" ";
}
int k=i;
for(int j=1;j<=i;j++)
{
cout<<k<<" ";
k--;
}
... | ALGO | 0.999983 | 3.752935 |
c49dcdaa-306f-475d-a965-9f3ffb6e428b | P101909/LeetCode | 242-valid-anagram/valid-anagram.cpp | class Solution {
public:
bool isAnagram(string s, string t) {
//if they are not the same size, just return false
if (s.length() != t.length())
return false;
sort(s.begin(), s.end());
sort(t.begin(), t.end());
int s1 = s.length();
for (int i = 0; i<s1; i++)... | ALGO | 0.999985 | 6.268162 |
c298bdb3-2c9b-4edd-837a-e1ddc45ab8aa | lucasmarcao/C_e_CPP | ESTRUTURA DE DADOS 1 - 2024/lista06_listaEncadeada_a2134616/EXS_EM_C_PURO/ex03/main.cpp | /*
descrição:
*/
#include <iostream>
#include <cstdio>
#include "linkedlist.h"
// g++ main.cpp linkedlist.h linkedlist.cpp -o exercicio.exe
using namespace std;
int main()
{
LinkedList *llist = new LinkedList;
for (int i = 0; i < 10; i++)
{
llist->push_front(i * 2);
llist->print();
... | ALGO | 0.929211 | 3.589521 |
21ead6e6-4fb6-4931-961c-0dcbb898fd75 | PranjaliDeshmukh01/OpenCV | samples/cpp/tutorial_code/snippets/imgproc_HoughLinesPointSet.cpp | #include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
using namespace cv;
using namespace std;
int main()
{
Mat lines;
vector<Vec3d> line3d;
vector<Point2f> point;
const static float Points[20][2] = {
{ 0.0f, 369.0f }, { 10.0f, 364.0f }, { 20.0f, 358.0f }, { 30.0f, 352.0f },
{ 40.0f,... | ALGO | 0.992336 | 3.570138 |
8c76f917-f1cb-45e7-8961-c126bf98cd68 | freaky0112/Homework | 计算机程序设计(C++)西安交通大学/Week5/5-4编写函数去除字符串中包含的非字母字符(不包括空格),并将小写字母转换成大写字母.cpp | #include <iostream>
#include "string.h"
using namespace std;
char upper(char chr){
if (chr>='a'&&chr<='z')
{
chr=chr+'A'-'a';
}else if ((chr>='A'&&chr<='Z')||chr==' ')
{
chr=chr;
}else{
chr=0;
}
return chr;
}
char* getResult(char list[]){
int length=strlen(list);
int j=0;
char* result=new char[length]... | ALGO | 0.999668 | 3.825582 |
5dce50d0-5847-4a05-a469-e59ff49384d4 | luobuyu/Code-test-daily | ICPC/2019沈阳/l.cpp | #include <bits/stdc++.h>
#define ll long long
#define lll long long
namespace FAST_IO
{
inline char nextChar()
{
static char buf[1000000], *p1 = buf, *p2 = buf;
return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2) ? EOF : *p1++;
}
#define getch getchar
template... | ALGO | 0.999514 | 3.728279 |
5ce4cd35-581e-4ece-a439-3ae4acbed077 | marcelohpf/tep-solutions | uri/1018.cpp | #include <iostream>
using namespace std;
int proc(int value, int remain) {
int count = remain / value;
cout << count << " nota(s) de R$ " << value << ",00" << endl;
return remain%value;
}
int main() {
int value;
cin >> value;
cout << value << endl;
value = proc(100, value);
value = proc(50, value... | ALGO | 0.997572 | 4.555881 |
b17a9082-ebc7-4fb9-b738-76394ec72d19 | hafizcode02/coding-cpp-kuliah | Reply Challenges/TW1 - I1V.cpp | #include <iostream>
#include <vector>
using namespace std;
void doCalculate(vector<vector<int> > friendCase)
{
vector<int> results;
for(int i = 0; i < friendCase.size(); i++)
{
int total = 0;
for(int j = 0; j < friendCase.at(i).size(); j++)
{
total += (friendCase.at(i).at(j) > 0) ? friendCase.at(i).at(j... | ALGO | 0.999419 | 4.708591 |
2d0548fc-77f2-4408-8b5f-89f942721ebd | DetegiCE/baekjoon-ps | 1000s/1240.cpp | #include<bits/stdc++.h>
using namespace std;
int n, m;
int dist[1001][1001];
int main()
{
cin.tie(0)->sync_with_stdio(0);
cin >> n >> m;
for(int i=1 ; i<=n ; i++) {
for(int j=1 ; j<=n ; j++) {
dist[i][j] = 1e9;
if(i == j) dist[i][i] = 0;
}
}
for(int i=0... | ALGO | 0.999988 | 4.754458 |
cfc68f7e-27a7-4ab2-b3c0-b6a3f57dfc78 | hiteshnagar2611/DSA_rough_work | queue/implementaion_using_array.cpp | #include <iostream>
#include <vector>
using namespace std;
class Queue{
int size=1000;
int* arr;
int front;
int rear;
public:
Queue(){
arr = new int[size];
front = 0;
rear = 0;
}
void enqueue(int x){
if(rear... | ALGO | 0.968231 | 4.45698 |
b7fbe921-76a1-4ac3-9035-a51c29d11ae7 | sos0911/Pinball_simulation_project | Box2D_Example/include/Box2D/Collision/Shapes/b2EdgeShape.cpp | #include "Box2D/Collision/Shapes/b2EdgeShape.h"
#include <new>
void b2EdgeShape::Set(const b2Vec2& v1, const b2Vec2& v2)
{
m_vertex1 = v1;
m_vertex2 = v2;
m_hasVertex0 = false;
m_hasVertex3 = false;
}
b2Shape* b2EdgeShape::Clone(b2BlockAllocator* allocator) const
{
void* mem = allocator->Allocate(sizeof(b2EdgeSh... | ALGO | 0.979616 | 7.651464 |
b7a27c0d-f7d5-458f-ade5-72783ac87286 | Andwerpz/Competitive-Programming-Practice | - cpp -/mexmaster.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<bool> vb;
typedef vector<ld> vd;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvl;
typedef vecto... | ALGO | 0.999957 | 4.947359 |
a4e81be7-86e2-42fd-bba6-78f7f2e5410e | RhonalG24/TecSuperior-Sistemas-UTN | TecSuperior Sistemas/1er Cuatrimestre/Programacion/Vectores/GV-2.cpp | /*
2. Ingresar un valor entero N (< 30) y a continuación un conjunto de N elementos. Si el último
elemento del conjunto tiene un valor menor que 10 imprimir los negativos y en caso contrario los
demás.
strategy
pedir N
mientras N > 29
alerta
pedir N
FinMientras
pedir valores del vector
si vector[N] < 10
f... | ALGO | 0.986438 | 3.001654 |
0532269c-a371-4a8c-8f41-8449ce2c3780 | GauravKumain2111/Cpp-DSA | Learn LinkedList [Single LL, Double LL, Medium, Hard Problems]/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.999827 | 5.577079 |
94406ab3-798a-4e17-8b0a-98d846ba0544 | Ausp3x/competitive-programming | [2] Personal Training/AtCoder Rounds/[5] ABC 254/D. Together Square.cpp | // 人外有人,天外有天
// author: Ausp3x
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
typedef long long lng;
typedef unsigned int uint;
typedef unsigned long long ulng;
using namespace std;
using namespace __gnu_pbds;
// #define TROUBLESHOOT
void solve() {
int n;
cin >> n;
... | ALGO | 0.99995 | 4.632196 |
7ae39651-d45f-48f5-8360-7de55820b95e | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_3036_6.cpp | #include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
const int INF = 1000000001;
int n, m, pa[101], sz[101];
vector<pii> adj[101];
int dist[1 << 17][71], vis[1 << 17][21];
struct MM {
map<int, int> vton, ntov;
void add(int cur) {
vton[cur] = ((int)(vton).size()) - 1;
ntov[((int)(ntov).s... | ALGO | 0.999863 | 4.136323 |
5ee55c5b-40ea-4e3e-934a-3beab401d3e1 | Hemant7239/LeetCode | Two Repeated Elements - GFG/two-repeated-elements.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:
//Function to find two repeated elements.
vector<int> twoRepeated (int arr[], int N) {
vector<int>ans;
unordered_map... | ALGO | 0.999688 | 5.196341 |
1ff3184d-03e1-410c-871d-b27eeff0610b | RHJihan/problem-solving | HackerRank/angry-professor.cpp | // https://www.hackerrank.com/challenges/angry-professor/problem
#include <bits/stdc++.h>
using namespace std;
int main() {
int q, total, threshold;
cin >> q;
while (q--) {
int count = 0;
cin >> total >> threshold;
int temp;
for (int j = 0; j < total; j++) {
cin >> temp;
if (temp <... | ALGO | 0.999474 | 4.747581 |
d3a58c42-0171-4690-bf16-fa6d10f3e3ab | LaiAnTan/Advent-Of-Code-2024 | day16/day16_part2.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <algorithm>
#include <climits>
#include <unistd.h>
#include <termios.h>
typedef std::pair<int, int> Coordinate;
typedef std::pair<int, int> Direction;
template <typename S>
std::ostream &operator<<(std::os... | ALGO | 0.999691 | 5.682528 |
b6b44657-424b-4f87-a5f0-2ef26709897a | mieafans/LeetCode_miea | src/ReverseInteger.cpp | // Author : miea
// Date : 2014-10-26
/**********************************************************************************
*
* Reverse digits of an integer.
*
*Example1: x = 123, return 321
*Example2: x = -123, return -321
*
*
*************************************************************************... | ALGO | 0.999457 | 4.963555 |
7521a681-1753-4f2d-82c8-f59cf7d4b06b | richard880502/Leetcode | 0028-find-the-index-of-the-first-occurrence-in-a-string/0028-find-the-index-of-the-first-occurrence-in-a-string.cpp | class Solution {
public:
int strStr(string haystack, string needle) {
int head=0,tail = needle.size()-1,pos = -1;
string str = haystack.substr(0,tail+1);
while(tail<haystack.size())
{
if (str == needle)
{
pos = head;
br... | ALGO | 0.999934 | 5.850326 |
9573714e-75a7-40a9-ad67-b29de3271ced | 8l/barrelfish | lib/cxx/cxx/hash.cpp | #include "__hash_table"
#include "algorithm"
#include "stdexcept"
#include "type_traits"
#ifdef __clang__
#pragma clang diagnostic ignored "-Wtautological-constant-out-of-range-compare"
#endif
_LIBCPP_BEGIN_NAMESPACE_STD
namespace {
// handle all next_prime(i) for i in [1, 210), special case 0
const unsigned small_... | ALGO | 0.998744 | 6.660625 |
c019d42c-769c-467c-b603-44510d355bec | Lucas-Roseno/TimSort | src/TimSort.cpp | #include "TimSort.h"
#include "Timestamp.h"
#include <algorithm>
#include <vector>
template<typename T>
void TimSort<T>::insertionSort(IDataStructure<T>* arr, int left, int right) {
for (int i = left + 1; i <= right; i++) {
T temp = arr->get(i);
int j = i - 1;
while (j >= left && arr->get(j... | ALGO | 0.99422 | 4.881725 |
18baa093-2005-444c-ab7a-8cfef5646a04 | gerardobeltranmx/OSI-Club-Programacion-Bachillerato-2022 | 01 Introducción al Lenguaje C++/J. Alumnos calificación.cpp | #include <iostream>
using namespace std;
int main()
{
int examen, asistencia, tareas, calificacion;
cin >> examen;
cin >> asistencia;
cin >> tareas;
calificacion = examen * 0.60 + asistencia * 0.20 + tareas * 0.20;
cout << calificacion;
return 0;
} | ALGO | 0.991563 | 3.447721 |
36aa868f-c98b-4586-97b8-1ae738ad3ae4 | matheus3301/neps-academy-exercises | EXERCÍCIOS/maior3.cpp | #include <iostream>
using namespace std;
int main(){
long long g[3][3];
long long maior = INT64_MIN;
for(int i = 0; i < 3; i++)
for(int j = 0; j < 3; j++){
cin >> g[i][j];
if(g[i][j] > maior){
maior = g[i][j];
}
}
for(int i = 0; i < 3; i++){
... | ALGO | 0.999911 | 3.490531 |
f7f0931f-914c-456c-8e36-08eccbee5f28 | ninad-moree/DataStructuresAlgorithms | Hashtable/2780-MinimumIndexOfValidSplit.cpp | /*
An element x of an integer array arr of length m is dominant if freq(x) * 2 > m, where freq(x) is the number of occurrences of x in arr.
Note that this definition implies that arr can have at most one dominant element.
You are given a 0-indexed integer array nums of length n with one dominant element.
... | ALGO | 0.999995 | 5.931544 |
49c8817a-3be4-42f0-89a3-15ada959e77c | mahfuz66412/Varendra_University_CSE | 02 Second Semester/CSE 1202/Lab reports/Lab Report 01 11.7.2024/04 even or odd check.cpp | #include <iostream>
using namespace std;
int main() {
int num;
cout << "Enter an Integer Number : ";
cin >> num;
if(num%2==0) {
cout << endl << num << " is a Even Number " << endl;
} else {
cout << endl << num << " is a Odd Number " << endl;
}
return 0;
}
| ALGO | 0.996081 | 3.885391 |
bdf94cfe-0fe4-4a6b-8f13-7db9efa51b2e | GloriousEggroll/lsteamclient | cppISteamNetworkingUtils_SteamNetworkingUtils001.cpp | #include "steam_defs.h"
#pragma push_macro("__cdecl")
#undef __cdecl
#include "steamworks_sdk_144/steam_api.h"
#include "steamworks_sdk_144/steamnetworkingtypes.h"
#include "steamworks_sdk_144/isteamnetworkingutils.h"
#pragma pop_macro("__cdecl")
#include "steamclient_private.h"
#ifdef __cplusplus
extern "C" {
#endif
#... | TOOL | 0.907839 | 5.29177 |
a2cf5093-a7ab-4dc3-ba75-26998872d3a9 | afshawnlotfi/gmsh | contrib/eigen/doc/examples/class_Block.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
template<typename Derived>
Eigen::Block<Derived>
topLeftCorner(MatrixBase<Derived>& m, int rows, int cols)
{
return Eigen::Block<Derived>(m.derived(), 0, 0, rows, cols);
}
template<typename Derived>
const Eigen::Block<const Derive... | TOOL | 0.893441 | 5.901438 |
cbbe57c2-69ae-4a31-8089-71d1afef31cd | cvirxsc/VSLAM | VINS-Fusion-ROS2/global_fusion/ThirdParty/GeographicLib/src/LocalCartesian.cpp | #include "LocalCartesian.hpp"
namespace GeographicLib {
using namespace std;
void LocalCartesian::Reset(real lat0, real lon0, real h0) {
_lat0 = Math::LatFix(lat0);
_lon0 = Math::AngNormalize(lon0);
_h0 = h0;
_earth.Forward(_lat0, _lon0, _h0, _x0, _y0, _z0);
real sphi, cphi, slam, clam;
M... | ALGO | 0.933501 | 6.563031 |
ae8c36cb-2093-4a5c-aafb-3637cb07cb55 | xyzyzl/compprog | probs/usaco/mroute/mroute.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // pbds
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
#pragma GCC optimize("O3")
using namespace __gnu_pbds;
using namespace std;
#define MAXN 505
#define FOR(i, n) for (int i = 0; i < n; i++)
#define FORR(j, ... | ALGO | 0.999847 | 5.124795 |
48c2fc46-9e72-46b1-8974-c5ed467748e6 | zyadhany/RoadToIcpc | Up_Solve/IEEEXtereme/PSU Camp 2024/PSU Xtreme-18 Contest #2/G. Boring Day.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <unordered_map>
#define ll long long
#define ld long double
#define pl pair<ll, ll>
#define vi vector<ll>
#define vii vector<vi>
#define vc vector<char>
#define vcc vector<vc>
#define vp vector<pl>
#define mi map<ll,ll>
#define mc map<char,ll>
#define s... | ALGO | 0.99997 | 3.845086 |
b603644d-5fb2-4150-b297-ecb63a83994c | pranavajith/CP-Practice | CP (Until Creation of Repo)/Second100/1607C.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <set>
#include <cmath>
#include <map>
#include <sstream>
using namespace std;
#define ll long long
// #define TxtIO freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); freopen("error.txt", "w", stderr);
void solve(){
ll n;
cin>>n;
vector... | ALGO | 0.999692 | 4.144181 |
f136f6ba-4fc0-46dd-a04e-a7fc995a5cf2 | DinhThanh-20021582/BTVN-Lab-1 | week 1/Ex 30.cpp | //B30
#include<iostream>
using namespace std;
int main()
{
int n;
cout<<"Nhap n: ";
cin >> n;
for(int i = n; i >=1; i--)
{
for(int k = 1; k <= i; k++)
{
cout << "*";
}
cout <<"\n";
}
}
| ALGO | 0.99991 | 3.705838 |
c84d77c7-e699-4d51-9aa7-26d2e46bdf72 | upesacm/100DaysOfCode-2024 | DSA/Arshdeep-Kaur/Day 80/Day80_Question2.cpp | class Solution {
public:
int maxi = 0;
void rec(TreeNode* root, int dir, int len) {
if (root == NULL) {
return;
}
maxi = max(maxi, len);
if (dir == 0) {
rec(root->left, dir, 1);
rec(root->right, dir^1, len+1);
}
else {
... | ALGO | 0.999951 | 5.912547 |
301cd051-9d4b-4a7f-88c0-415c00ab1a41 | 183aryan/LeetCode-Solutions | 535-encode-and-decode-tinyurl/535-encode-and-decode-tinyurl.cpp | class Solution {
public:
// Encodes a URL to a shortened URL.
string encode(string longUrl) {
return longUrl;
}
// Decodes a shortened URL to its original URL.
string decode(string shortUrl) {
return shortUrl;
}
};
// Your Solution object will be instantiated and called as suc... | ALGO | 0.993438 | 5.882707 |
64ec4934-057e-420d-8f23-f858b271cf9d | jai-dalmotra/Leet-Code | #50-Pow(x,n).cpp | class Solution {
public:
double solve(double x, long n) {
if(n==0){
return 1;
}
if(n<0){
return solve(1/x,-n);
}
if(n%2==0){
return solve(x*x,n/2);
}
return x*solve(x*x,(n-1)/2);
}
double myPow(double x,... | ALGO | 0.999959 | 5.455655 |
8d58e922-95ea-4071-9316-1d31550b7e83 | mikeserato/courses-galadhrim | Box2D/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp | #include <Box2D/Dynamics/Joints/b2RevoluteJoint.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2TimeStep.h>
// Point-to-point constraint
// C = p2 - p1
// 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 * (-r... | ALGO | 0.988618 | 7.730262 |
247827df-02a7-4592-a272-45dc1f4b81eb | sinian666/codes_41_19 | cpp_副本11/chapter_backtracking/permutations_ii.cpp | /**
* File: permutations_ii.cpp
* Created Time: 2023-04-24
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 回溯算法:全排列 II */
void backtrack(vector<int> &state, const vector<int> &choices, vector<bool> &selected, vector<vector<int>> &res) {
// 当状态长度等于元素数量时,记录解
if (state.size() == choices.size... | ALGO | 0.999922 | 5.680894 |
1424266f-8b81-4511-b94c-a1fec911e780 | TI-1050/code | HDU-Multi-University/2019/day5/b.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define N 200010
#define pii pair <int, int>
#define fi first
#define se second
int n, a[N], b[N], res[N];
unordered_map <int, int> mp;
struct Trie {
struct node {
int son[2];
int tot;
node() {
memset(son, -1, sizeof son);
tot = 0;
}
... | ALGO | 0.999993 | 3.502931 |
99d09c05-fdd5-46a0-9742-a6d1d8d8c6b2 | sleeping1943/xzm-gb28181 | 3rd/boost_1_83_0/libs/graph/example/print-out-edges.cpp | using namespace boost;
template < typename Graph, typename VertexNamePropertyMap >
void read_graph_file(std::istream& graph_in, std::istream& name_in, Graph& g,
VertexNamePropertyMap name_map)
{
typedef typename graph_traits< Graph >::vertices_size_type size_type;
size_type n_vertices;
typename graph_t... | ALGO | 0.908289 | 6.109727 |
5b29faec-757b-4654-b5bb-66f5c4a63de4 | ayushid549/Leetcode | 125-valid-palindrome/valid-palindrome.cpp | class Solution
{
public:
bool valid(char ch)
{
if((ch>='A' && ch<='Z') || (ch>='a' && ch<='z') || (ch>='0' && ch<='9'))
return true;
return false;
}
char toLower(char ch)
{
if((ch>='a' && ch<='z') || (ch>='0' && ch<='9'))
return ch;
else... | ALGO | 0.999909 | 6.059589 |
61b5b183-b6e9-4c70-a58d-ad9d9e18d38c | bhavyeah20/leetcode | practice/Dynamic Programming/triangle.cpp | class Solution {
public:
int minimumTotal(vector<vector<int>>& grid) {
int m = grid.size(), n = grid.size();
vector<vector<int>> dp(m, vector<int> (n,0));
for(int j = n-1; j >= 0; j--){
dp[m-1][j] = grid[m-1][j];
}
for(int i = m-2; i >= 0; i--){
... | ALGO | 0.999994 | 6.061907 |
ef814367-7a58-46d4-a4ca-0aa0977138c5 | BouyguesCoin/bouygues-core-old | src/crypto/rfc6979_hmac_sha256.cpp | #include "crypto/rfc6979_hmac_sha256.h"
#include <string.h>
#include <algorithm>
static const unsigned char zero[1] = {0x00};
static const unsigned char one[1] = {0x01};
RFC6979_HMAC_SHA256::RFC6979_HMAC_SHA256(const unsigned char* key, size_t keylen, const unsigned char* msg, size_t msglen) : retry(false)
{
me... | ALGO | 0.935186 | 6.572958 |
dc5e15c4-54b2-4681-b304-9985c9916962 | Krish203018/cpp | algorithm/greedy algorithm/kruskal.cpp | #include <bits/stdc++.h>
using namespace std;
// weighted edge in graph
class Edge {
public:
int src, dest, weight;
};
// undirected and weighted graph
class Graph {
public:
int V, E;
// graph is undirected, the from src to dest is also edge from dest to src
Edge* edge;
};
// Creates a graph with V vertices and E... | ALGO | 0.999983 | 5.209466 |
1af3799f-3307-4486-b41b-948f1a5454e7 | jldinh/vplants | tree_matching/src/cpp/MSLocalMatching.cpp | #include "MSMatching.h"
#include <iostream>
#include <cstdio>
#include <cmath>
//--------------------------------------------------------------------------------
// Calcul du cot local d'insertion d'un noeud
//------------------------------------------------------------------------
int MSMatching::insLocalNode(TreeGra... | ALGO | 0.999416 | 3.901102 |
98f480bc-39a8-48f6-8091-6a1ccf1bcd1f | mazino3/mikanos | apps/sort/sort.cpp | #include <cstdio>
#include <string>
#include <vector>
int main(int argc, char** argv) {
FILE* fp = stdin;
if (argc >= 2) {
fp = fopen(argv[1], "r");
if (fp == nullptr) {
fprintf(stderr, "failed to open '%s'\n", argv[1]);
return 1;
}
}
std::vector<std::string> lines;
char line[1024];
... | TOOL | 0.982091 | 4.966938 |
39abcf50-65cc-4525-abb5-a4c0f434c722 | ibex-team/ibex-lib | src/cell/ibex_CellBeamSearch.cpp | #include "ibex_CellBeamSearch.h"
using namespace std;
namespace ibex {
constexpr unsigned int CellBeamSearch::default_beamsize;
CellBeamSearch::CellBeamSearch(CellHeap& currentbuffer, CellHeap& futurebuffer, const ExtendedSystem & sys, unsigned int beamsize) : CellHeap (sys), beamsize(beamsize), currentbuffer(curre... | ALGO | 0.999382 | 5.728548 |
2bffbb2f-5b1b-4abf-8cfd-cee4a723ad0d | alifele/C-and-CPP | CPSC 221/unionFind.cpp | // Online C++ compiler to run C++ program online
#include <iostream>
#include <vector>
#include <stack>
using namespace std;
class UnionFind {
public:
UnionFind(int size): _size(size) {
_data.resize(_size);
_rank.resize(_size);
_sizeList.resize(_size);
int i=0;
fo... | ALGO | 0.999837 | 4.822331 |
cc0baf28-3643-44ec-bf50-5a37e86ec038 | rizwanrockzz/rizwan | C++ by Rizwan/linkedlist/l5.cpp | #include <bits/stdc++.h>
using namespace std;
// INTRODUCTION TO DOUBLY LINKED LIST
class node
{
public:
int data;
node *next;
node *prev;
// we are creating a constructor because we cannot send directly send values to
node(int val)
{
data = val;
next = NULL;
prev = NULL... | ALGO | 0.999834 | 4.369692 |
304125e4-a72c-4963-9d3c-64334cdefd31 | Rithui/DSA_code | lab 1/221b300_lab1_q7.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int arr[] = { 1, 45, 54, 71, 76, 12 };
int n = sizeof(arr) / sizeof(arr[0]);
cout << "Array: ";
for (int i = 0; i < n; i++)
cout << arr[i] << " ";
sort(arr, arr + n, greater<int>());
cout << "\nDescending Sorted Array:\n";
... | ALGO | 0.999839 | 4.641034 |
87549be8-e9e3-40a3-99ec-6f50cddbf8ce | afrl-rq/OpenUxAS-SoI | src/DPSS/Dpss.cpp | #include "Dpss.h"
using namespace std;
Dpss::Dpss()
{
// set reasonable default values for system parameters
m_RendezvousDistance = 1000; // meters
m_ReverseManeuverDistance = 100; // meters
m_NearWpThreshold = 100; // meters
m_LostCommWaypointNumber = 255;
m_LostCommRedirectNumber ... | TOOL | 0.978674 | 4.426501 |
145f3c43-cb85-493a-9cc8-da259514a912 | praduman7081/Coding_Question_Cpp | CodeChef/Mask_Policy.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int n, a;
cin >> n >> a;
cout << min(n - a, a) << endl;
}
return 0;
} | ALGO | 0.999418 | 3.552449 |
56494481-8fd9-435f-8684-d50b341f8a9c | swara213/dsa | Strivers/step1/lec2/p8.cpp | #include<iostream>
using namespace std ;
int main()
{
int i = 0 , j = 9 ;
while((i <= 4 ) && (j >= 1))
{
for(int k = 1 ; k <= i ; k++)
{
cout<<" " ;
}
for(int l = 1 ; l <= j ; l++)
{
cout<<"*" ;
}
j = j - 2 ;
... | ALGO | 0.999664 | 3.258104 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.