uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
6634031d-da56-4669-be68-1d8992218450 | rahul-aggarwal000005/Data-Structures-and-Algorithms | Day-17/Check if the Binary tree is height-balanced or not.cpp | /**
* Definition for a binary tree node.
* 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 *right) : val(x), l... | ALGO | 0.999971 | 6.422513 |
4eb3f8d2-a5f4-438d-8fc7-106535e81c42 | Thyme0113/astnn_with_semi-supervised_learning | ssl_750/data/src/fibonacci/loop24.cpp | int main(){
int a[55];
a[0]=a[1]=1;
for(int i=0 ; i < 50 ; ++i ) {
a[i+2]=a[i+1]+a[i];
}
int n;cin>>n;
cout<<a[n]<<endl;
return 0;
}
| ALGO | 0.99997 | 3.644579 |
94f97b9f-7ebd-4c98-b6de-39425889d179 | Prakashkayastha/CPP-DSA | output/output/duplicatelinkedlistsorted.cpp | #include<iostream>
using namespace std;
class node
{
public:
int data;
node *next;
node(int data)
{
this->data=data;
this->next=NULL;
}
};
void removeduplicates(node* &head)
{
node *ptr1,*ptr2,*dup;
ptr1=head;
/* Pick elements one by one */
while(ptr1!=NULL&&pt... | ALGO | 0.999917 | 5.027404 |
0f50618b-5c5b-4eb8-9a2d-5b35baae5a5a | edge555/Online-Judge-Solves | LeetCode/1952. Three Divisors.cpp | class Solution {
public:
bool isThree(int n) {
int i,j,cnt=0;
for(i=1;i*i<=n;i++)
{
if(n%i==0)
{
cnt++;
j=n/i;
if(i!=j)
cnt++;
}
}
return cnt==3;
}
};
| ALGO | 0.999912 | 5.223684 |
5b83876a-9013-475e-b842-195586a675ea | weslanders/Laboratory-work-OOP | Project1/Source.cpp | #include <iostream>
using namespace std;
void main()
{
setlocale(LC_ALL, "Rus");
int sizeA = 5;
int sizeB = 4;
int* A = new int[sizeA];
int* B = new int[sizeB];
int sumA = 0;
int sumB = 0;
for (int i = 0; i < sizeA; i++)
{
A[i] = rand() % 20;
}
for (int i = 0; i < sizeB; i++)
{
B[i] = rand() % 10... | ALGO | 0.996008 | 3.08691 |
e54e68fb-e6da-45de-87aa-531255047b5b | Anish-Dhondi-ML/C-Training | SNORT/Jindat/2_find_an_element.cpp | // Session 2
// 16-02-2023
// Write program to find a element that you can take from keyboard in a array.
#include <iostream>
int main(){
int arr[10], var, i, num;
std::cout << "Enter Number of Elements in an Array" << std::endl;
std::cin >> var;
std::cout << "Enter " << var << " numbers... | ALGO | 0.996901 | 4.858808 |
5fe4700c-4326-4db4-b2a6-79363d0f39e2 | yzzupgo/MFTCG | Data/abc170_b/pshubh99/wa/14373030.cpp | #include<bits/stdc++.h>
using namespace std;
#define V vector
typedef long long ll;
typedef unsigned long long ull;
typedef V<int> vi;
typedef V<ll> vll;
typedef V<string> vs;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define f(i,a) for(int i = 0 ; i < a ; i++)
#define fll(i,a) for(ll i = 1 ; i <= a ;i++)
#... | ALGO | 0.999868 | 3.797732 |
0ee2a115-2a80-4e9e-b754-335404673e6d | Prakash251299/Leetcode | Problems/2696MinimumStringLengthAfterRemovingSubstrings.cpp | class Solution {
public:
void display(vector<char>v){
for(auto x:v){
cout<<x<<" ";
}
cout<<"\n";
return;
}
int minLength(string s) {
vector<char>v;
for(int i=0;i<s.size();i++){
if(v.size()>0){
if((s[i]=='B' && v[v.size()... | ALGO | 0.998684 | 5.716111 |
ad39ffb2-44ef-402f-ad37-208d0431fa41 | SurgicalSteel/Competitive-Programming | Hackerrank/Minimum Absolute Difference in an Array.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long ull;
#define psb push_back
#define mkp make_pair
#define all(x) (x).begin(),(x).end()
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007
int toInt(string x)
{
istringstream ss(x);
int a;
ss>>... | ALGO | 0.999772 | 3.99781 |
9095dd94-da31-405a-ac4f-aa819819c391 | pi0ne/programming-contest-solutions | atcoder/agc043_a.cpp | #include <bits/stdc++.h>
using namespace std;
// #define int long long
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define ir... | ALGO | 0.999811 | 4.507469 |
80128eb0-c0df-42e4-b09a-0d3e11897a93 | amitkumar0902/The_Quiet_Revolution | Chef_goes_Left_Right_Left.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
ll n,r,c2,c=1,ma,mi,i,t;
cin>>t;
while(t--)
{
c=1;
cin>>n>>r;
ma=10000000000;mi=0;
if(n==1&&c2==r) cout<<"YES"<<"\n";
else{
for(i=... | ALGO | 0.99994 | 3.608419 |
2e057bd8-d261-4900-bebf-b304e73ef136 | LiunxPaisley/LeetCode | 134. Gas Station/134. Gas Station/134. Gas Station.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <array>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <queue>
#include <list>
#include <deque>
#include <tuple>
#include <algorithm>
#include <utility>
#in... | ALGO | 0.999955 | 5.44896 |
d45550de-2d40-41c4-8fc6-e31f79293741 | Akhilesh29/leetcode-problems | 0034-find-first-and-last-position-of-element-in-sorted-array/0034-find-first-and-last-position-of-element-in-sorted-array.cpp | class Solution {
public:
vector<int> searchRange(vector<int>& arr, int key) {
vector<int> result;
int ans =-1;
int s= 0;
int e = arr.size()-1;
int mid = s + (e-s)/2;
while (s<=e)
{
if(arr[mid] == key){
ans = mid;
e = mid -1;
}
else if(arr[mid] < key)... | ALGO | 0.999983 | 6.087761 |
39adbff6-6705-4969-bca5-c1babd42b734 | PrannoyNamala/Implementing-DFS-in-a-Micro-Mouse-Simulator | Final-Project-Group7/Algorithm/algorithm.cpp | /** \file algorithm.cpp
* FP -Group#7
*/
#include "algorithm.h"
#include <stack>
#include <iostream>
#include <vector>
#include <algorithm>
#include "../API/api.h"
#include "../Maze/maze.h"
#include "../LandBasedRobot/landbasedrobot.h"
#include "../LandBasedTracked/landbasedtracked.h"
namespace fp {
void Algori... | ALGO | 0.999985 | 5.162015 |
39187ae0-5c11-4680-af7c-0f7cc3cd5123 | shaobozhong/myAcmCodes | 暑假的比赛/5/青蛙的约会.cpp | #include<iostream>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
__int64 mm,nn,xx,yy,l;
__int64 c,d,x,y;
__int64 modd(__int64 a, __int64 b)
{
if(a>=0)
return a%b;
else
return a%b+b;
}
__int64 exGcd(__int64 a, __int64 b)
{__int64 r,t;
if(b==0)
{
x=1;
y=0;
return a;
}
r... | ALGO | 0.99975 | 3.023538 |
959627cf-0362-419c-85dc-910fa4b5f975 | PableteProgramming/FileCompressor | HuffmanCompression/src/MapSorter.cpp | #include "MapSorter.h"
MapSorter::MapSorter(vector<pair<string,int>> _m){
m=_m;
}
void MapSorter::Sort(bool o){
for(int i=0; i<m.size();i++){
for(int j=i+1; j<m.size();j++){
if(m[i].second< m[j].second && o){
pair<string,int> temp= m[i];
m[i]=m[j];
... | ALGO | 0.993417 | 4.352695 |
298fdfdf-fcbd-4060-a95e-cb99e1298b9d | shay-ff/cpp-files | Codeforces/Live/944/A_MEX_Destruction.cpp | #include<bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#ifndef ONLINE_JUDGE
#include "../debug.cpp"
#else
#define debug(...)
#define debugArr(...)
#endif
#define int long long
#define all(v) (v).begin(),(v).end()
#define a... | ALGO | 0.999985 | 5.337109 |
f1accdfb-8bd1-4744-b31f-6fec197b5e70 | jimm9Tran/DSA | Codeforces/158A.cpp | #include <iostream>
#include <vector>
#include <string>
#include <iomanip>
#include <algorithm>
using namespace std;
using ll = long long;
void solve(){
}
int main()
{
int n,x;
cin >> n >> x;
int a[n];
for (int &x : a) cin >> x;
int dem = 0;
for (int i = 0; i < n; i++){
if (a[i]... | ALGO | 0.999961 | 4.160308 |
9b1d6600-f0b8-494f-ad17-e54f2405234f | MdAbuNafeeIbnaZahid/Competitive-Programming | Light OJ/Graph/BFS or DFS/1046 - Rider 2 .cpp | #include <bits/stdc++.h>
using namespace std;
#define SIZE 12
#define intMax 99999999
class coOrd
{
public:
int row, column, k;
coOrd(int row, int column, int k)
{
this->row = row;
this->column = column;
this->k = k;
}
coOrd(){}
};
int dist[105][SIZE][SIZE], t, i, j, k, ... | ALGO | 0.999801 | 3.986427 |
a6b84cb5-3bfd-42dc-87ab-65ecc5927526 | Brunololos/cgs-intrinsic-simplification | deps/libigl/tests/include/igl/delaunay_triangulation.cpp | #ifdef IGL_STATIC_LIBRARY
#undef IGL_STATIC_LIBRARY
#endif
#include <test_common.h>
#include <igl/delaunay_triangulation.h>
namespace git_issue {
constexpr static double EPSILON_LENGTH = 0.0005; // Sketchup support 1/1000 precision
constexpr static double EPSILON_ANGLE = 0.0000000000005;
constexpr static double INV_... | TEST | 0.958809 | 6.189669 |
50efb4bf-5fec-4fa4-9f0a-da150894cb19 | timothybaker/wrestling_season_simulation | src/wrestler.cpp | // Timothy Baker
// cs361
// Assg1: Wrastlin' Simulator
//
// wrestler.cpp
#include "wrestler.h"
#include <iomanip>
#include <iostream>
/////// create random number generator and agents
///////
//
//
default_random_engine random_eng(time(NULL));
normal_distribution<double> real_dist_weight(155,45)... | TOOL | 0.941015 | 3.951172 |
efe58bc3-ea4b-42a4-8c61-45af7da52cbf | flyngPig/APM_simulink | ardupilot/libraries/AP_Math/polygon.cpp | /// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
#include "AP_Math.h"
/*
* The point in polygon algorithm is based on:
* http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
*/
/*
* Polygon_outside(): test for a point in a polygon
* Input: P = a point,
* ... | ALGO | 0.999803 | 7.668428 |
db93c9d7-b117-4eb5-a1fe-c0a435013b45 | shreejitverma/SDE-Interview-Prep | competitive-programming/DSA/linkedLists/linkedlist.cpp | #include <iostream>
using namespace std;
struct ListNode
{
int data;
struct ListNode *next;
};
int ListLength(struct ListNode *head)
{
struct ListNode *current = head;
int count = 0;
while (current != NULL)
{
count++;
current = current->next;
}
return count;
}
void Inse... | ALGO | 0.997978 | 3.89736 |
e66a0b7a-ca56-4831-b255-f37bc2ad62da | sizhuo-zhang/boost_1_62_0 | libs/geometry/doc/src/examples/strategies/buffer_distance_asymmetric.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// QuickBook Example
//[buffer_distance_asymmetric
//` Shows how the distance_asymmetric strategy can be used as a DistanceStrategy to create asymmetric buffers
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometr... | TOOL | 0.887384 | 7.01005 |
8ac5131e-a192-4c8b-9ecc-594f1b7f1719 | Clixxzydev/FN-UnrealBuildver4.26 | Engine/Source/Programs/UnrealLightmass/Private/Lighting/PrecomputedVisibility.cpp | #include "CoreMinimal.h"
#include "LightingSystem.h"
#include "MonteCarlo.h"
#include "Raster.h"
#include "HAL/PlatformTime.h"
namespace Lightmass
{
struct FVisibilitySamplePos
{
/**
* Min and max world space heights of a single sample on a triangle.
* This is necessary because supersampling is used during ras... | ALGO | 0.96114 | 6.925513 |
f7bd9f17-95d7-40b5-b01c-ab54ff3df831 | oliw/motion | Core/l1model.cpp | #include "l1model.h"
#include "video.h"
#include <fstream>
#include <coin/CoinModel.hpp>
#include <coin/CoinPackedMatrix.hpp>
#include <coin/CoinPackedVector.hpp>
#include <coin/ClpDualRowSteepest.hpp>
#include <coin/ClpPrimalColumnSteepest.hpp>
#include <coin/ClpPresolve.hpp>
#include <QDebug>
L1Model::L1Model(int do... | ALGO | 0.998469 | 4.955707 |
82e678be-afe3-4e98-b678-8e1f065a4caf | hemanth-sai31/DSA0152-OPPS- | Matrix Addition with class.cpp | #include <iostream>
using namespace std;
class MA {
public:
int m, n, i, j, a[100][100], b[100][100], sum[100][100];
void sumofmatrix(int r, int c) {
cout <<"Matrix 1 = " << endl;
for (i = 0; i < r; i++) {
for (j = 0; j < c; j++) {
cin >> a[i][j];
}
... | ALGO | 0.997693 | 3.682278 |
90a1a942-a3a8-4acc-944e-924b5502de28 | luqmanarifin/cp | Code Class Compfest/poligon.cpp | #include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
int main() {
int t;
scanf("%d", &t);
while (t--) {
int n, k;
scanf("%d%d", &n, &k);
n *= k;
printf("%.15lf\n", (double)n*tan(PI/n));
}
return 0;
} | ALGO | 0.999602 | 3.544552 |
f78decc1-53f7-4ada-8855-1abfde12275f | beezaleel/Artillery | Artillery/dev/include/FreeImage/LibRawLite/internal/wf_filtering.cpp | #define P1 imgdata.idata
#define S imgdata.sizes
#define O imgdata.params
#define C imgdata.color
#define T imgdata.thumbnail
#define IO libraw_internal_data.internal_output_params
#define ID libraw_internal_data.internal_data
int LibRaw::wf_remove_banding()
{
#define WF_IMGMODE_BAYER4PLANE 4
#define WF_IMGMODE_BAYER1... | TOOL | 0.939432 | 3.415218 |
166ec4ff-414c-41e4-b708-d1d55b1d5932 | ssashish21/Data-Structure-Algorithms | level1/02.Patterns/pattern11.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
int n;
cin >> n;
int c = 1;
for(int i = 1 ; i <= n ; i++){
for(int j = 1; j <= i ; j++){
cout << c++ <<" ";
}
// cout << ls << " " << rs << endl;
cout << endl;
}
}
| ALGO | 0.999912 | 3.304713 |
fd014c97-d987-46e3-8fca-a740b35bbf2b | MAHMOUD128/leetCode_Solutions | Hash_table/202. Happy Number.cpp | class Solution {
public:
bool isHappy(int n)
{
map<int,bool>m;
while(n !=1)
{
auto it = m.find(n);
if(it != m.end())
return false;
m[n] = true;
int sum =0;
while(n>0)
{
sum +=(pow(n%1... | ALGO | 0.999927 | 5.81566 |
32a68683-cd88-4ea9-a191-6e59f05b305e | char-1ee/leetcode | elementary/658-find-k-closest-elements.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
// Sort with comparator
vector<int> findClosestElements(vector<int>& arr, int k, int x) {
if (arr.size() == 1 || arr.size() == k) return arr;
auto comp = [&](const int& a, const int& b) {
return abs(a - ... | ALGO | 0.999996 | 5.680399 |
36edcf73-ce20-475a-a2e6-850d5dfbb46a | vfolunin/archives-solutions | Kattis/owlandfox.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;
void solve() {
string n;
cin >> n;
int i = n.size() - 1;
while (n[i] == '0')
i--;
n[i]--;
cout << stoi(n) << "\n";
}
int main() {
freopen("input.txt", "... | ALGO | 0.999938 | 4.71226 |
22bcaf69-3ace-41af-a844-7d3b3f41c80d | miaomiaocoder/CodePractice | acwing/AcWing884.cpp | #include <algorithm>
#include <iostream>
using namespace std;
const int N = 110;
int n;
int a[N][N];
int gauss() {
int c, r;
for (c = 0, r = 0; c < n; c++) {
int t = r;
for (int i = r; i < n; i++)
if (a[i][c]) t = i;
if (!a[t][c]) continue;
for (int j = 0; j <= ... | ALGO | 0.999994 | 4.290802 |
9838d839-9504-4b46-b4d8-f23194cd5b59 | toshirokubota/MovingDots | src/szlocalextrema.cpp | #include <szParticle.h>
/*
*/
template<class Item>
void
LocalMaximum(vector<unsigned char>& M,
const vector<Item>& V,
const vector<unsigned char>& L, //ROI mask
const vector<int>& nbh,
bool strict,
int ndim,
const int* dims)
{
int nvoxels = numberOfElements(ndim,dims);
if(M.size()<nvoxels... | ALGO | 0.999767 | 5.097602 |
aef2f242-d472-4f44-b006-69db6d61ecbe | AdvTrainEvalSrcDomain/adv-train-evaluation-source-code-domain | code-imitator/data/dataset_2017/dataset_2017_8/Gromah/8294486_5681755159789568_Gromah.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
typedef long double LD;
#define N 100 + 5
int Case, n, q, V[N], E[N], S[N], Map[N][N], End[N], Sum[N];
LD ans, Dp[N][N];
int main()
{
scanf("%d", &Case);
for (int T = 1; T <= Case; T ++)
{
scanf("%d%d", &n, &q);
for (int i = 1; i <= n; i ++) V[i] = En... | ALGO | 0.999714 | 3.5356 |
6b95619e-6aa5-45f2-a619-edfc6bda0e80 | gedorinku/llvm-65816 | libcxx/test/std/containers/sequences/vector/vector.cons/exceptions.pass.cpp | // UNSUPPORTED: no-exceptions
// (bug report: https://llvm.org/PR58392)
// Check that vector constructors don't leak memory when an operation inside the constructor throws an exception
#include <cstddef>
#include <memory>
#include <type_traits>
#include <vector>
#include "count_new.h"
#include "test_iterators.h"
te... | TEST | 0.950894 | 6.52209 |
b2ed598d-02d8-4c11-b848-a0dc208b8bdc | wlsdn0317/Unity | MAIN/Library/PackageCache/com.unity.ide.visualstudio@2.0.11/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call made to Visual Studio can fail after ... | TOOL | 0.956608 | 6.947423 |
b261eb1a-1100-4a92-af4e-ee7dc86627d6 | HHHHao-s/algorithm | 354.俄罗斯套娃信封问题.cpp | #include "s.h"
/*
* @lc app=leetcode.cn id=354 lang=cpp
*
* [354] 俄罗斯套娃信封问题
*/
// @lc code=start
class Solution {
public:
int maxEnvelopes(vector<vector<int>>& envelopes) {
sort(envelopes.begin(), envelopes.end(), [](const vector<int> &v1, const vector<int> &v2){
return v1[0] < v2[0] || (v... | ALGO | 0.999987 | 5.925365 |
a4c21b74-6386-4452-abdc-f3c95b4a59e3 | raincross7/code-similarity | codes/train_code/problem116/problem116_394.cpp | #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<tuple>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<deque>
#include<cmath>
#include<stack>
#include<string.h>
#include <iomanip>
#define rep(i,n) for(int i = 0;i<n;i++)
#define _GLIBCXX_DEBUG
using ll = long long; ... | ALGO | 0.999948 | 3.626435 |
375f7ef8-87a4-41aa-bd49-95c0d4d4c36b | Alan-Gonzalez1008/Funciones | Introducción/Factorial.cpp | #include <iostream>
using namespace std;
int Factorial (int A);
int main ()
{
int N1;
cout<<"Introduzca el valor del numero: ";
cin>>N1;
int fac =Factorial (N1);
cout<<"El factorial es: "<<fac;
return 0;
}
int Factorial (int A)
{
int i;
int Resultado = 1;
for (i = 1; i <= A; i++)
{
Resultado *=i;
}
re... | ALGO | 0.999357 | 3.548207 |
50823f2a-ef13-45e0-89d1-e520056031a3 | raincross7/code-similarity | codes/train_code/problem411/problem411_67.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int A,B,C,D,E=0,F=0;
cin >> A >> B >> C >> D;
E = min(A,B);
F = min(C,D);
cout << E+F << endl;
return 0;
//ツイッターフォローよろしく!
} | ALGO | 0.999775 | 3.438633 |
5fa5a844-4239-445f-a6dd-d7191da39f28 | marcrobm/eigen3 | doc/examples/Tutorial_ArrayClass_addition.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
ArrayXXf a(3,3);
ArrayXXf b(3,3);
a << 1,2,3,
4,5,6,
7,8,9;
b << 1,2,3,
1,2,3,
1,2,3;
// Adding two arrays
cout << "a + b = " << endl << a + b << endl << endl;
// Subt... | ALGO | 0.981184 | 3.642258 |
0701475a-4461-4101-a452-accc4c5a74ac | ishandutta2007/codeforces | tinsane/normal/687/B.cpp | #pragma region Template
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <queue>
#include <vector>
#include <map>
#include <cmath>
#include <string>
#include <cstring>
#include <utility>
#include <stack>
#include <set>
#include <algorithm>
#include <bi... | ALGO | 0.999995 | 3.748363 |
3f407df6-0788-4bdd-9396-bc78231ce839 | 22ema/algorithm | brute_force/fatigue.cpp | #include <string>
#include <vector>
#include <iostream>
using namespace std;
int maximum = -1;
int loop_dungeons(int k, vector<vector<int>>dungeons, vector<bool> visited, int answer){
int dungeons_size = dungeons.size();
int i, finished = 1;
for(i=0; i<dungeons_size; i++){
if(k >= dungeons[i][0]... | ALGO | 0.999886 | 4.205256 |
82fa1e28-1dca-4891-9c81-e8f23e803018 | SymbianSource/oss.FCL.sf.mw.ipappprotocols | realtimenetprots/sipfw/SIP/SIPSec/Framework/src/TSipSecUtils.cpp | #include <in_sock.h>
#include <e32math.h>
#include <commdbconnpref.h>
#include "sipmessage.h"
#include "sipstrings.h"
#include "sipsupportedheader.h"
#include "siprequireheader.h"
#include "sipproxyrequireheader.h"
#include "sipsecurityheaderbase.h"
#include "SipSecUtils.h"
_LIT8(KComma, ",");
// ------------------... | TOOL | 0.922767 | 6.974978 |
2c5bdfcb-2346-43c6-9a5c-7fe54f18d6c7 | iprincekumark/LeetCode-Questions | 858-mirror-reflection/858-mirror-reflection.cpp | class Solution {
public:
int mirrorReflection(int p, int q) {
int ext=q, reflection=p;
while(ext%2==0 && reflection%2==0){
ext/=2;
reflection/=2;
}
if(ext%2==0 && reflection%2!=0) return 0;
if(ext%2==1 && reflection%2==0) return 2;
if(ext%2==1 ... | ALGO | 0.999968 | 5.087916 |
c86ceef7-77e2-4df4-bf69-2d5d7f23b18b | shah5995/datastructure-link-list | hacker_block/ll_odd_even.cpp | #include<iostream>
using namespace std;
struct node
{
int data;
node * next;
};
node * create_ll(int n)
{
node * head=NULL;
head=new node;
int data;
cin>>data;
head->data=data;
head->next=NULL;
if(n==1)
{
return head;
}
n--;
node* it=head;
while(n)
{
... | ALGO | 0.99964 | 3.472335 |
a05bfd96-4e4a-4fcb-8d9a-e16dac093a35 | Subzero-10/leetcode | .history/39.combination-sum_20200711164243.cpp | /*
* @lc app=leetcode id=39 lang=cpp
*
* [39] Combination Sum
*
* https://leetcode.com/problems/combination-sum/description/
*
* algorithms
* Medium (53.54%)
* Likes: 3788
* Dislikes: 115
* Total Accepted: 537.1K
* Total Submissions: 967.1K
* Testcase Example: '[2,3,6,7]\n7'
*
* Given a set of can... | ALGO | 0.999965 | 6.692031 |
b1f0c928-0b63-4ba9-b580-f3aca5eb21ba | glKarin/com.n0n3m4.diii4a | Q3E/src/main/jni/serioussam/SamTSE/Sources/Engine/Rendering/RenderBrushes.cpp | void CRenderer::DrawBrushPolygonVerticesAndEdges(CBrushPolygon &bpo)
{
// get transformed polygon's plane
CWorkingPlane &wplPolygonPlane = *bpo.bpo_pbplPlane->bpl_pwplWorking;
CBrushSector &bsc = *bpo.bpo_pbscSector;
CBrushMip *pbm = bsc.bsc_pbmBrushMip;
CBrush3D &br = *pbm->bm_pbrBrush;
//INDEX iMinVx = bs... | TOOL | 0.949005 | 5.713369 |
f2510354-350d-400e-8751-f9dad0885e8f | Adityajha0808/MyLeetCode | 122-best-time-to-buy-and-sell-stock-ii/122-best-time-to-buy-and-sell-stock-ii.cpp | class Solution {
public:
int maxProfit(vector<int>& a) {
int n = a.size();
if(n==1) return 0;
int res = max(0, a[1] - a[0]);
for(int i=1; i<n-1; ++i) {
res += max(0, a[i+1] - a[i]);
}
return res;
}
}; | ALGO | 0.999744 | 5.744593 |
656153fc-925e-4543-a55d-cef27b4af7a9 | Eths33/NNS_Cpp_SingleThread | NNS_Demo_Gutrmann/source/main.cpp | /*
* Author: Gregory Gutmann
* Nearest neighbor search algorithm demo
* Don't print or keep track of neighbors in a list during simulaion
*/
#include <globals.hpp>
#include <sort.hpp>
#include <particle.hpp>
#include <time.h>
int main() {
// Feel free to change these values to test
int xDimension = X_DIM;
int yDi... | ALGO | 0.999324 | 5.793536 |
7b398b10-b4c8-4ea2-8acf-cc3fe4ee9454 | nguyen18720/H-C-CODELEARN | intepolationosearch.cpp | #include <iostream>
using namespace std;
int interpolationSearch (int a[], int n , int x)
{
int l = 0, r = n-1;
while ( a[l] != a[r] && x >= a[l] && x <= a[r])
{
int mid = l + (r-l) * (x-a[l])/(a[r]-a[l]);
if (a[mid] < x)
{
l = mid + 1;
}else if (a[mid] > x)
... | ALGO | 0.99976 | 5.400084 |
41c6de28-a251-410c-bba9-427725e5dd61 | Varshithkumar26/Strivers-SDE-Sheet-Challenge- | Floor in BST.cpp | #include <bits/stdc++.h>
/************************************************************
Following is the TreeNode class structure
template <typename T>
class TreeNode {
public:
T val;
TreeNode<T> *left;
TreeNode<T> *right;
TreeNode(T val) {
this->val = v... | ALGO | 0.999994 | 5.272999 |
e0dbc3f2-2920-4eb0-84cc-d9be8e1bae49 | foxbao/SensorCalibration | SensorX2car/lidar2car/3rdparty/eigen3/bench/perf_monitoring/trmv_lo.cpp | #include "gemv_common.h"
EIGEN_DONT_INLINE
void trmv(const Mat &A, const Vec &B, Vec &C)
{
C.noalias() += A.triangularView<Lower>() * B;
}
int main(int argc, char **argv)
{
return main_gemv(argc, argv, trmv);
}
| ALGO | 0.98002 | 4.982642 |
051b0144-d70e-40a0-bb74-72bfe5dc8d54 | pawandev200/Leetcode_Dsa | 0209-minimum-size-subarray-sum/0209-minimum-size-subarray-sum.cpp | class Solution {
public:
int minSubArrayLen(int t, vector<int>& nums) {
int n = nums.size();
int i=0;
int j=0;
int sum =0;
int len=0, minilen = INT_MAX;
while(j<n){
sum+=nums[j];
while(sum>=t){
len = j - i + 1;
... | ALGO | 0.999996 | 6.907282 |
039b7524-b055-4867-aa62-0ff41b7c5c8f | ibab/lhcb-software | Rec/Tr/TrackTools/src/HltV0Upgrade.cpp | #include "GaudiAlg/GaudiTool.h"
#include "TrackInterfaces/ITrackFitter.h"
#include "GaudiKernel/IMagneticFieldSvc.h"
#include "Kernel/ITrajPoca.h"
#include "Event/TwoProngVertex.h"
#include "Event/Track.h"
#include "TrackKernel/TrackTraj.h"
#include <boost/assign/list_of.hpp>
#include "HltV0Upgrade.h"
/** @file HltV0U... | TOOL | 0.97253 | 7.277327 |
36fbf284-d9a1-4a60-8b92-565497ec2b75 | kanai0618/HackerRank | suffix_tree/main.cpp | #include <iostream>
#include<string.h>
using namespace std;
void quicksort(int x[10],int first,int last){
int pivot,j,temp,i;
if(first<last){
pivot=first;
i=first;
j=last;
while(i<j){
while(x[i]<=x[pivot]&&i<last)
i++;
while(x[j]... | ALGO | 0.999944 | 3.036095 |
60483ecf-c503-4d2c-ae47-b7d86c5887df | SetsunaChyan/OI_source_code | 2017 ACM Amman Collegiate Programming Contest/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
ll p[100005];
ll fp(ll x,ll y)
{
ll ret=1;
while(y)
{
if(y&1) ret=ret*x%mod;
x=x*x%mod;
y>>=1;
}
return ret;
}
void solve()
{
ll a,b;
scanf("%lld%lld",&a,&b);
printf("%lld\n... | ALGO | 0.999909 | 4.262215 |
30d066a4-448b-4326-aab5-c4b47058c950 | dieuninh1997/spoj2019 | dnOLP/contest2/D.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll ;
//duỵet trau
// void solve(){
// ll a, b, c, prev, d=0;
// cin>>a>>b>>c;
// prev = a;
// while(1){
// if(prev>=b)break;
// // cout<<prev<<" ";
// if((prev+2) % c == 0) {
// prev ++;
// }else{
// prev +=2;
// }
... | ALGO | 0.999955 | 3.162842 |
76f508e0-87e1-4417-805d-f04f5dbf4bbb | brianfarrelarkana/Programming-Algorithm | Post_Test_No_2/main.cpp | #include <iostream>
using namespace std;
int main()
{
string kalimat352;
char vokal352[10] = {'a', 'A', 'i', 'I', 'u', 'U', 'e', 'E', 'o', 'O'};
int vkl352 = 0;
int knsn352 = 0;
int sps352 = 0;
cout << " Masukkan Sebuah Kalimat = "; getline (cin, kalimat352);
cout << " Hasilnya adalah =\... | ALGO | 0.944094 | 3.971881 |
c169c83f-54f0-4d92-8c56-60b6e6d6dacf | GumiwangGde/Flutter_Practice-3- | 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 |
d316a57f-0175-472e-81de-0f8f26a8aaae | fiore57/competitive-cpp | test/geometry.test.cpp | #define PROBLEM \
"https://onlinejudge.u-aizu.ac.jp/courses/library/4/CGL/1/CGL_1_B"
#define ERROR "1e-8"
// clang-format off
#include "../template/template.cpp"
#include "../others/geometry.cpp"
// clang-format on
void Main() {
int xp1 = in(), yp1... | ALGO | 0.999813 | 5.109461 |
faf9779b-6ec1-4b20-8092-abc8489ee672 | Riodsa/CompetitiveProgramming | DataAlgo/a64_q1_lawn_mowing.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 5e5+1;
ll n,m,k;
ll qs[N];
ll solve(int start,int x)
{
int l = start,r = n;
int mid = (l+r)/2;
ll ans = 0;
while(l <= r)
{
mid = (l+r)/2;
ll sum = qs[mid]-qs[start-1];
ll cost = sum + (mid-start... | ALGO | 0.999961 | 4.304434 |
59158028-79e7-4b0a-bb1c-245f4f55db25 | jeong011010/solved.ac | BAEKJOON/1865/1865.cpp | #include<iostream>
#include<vector>
using namespace std;
#define INF 10000000
struct Edge{
int Start,End,Time;
};
int TC, N,M,W,e=0;
vector<int> TIME;
bool Bellman_Ford(vector<Edge> v){
TIME.clear();
TIME.resize(N+1,INF);
TIME[1] = 0;
for(int i=0;i<N;i++){
for(int j=0;j<v.size();j++){
... | ALGO | 0.99972 | 4.460979 |
2e9d9e85-03e8-48e2-98f2-4743ba0fcaac | lld2006/my-c---practice-project | 437/test.cpp | #include "../lib/tools.h"
int main()
{
vector<int> vprimes;
primeWithin(vprimes, 10000);
i64 sum = 0;
for(unsigned int i = 3; i < vprimes.size();++i){
int np = vprimes[i];
if(np > 10000)break;
int flag = 0;
for(i64 j = 2; j < np; ++j ){
i64 value = j *j -j -1;... | ALGO | 0.999756 | 4.10437 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.