uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
7b568c18-6de8-4700-9777-f35746db960a | VrishtiGupta11/Cpp_DataStructures | C++/Searching and Sorting/merge_two_sorted_arrays.cpp | #include<iostream>
using namespace std;
void MergeSortedArrays(int arr[], int arr1[], int N1, int arr2[], int N2){
int i=0, j=0, k=0;
while (i<N1 && j<N2) {
if(arr1[i] < arr2[j]){
arr[k++] = arr1[i++];
}
else{
arr[k++] = arr2[j++];
}
}
while (i < ... | ALGO | 0.999912 | 3.61952 |
dc638be8-3743-47f4-92d3-c644191f30f4 | kks227/BOJ | 5600/5618.cpp | #include <cstdio>
using namespace std;
int gcd(int m, int n){
int r;
while(n){
r = m%n;
m = n;
n = r;
}
return m;
}
void print(int n){
for(int i=1; i<=n; i++)
if(n%i == 0) printf("%d\n", i);
}
int main(){
int n, a, b, c;
scanf("%d", &n);
if(n == 2){
scanf("%d %d", &a, &b);
print(gcd(a, b));
}
... | ALGO | 0.999975 | 4.323398 |
28ee940f-df44-4b95-80c7-a8d06d504764 | YanfeiORNL/EP10x | third_party/eigen/doc/examples/class_VectorBlock.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
template<typename Derived>
Eigen::VectorBlock<Derived>
segmentFromRange(MatrixBase<Derived>& v, int start, int end)
{
return Eigen::VectorBlock<Derived>(v.derived(), start, end-start);
}
template<typename Derived>
const Eigen::Vec... | TOOL | 0.980748 | 4.383477 |
e5c889b7-3f22-4e3d-a3c0-c946c166e707 | rahul-nauni/playground | cppfiles/countBitTwins.cpp | #include <iostream>
#include <string>
using namespace std;
int countBitTwins(int num) {
int count = 0;
int mask = 0b110; // binary representation of twin pattern.
while (num) {
if ((num & mask) == mask) // check if the twin pattern is present
count++;
num >>= 1; // right shift the number unti... | ALGO | 0.999761 | 5.848026 |
7ef80160-6316-4dcf-a60f-b3ebd48cca33 | SergLam/imageStitching-JS | opencv_src/3rdparty/carotene/src/cmp.cpp | #include "common.hpp"
#include "vtransform.hpp"
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace {
inline void vnst(u8* dst, uint8x16_t v1, uint8x16_t v2) { vst1q_u8(dst, v1); vst1q_u8(dst+16, v2); }
inline void vnst(u8* dst, uint16x8_t v1, uint16x8_t v2) { vst1q_u8(dst, vcombine_u8(vmovn_u16(v1), vmovn_u16(v... | ALGO | 0.987092 | 6.2177 |
c73e3393-ba02-46d1-8ed3-a0680312337a | iamshobhitkumar/Leetcode-Solutions | 0139-word-break/0139-word-break.cpp | class Solution {
public:
bool f(string s, unordered_set<string>st,vector<int>& dp, int i, int n){
if(i==n) return true;
if(dp[i]!=-1) return dp[i];
string temp = "";
bool ans = false;
for(int j = i;j<n;j++){
temp+=s[j];
if(st.find(temp)!=st.end()){
... | ALGO | 0.999779 | 6.06471 |
d27cb10e-ad2a-462f-83c1-25dc928ecee4 | kaneki-ken260/InterviewBit-Solutions | Hashing/Colourful Number.cpp | int Solution::colorful(int A) {
unordered_map<long long, long long> mp;
string s="";
while(A>0)
{
int m = A%10;
A = A/10;
s.push_back((char)m+48);
}
reverse(s.begin(),s.end());
for(int i=0;i<s.length();i++)
{
long long prod=1;
for(int j=i;j<s.leng... | ALGO | 0.999815 | 4.660521 |
3cc59302-daa1-4969-bc2f-c1d2afde0abf | sumcobb/genetic | run_genetic.cpp | /*******************************************************************************
* FILE NAME: run_genetic.cpp *
* AUTHOR: Summer Turner *
* LAST DATE MOTIFIED: 23 October 2017 ... | ALGO | 0.998783 | 4.477151 |
56577b14-088f-4070-b773-0f30b85c7e88 | Mccrae15/Unreal-engine- | Engine/Source/ThirdParty/Intel/ISPC/ispc-1.16.1/examples/xpu/aobench/ao_serial.cpp | // -*- mode: c++ -*-
/*
Based on Syoyo Fujita's aobench: http://code.google.com/p/aobench
*/
#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#define NOMINMAX
#pragma warning(disable : 4244)
#pragma warning(disable : 4305)
#endif
#include <math.h>
#include <stdlib.h>
#ifdef _MSC_VER
static long long drand48_x = 0x... | ALGO | 0.998268 | 7.260221 |
5c67d22c-7f8e-4cb7-b8b8-494b94af853d | ashwin1104/Data-Structures-Implementations | lab_quacks/quackfun.cpp | /**
* @file quackfun.cpp
* This is where you will implement the required functions for the
* stacks and queues portion of the lab.
*/
namespace QuackFun {
/**
* Sums items in a stack.
*
* **Hint**: think recursively!
*
* @note You may modify the stack as long as you restore it to its original
* values.
*
... | ALGO | 0.988636 | 6.831681 |
3016e4f1-8bdc-4449-94a7-63ad2470d363 | Strand2013/siguoya | AC_history/[448]找到所有数组中消失的数字.cpp | // 给定一个范围在 1 ≤ a[i] ≤ n ( n = 数组大小 ) 的 整型数组,
// 数组中的元素一些出现了两次,另一些只出现一次。
//
// 找到所有在 [1, n] 范围之间没有出现在数组中的数字。
//
// 您能在不使用额外空间且时间复杂度为O(n)的情况下完成这个任务吗? 你可以假定返回的数组不算在额外空间内。
//
// 示例:
//
//
//输入:
//[4,3,2,7,8,2,3,1]
//
//[4,3,2,7,8,2,3,1]
//[-4,-3,-2,-7,8,2,-3,-1]
//[]
//输出:
//[5,6]
//
// Related Topics 数组
// 👍 530 👎... | ALGO | 0.999871 | 6.05837 |
e3ea0b4b-5702-45eb-8299-f2cc248dcd11 | ishandutta2007/codeforces | izban/normal/166/E.cpp | #include <iostream>
#include <string>
#include <map>
#include <math.h>
#include <vector>
#include <algorithm>
#include <cstdio>
using namespace std;
#define sqr(x) ((x)*(x))
#define PB(a) push_back(a)
#define MP(a) make_pair(a)
#define ll long long
const int mod=1000000007, maxn=10100000;
int n, d[maxn][2];
int m... | ALGO | 0.999959 | 3.624705 |
9baad8fb-7b16-49f1-bc26-46a7e48308ec | FomalhautUmbrage/Quadtree-Range-Based-Search | main.cpp | #include "Quad.h"
#include "illegal_exception.h"
int main()
{
Quad* quad = nullptr;
string command;
while (true)
{
cin >> command;
try {
if (command == "INIT") {
Point startp, endp;
int m;
cin >> m >> startp >> endp;
if (startp.getX() < endp.getX() && startp.getY() < endp.getY()) {
quad... | ALGO | 0.998659 | 4.911962 |
98326dd4-e271-4ba6-9a9e-5bacee9d7ff7 | sagarpanchal/opencv-build | contrib/modules/sfm/src/triangulation.cpp | #include "precomp.hpp"
// Eigen
#include <Eigen/Core>
// OpenCV
#include <opencv2/core/eigen.hpp>
#include <opencv2/sfm/triangulation.hpp>
#include <opencv2/sfm/projection.hpp>
// libmv headers
#include "libmv/multiview/twoviewtriangulation.h"
#include "libmv/multiview/fundamental.h"
using namespace cv;
using names... | ALGO | 0.999282 | 6.641964 |
9b2d5fcc-6084-46a6-ac17-d8b1600e23e9 | Ciano-789/Challenge_2 | My project (1)/Library/PackageCache/com.unity.ide.visualstudio@2.0.16/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include <fcntl.h>
#include <io.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 m... | TOOL | 0.953686 | 6.937841 |
08d79604-2c56-4e19-9b19-391e729fae8b | ganeshalamuru/prg | codeforces/ed155/problems/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long long ll;typedef long double ld;typedef pair<int,int> pii;
#define F first
#define S second
#define PB push_back
#define MP make_pair
const ll mod = 1e9+7, N = 2e6+7, M = 2e6+7, INF = INT_MAX/10;
ll po... | ALGO | 0.999894 | 3.989701 |
4a194b3f-ee76-4e9b-bb74-c5e0b5dbb5dc | dongAxis/JavascriptCore | b3/air/AirInsertionSet.cpp | #include "config.h"
#include "AirInsertionSet.h"
#if ENABLE(B3_JIT)
#include "AirBasicBlock.h"
#include <wtf/BubbleSort.h>
namespace JSC { namespace B3 { namespace Air {
void InsertionSet::insertInsts(size_t index, Vector<Inst>&& insts)
{
for (Inst& inst : insts)
insertInst(index, WTFMove(inst));
}
voi... | ALGO | 0.927263 | 6.34984 |
cc249d57-3569-450b-a27d-b127a91bec13 | Ironmankiller/image-process-lab | 02-rotate/main.cpp | #include <opencv2/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <iostream>
#include <stdio.h>
#include <time.h>
#include <omp.h>
#include <math.h>
#define PI 3.1415926535
using namespace cv;
using namespace std;
clock_t start() {
return clock();
}
... | ALGO | 0.998228 | 5.425645 |
1cc03a88-bb0c-4fbf-a72e-0c3df2038e90 | ishandutta2007/codeforces | isonan/normal/1198/B.cpp | #include <cstdio>
#include <vector>
int n,q,a[200001],fstchange[200001],maxeq[200001];
std::vector<std::pair<int,int> >vec;
int main(){
scanf("%d",&n);
for(int i=1;i<=n;i++)scanf("%d",a+i);
scanf("%d",&q);
for(int i=1,opt,p,x;i<=q;i++){
scanf("%d",&opt);
if(opt==1){
scanf("%d%d",&p,&x);
a[p]=x;
fstcha... | ALGO | 0.999945 | 3.57213 |
c31e1220-e1d2-43cf-b3d4-3883acd45246 | flashdash101/risk-football-model | src/venv/Lib/site-packages/sklearn/utils/src/MurmurHash3.cpp | // Note - The x86 and x64 versions do _not_ produce the same results, as the
// algorithms are optimized for their respective platforms. You can still
// compile and run any of them on any platform, but your performance with the
// non-native version will be less than optimal.
#include "MurmurHash3.h"
//-------------... | ALGO | 0.998254 | 7.198757 |
755b2a74-9fa8-4dd0-9138-7fae70f8c60a | TheRakibJoy/Algorithms | Dynamic Programming/Iterative dp/DP Problem-7.cpp | #include<bits/stdc++.h>
#define Input freopen("in.txt","r",stdin)
#define Output freopen("out.txt","w",stdout)
#define ll long long int
#define ull unsigned long long int
#define pii pair<int,int>
#define pll ... | ALGO | 0.999886 | 3.435246 |
1e14bf41-886e-49cc-872f-86bb5dbd8c02 | npnkhoi/Competitive-programming | LINE contest/Cony Messenger/main.cpp | #include <bits/stdc++.h>
using namespace std;
unsigned long long get_hash(string &s) {
unsigned long long ret = 0;
for (char ch : s) {
ret = ret * BASE + ch;
}
return ret;
}
int find_pos(unsigned long long val) {
int l = 0, r = v.size() - 1, bs = 0;
while (l <= r) {
int mid = (l+r)/2;
if (v[mid].first <= ... | ALGO | 0.999966 | 4.407817 |
cd8a7e06-2699-48f7-9fd0-ffce7b9a3541 | CaptainGoGo007/Library-System | leftangledtriangle.cpp | #include<iostream>
using namespace std;
int main() {
int num;
cin >> num;
int rows = 0;
while(rows < num){
int star_count = 0;
while(star_count <= rows){
cout << "*";
star_count++;
}
cout << "\n";
rows++;
}
return 0;
} | ALGO | 0.999901 | 4.257036 |
ad274ace-f978-4bd9-9b8f-bb44f3f36698 | mahirlabibdihan/Codeforces-Solution | C_Little_Girl_and_Maximum_Sum.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
//Compiler version g++ 6.3.0
// C++ program to show segment tree operations like construction, query
// and update
#include <bits/stdc++.h>
using namespace std;
int tree[200000 + 200000 - 1];
// A utility function to get the middle index ... | ALGO | 0.999958 | 4.482568 |
a0ad3051-4f16-42ff-b1ae-f421520a359a | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_6179_2.cpp | #include <bits/stdc++.h>
bool mat[1001][1001] = {false};
bool find = false;
void test(int x, int y, int n) {
int dx[9] = {-1, 0, 1, 1, 1, 0, -1, -1, 0};
int dy[9] = {1, 1, 1, 0, -1, -1, -1, 0, 0};
for (int i = y - 1; i < y + 2; i++) {
bool flag = true;
for (int j = 0; j < 9; j++) {
int tx = x - 1 + ... | ALGO | 0.999955 | 3.840184 |
7ce34f09-f747-46a4-b232-9f42c69fa42b | ishandutta2007/codeforces | jakube/normal/242/C.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.precision(10);
cout << fixed;
int x0, y0, x1, y1;
cin >> x0 >> y0 >> x1 >> y1;
int n;
cin >> n;
map<pair<int, int>, int> m;
for (int i = 0; i < n; i++) {
... | ALGO | 0.999958 | 4.229179 |
93e83848-b01c-496f-ac9d-6ee732062119 | mrshll/SandFox | gfx/skia/src/core/SkClampRange.cpp | #include "SkClampRange.h"
/*
* returns [0..count] for the number of steps (<= count) for which x0 <= edge
* given each step is followed by x0 += dx
*/
static int chop(int64_t x0, SkFixed edge, int64_t x1, int64_t dx, int count) {
SkASSERT(dx > 0);
SkASSERT(count >= 0);
if (x0 >= edge) {
retur... | TOOL | 0.906073 | 6.838154 |
449217c7-4e9a-4747-a680-bbb87dca9795 | JDI-Kim/Problem_Solving_vscode | basic/prefix.cpp | /*
BOJ #5052 전화번호 목록. 정렬, 서치
*/
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int n;
const int maxN=10000+1;
string tel[maxN];
void read(){
cin>>n;
for(int i=0;i<n;++i){
cin>>tel[i];
}
}
bool solve(){
sort(tel,tel+n);
for(int i=0;i<n;++i){
... | ALGO | 0.999554 | 4.779448 |
5aae2d04-4f47-4bc6-a75a-9fbc17dbc7a7 | Subbuleo23/finding-nemo | CompetitiveProgramming/SegmentTrees/coordinatecompression.cpp | #include<iostream>
#include<map>
#include<vector>
#define ll long long int
std::map<int, int> mp;
int ptr = 0;
std::vector<int> L, R, T;
int main(int argc, char const *argv[])
{
/* code */
int q;
std::cin>>q;
for(int i = 0; i < q; i++) {
int t;
std::cin>>t;
T[i] = t;
i... | ALGO | 0.999421 | 3.999505 |
07852729-8a3e-4972-b639-428126450067 | Palmkonde/CompetitiveProgramming | CSES/Subarray_Divisibility/Subarray_Divisibility.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int64_t n, arr[N];
int main()
{
scanf("%d", &n);
int64_t qs = 0, ans = 0;
vector<int> nums(n, -1);
nums[0] = 0;
for (int i = 0; i < n; i++)
{
scanf("%lld", &arr[i]);
qs = ((qs + arr[i]) % n + n) % n;
... | ALGO | 0.999989 | 3.663423 |
3fa216fa-f3ad-4b5a-937a-a634d54ae4eb | MehrajRahman/competitive_programming | B_Binary_Cafe.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef set<int> si;
typedef set<ll> sl;
typedef map<int, int> mi;
typedef map<char, int> mc;
#define lpr pair<long long int, long long int>
#define fast \
ios_base::sync_wit... | ALGO | 0.999838 | 4.732241 |
51d8aac0-37ec-4c2d-84a1-a408110f93b7 | sikha22/PDA_Problems | PDA/Minimum Swaps to Sort.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find the minimum number of swaps required to sort the array.
int minSwaps(vector<int>&nums)
{
// Code here
vector<pair<int,int>> arr;
int n = nums.size();
f... | ALGO | 0.999946 | 5.845846 |
5dbecc2d-91f8-461f-ab8b-450e0995e86a | Sirius0v0/KalmanFilter | Filter/src/ekf.cpp | #include <Filter/ekf.h>
namespace kalmans
{
void EKFilter::time_update()
{
this->P_ = this->A * this->P * this->A.transpose() + this->Q;
}
void EKFilter::measure_update()
{
this->K = this->P_ * this->H.transpose() *
(this->H * this->P_ * this->H.transpose() + this->R).... | ALGO | 0.890245 | 5.890747 |
32eb4a65-b2f1-433b-a14e-3277dc934c07 | colesmith54/competitive-programming | codeforces/Coin Transformation.cpp | // Cole Smith (colesmith54)
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
void solve() {
ll n;
cin >> n;
ll ans = 1;
ll p = 0;
while (n > 3) {
ans += (1LL << p++);
n /= 4;
}
cout << ans << '\n';
}
int main() {
ios::sy... | ALGO | 0.999815 | 4.91934 |
9dd17d24-78f2-46f4-9c36-03f83956b56a | AI-Cortex/Codewars_Solution | code c++/Sum of two lowest positive integers.cpp | // my profile : https://www.codewars.com/users/AI-Cortex
// Codewars solution github repository : https://github.com/AI-Cortex/Codewars_Solution
//////////////////////////////////////////////////////////////////////
// Name: Sum of two lowest positive integers
// Link: https://www.codewars.com/kata/558fc85d8fd1938afb00... | ALGO | 0.999955 | 5.870087 |
040f1c4f-e992-4dfd-a737-0efd85aa33c5 | freebsd/freebsd-ports-kde | graphics/nurbs++/files/patch-vector.cpp | --- matrix/vector.cpp.orig Mon May 13 14:07:45 2002
+++ matrix/vector.cpp Thu Nov 30 23:49:51 2006
@@ -51,16 +51,16 @@
if(this==&b)
return *this ;
- if ( n() != b.n())
+ if ( this->n() != b.n())
{
- resize(b.n()) ;
+ this->resize(b.n()) ;
}
- sze = b.n() ;
+ this->sze = b.n() ;
T ... | ALGO | 0.989879 | 5.598696 |
ba06b2ee-4552-4caa-9afd-b4b6880c687f | qazmonk/MicroRobotTracking | ModelTracking/firefly_test.cpp | #include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
#include "firefly.h"
#include "mtlib.h"
#include <sys/stat.h>
#include <iostream>
#include <iomanip>
#include <fstream>
using namespace std;
using namespace cv;
firefly_t * f;
firefly_camera_t * camera;
long capture_from_camera(Mat * dst) {
long r... | TOOL | 0.85234 | 4.575997 |
61e1802c-4a6f-4ebd-81e6-042cfe9f8315 | dynamic-wind/advent-of-code-2023-solutions | day18/part1.cpp | #include <iostream>
#include <utility>
#include <limits>
#include <vector>
#include <string>
using namespace std;
pair<int, int> direction_to_offset(char ch) {
switch (ch) {
case 'U': return {-1, 0};
case 'D': return {1, 0};
case 'L': return {0, -1};
case 'R': return {0, 1};
}
... | ALGO | 0.999723 | 6.524625 |
f6968862-9a5b-4407-bf8c-4190ae766cb0 | anmolgera/Codeforces_Solutions | CodeForces/GNU C++17/560D | Equivalent Strings/93320345.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
void anmol()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}
bool ifperfect ( int num){
return (!(num-sqrt(num)*sqrt(num)));
... | ALGO | 0.999989 | 4.331053 |
16fd8757-9536-406a-b801-263ac741d83a | GEOSwift/geos | Sources/geos/src/operation/overlayng/EdgeNodingBuilder.cpp | #include <geos/operation/overlayng/EdgeNodingBuilder.h>
#include <geos/operation/overlayng/EdgeMerger.h>
#include <geos/util.h>
using geos::operation::valid::RepeatedPointRemover;
namespace geos { // geos
namespace operation { // geos.operation
namespace overlayng { // geos.operation.overlayng
/*private*/
Noder... | TOOL | 0.996211 | 6.750492 |
6131b846-d76a-40ab-942e-f7b5520bfd78 | sasoripathos/OI_Practice | Kattis/musiccollection/musiccollection.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<set>
#include<string>
using namespace std;
int T, n;
char s[105];
set<string> sub[100];
void init() {
cin >> n;
cin.getline(s, 105); // skip the \n after n
for (int i=0; i<n; i++) {
c... | ALGO | 0.999949 | 3.28242 |
ef35f872-b409-4a0a-a7c7-e19292107a26 | sirgoyal/Striver-s-SDE-Sheet | levelorderbottomtraversal.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.999958 | 6.158924 |
e5617886-a995-4c8c-93dc-40f42b21118a | berkeley-pie/android_frameworks_av | media/libstagefright/codecs/amrwb/src/dec_acelp_4p_in_64.cpp | /*
------------------------------------------------------------------------------
Filename: dec_acelp_4p_in_64.cpp
Date: 05/08/2007
------------------------------------------------------------------------------
REVISION HISTORY
Description:
------------------------------------------------------------------... | ALGO | 0.999601 | 6.241334 |
90aeabf2-f862-481e-b6ed-4dfcc48d21c0 | ashutoshs007/A2Z-Sheet-Solutions | 0001-two-sum/0001-two-sum.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
int n=nums.size();
vector<pair<int,int>>v;
for(int i=0;i<n;i++){
v.push_back({nums[i],i});
}
sort(v.begin(),v.end());
int i=0,j=n-1;
while(i<j){
int sum = v[i].first+ v[j].first;... | ALGO | 0.999945 | 6.19288 |
1a62b8fc-af75-4717-be2f-3012dfd04ff8 | elhamekhoda/TopNtupleAnalysis | TopNtupleAnalysis/EFTIncludes/P3_Sigma_TopEffTh_gd_ttxgd/check_sa.cpp | #include <iostream>
#include <iomanip>
#include "CPPProcess.h"
#include "rambo.h"
int main(int argc, char** argv){
// Create a process object
CPPProcess process;
// Read param_card and set parameters
process.initProc("../../Cards/param_card.dat");
double energy = 1500;
double weight;
// Get phase s... | TOOL | 0.875331 | 4.347733 |
a4eb02de-8ac3-4314-a40f-43bf289758e8 | Jack1eNgBaro/JustCp | CodeForces/C++20 (GCC 11-64)/1829E | The Lakes/204787575.cpp | /*
"There is no light without dark
There is no joy without pain
You can't have a rainbow without a little rain"
~ Andrew Tate
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pii pair<int,int>
#define bit(x, i) ((x >> i) & 1)
const int mod = 1e9 + 7;
const int maxn = ... | ALGO | 0.999857 | 5.173415 |
482a1f15-77f5-4609-84ad-c98ec54286f2 | Allie-98/Homework4 | aruco_ros/aruco/src/aruco/ippe.cpp | #include "ippe.h"
#include <opencv2/imgproc.hpp>
#include <iostream>
using namespace cv;
using namespace std;
namespace aruco
{
/******
*
*/
cv::Mat getRTMatrix(const cv::Mat& R_, const cv::Mat& T_, int forceType)
{
cv::Mat M;
cv::Mat R, T;
R_.copyTo(R);
T_.copyTo(T);
if (R.type() == CV_64F)
{
as... | ALGO | 0.999298 | 6.172313 |
880309f3-1454-4938-bd48-ce86155cf72a | liuq901/code | Vijos/v_1041.cpp | #include <cstdio>
#include <cstdlib>
int main()
{
double p,q;
int i;
scanf("%lf%lf",&p,&q);
i=0;
while (1)
{
i++;
if ((int)(i*p/100.0+0.00001)<(int)(i*q/100.0-0.00001))
break;
}
printf("%d\n",i);
system("pause");
return(0);
}
| ALGO | 0.995667 | 3.11463 |
4ed825be-ffa8-4f13-8274-ef987445bd00 | ishandutta2007/codeforces | cinnamoroll/normal/1215/A.cpp | // warm heart, wagging tail,and a smile just for you!
//
//
//
//
//
//
//
//
//
//
/... | ALGO | 0.999689 | 4.978372 |
8e786151-7677-4684-925e-d0351a6690ff | rohitsinghkcodes/Hacktober-CP-contributions | 30day/day2MagicaNumber.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <stack>
#include <queue>
#define in long long
#include <string>
using namespace std;
// 19 =>82=>68=>100=>1
int fun(int n)
{
int s = 0;
int sum =... | ALGO | 0.999969 | 4.147352 |
732d10df-b0a2-4551-897a-3ff300e302de | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_6491_3.cpp | #include <bits/stdc++.h>
using namespace std;
struct debugger {
template <typename T>
debugger& operator,(const T& v) {
cerr << v << " ";
return *this;
}
} dbg;
bool all_9(const string& s) {
bool flag = true;
for (char ch : s)
if (ch != '9') flag = false;
return flag;
}
int main() {
long long ... | ALGO | 0.999776 | 5.203311 |
8bee1952-3ee3-4e54-ac0d-82ebe2d8bfa1 | dhirajpatil2346/compitative | cses/range queries/large_exp.cpp | #include <bits/stdc++.h>
using namespace std;
#define LL long long
#define endl "\n"
// const LL mod = 1e9 + 7;
vector<LL> prefix_function(string s)
{
LL n = (LL)s.length();
vector<LL> pi(n);
for (LL i = 1; i < n; i++)
{
LL j = pi[i - 1];
while (j > 0 && s[i] != s[j])
j = pi... | ALGO | 0.99997 | 5.539353 |
e60ef031-2875-4716-bde9-a3d823e6c4aa | Elua-b/DSA_final | morning/student/main.cpp | #include <iostream>
#include <vector>
#include <fstream>
#include <sstream>
#include <string>
#include <iomanip> // For table formatting
using namespace std;
// Define the Course class
class Course {
public:
string courseName;
bool available;
Course(string name, bool avail) : courseName(name), available(... | TOOL | 0.881608 | 7.280753 |
72c5d2f2-595b-481b-a5d5-1b7a75622c54 | feren-OS/kwin-patching | src/layers.cpp | // SELI zmenit doc
/*
This file contains things relevant to stacking order and layers.
Design:
Normal unconstrained stacking order, as requested by the user (by clicking
on windows to raise them, etc.), is in Workspace::unconstrained_stacking_order.
That list shouldn't be used at all, except for building
Work... | TOOL | 0.940912 | 6.581795 |
b4803e3b-d45b-4fdc-9955-11ec8c550cbf | cxyfer/OJ | Leetcode/cpp/easy/2441.cpp | /*
* @lc app=leetcode id=2441 lang=cpp
* @lcpr version=30122
*
* [2441] Largest Positive Integer That Exists With Its Negative
*/
// @lcpr-template-start
#include <bits/stdc++.h>
using namespace std;
// @lcpr-template-end
// @lc code=start
class Solution {
public:
int findMaxK(vector<int>& nums) {
int... | ALGO | 0.999885 | 5.275606 |
f58dedf0-c715-4bb6-8589-d58a8b29b70a | DhyanShah22/Information_Security | Experiment-5/revised.cpp | #include <iostream>
#include <string>
#include <cctype>
using namespace std;
const int CHAR_SET_SIZE = 95;
string generateKey(const string& text, string key) {
int textLen = text.length();
int keyLen = key.length();
if (keyLen >= textLen) return key;
for (int i = keyLen; i < textLen; ++i) {
... | ALGO | 0.998305 | 5.088368 |
d051886e-b339-4d30-bfd5-f8f3eb8b8e50 | sharmajatin741/Competitve-Programming | Codeforces/118A.cpp | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string s;
cin>>s;
for(ll i=0;s[i];i++)
{ if(isupper(s[i]))
s[i]=tolower(s[i]);
if(s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u'||s[i]=='y')
{
continue;
... | ALGO | 0.997012 | 3.363951 |
69e6dbb7-dc4d-4474-9f57-67ecfdbcedbc | rdbyk/scilab | scilab/modules/elementary_functions/sci_gateway/cpp/sci_atan.cpp | /*--------------------------------------------------------------------------*/
#include <cmath>
#include "elem_func_gw.hxx"
#include "function.hxx"
#include "double.hxx"
#include "overload.hxx"
#include "configvariable.hxx"
extern "C"
{
#include "Scierror.h"
#include "sciprint.h"
#include "localization.h"
#include "... | TOOL | 0.920803 | 5.540436 |
fcb30f8b-e68d-43c6-8f7a-a3bb7983cb95 | luigifreda/pyslam | thirdparty/lietorch/eigen/bench/vdw_new.cpp | #include <iostream>
#include <Eigen/Core>
using namespace Eigen;
#ifndef SCALAR
#define SCALAR float
#endif
#ifndef SIZE
#define SIZE 10000
#endif
#ifndef REPEAT
#define REPEAT 10000
#endif
typedef Matrix<SCALAR, Eigen::Dynamic, 1> Vec;
using namespace std;
SCALAR E_VDW(const Vec &interactions1, const Vec &inter... | ALGO | 0.999808 | 3.519938 |
61fc5cc0-ffb0-4c4c-9ca2-81ac9c08c233 | longxuyi/Stanford | CME211/project/cme211-longxuyi-project2/hw6/image.cpp | #define BOOST_DISABLE_ASSERTS
#include <boost/multi_array.hpp>
#include <iostream>
#include <jpeglib.h>
#include <sstream>
#include <stdexcept>
#include <string>
#include "image.hpp"
#include "hw6.hpp"
Image::Image(std::string filename) {
this->input_file = filename;
ReadGrayscaleJPEG(this->input_file, t... | TOOL | 0.917752 | 5.806305 |
ede94221-8c08-4c05-b474-b1f6f2e87f8e | ankurvijay200/DSA | array/homework/findAllDuplicates.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int array[n], hash[n];
for (int i = 0; i < n; i++)
{
cin>>array[i];
hash[i]=0;
}
for (int i = 0; i < n; i++)
{
int val = array[i];
hash[val]++;
}
for (int i = 0; i < n; i++)
... | ALGO | 0.999638 | 3.850005 |
736e0948-2b9b-49ef-b883-b1cbe628dd4e | paldad111/til-study | problem-solvings/beak-15657/sol2/main.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int N, M;
int V[8+1];
int seq[8+1];
void func(int i, int j)
{
int k;
/* base condition 1 - M number selected */
if (i > M)
{
for (k = 1; k <= M; k++)
cout << seq[k] << " ";
cout << "\n";
return;
}
/* base condition 2 - no number to selec... | ALGO | 0.999972 | 3.741743 |
7ab62ced-a9d8-455f-a190-9f0ef319f1bb | Ilsaf221/cppCourse | lw1/square_equation.cpp | #include <cstdio>
#include <cmath>
int main()
{
std::puts("please enter a, b and c for 'ax^2 + bx + c = 0' : ");
float a = 0;
float b = 0;
float c = 0;
std::scanf("%f %f %f", &a, &b, &c);
float D = 0;
D = b * b - 4 * a * c;
if (D > 0)
{
float x1 = (-b + std::sqrt(D)) / (2 ... | ALGO | 0.999685 | 4.221858 |
14e43ac6-b63c-423c-b8ea-c587bfe5b9ef | Ashishmangal06/FaceMaskDatasetMLAIProject | opencv-master/opencv-master/modules/imgproc/src/samplers.cpp | #include "precomp.hpp"
namespace cv
{
static const uchar*
adjustRect( const uchar* src, size_t src_step, int pix_size,
Size src_size, Size win_size,
Point ip, Rect* pRect )
{
Rect rect;
if( ip.x >= 0 )
{
src += ip.x*pix_size;
rect.x = 0;
}
else
{
... | ALGO | 0.997917 | 5.681817 |
afa468cc-2544-4c10-9c51-5ed2ef04d8a3 | ishandutta2007/codeforces | rednextcentury/normal/877/E.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
bool Vis[200005];
vector < int > G[200005];
int tree[2000005],t=0,in[200005],out[200005],mx=-1,lazy[2000005],Arr[2000005];
void Build(int node=1,int Start=1,int End=400005){
if(Start==End){
tree[node]=Arr[Start];
return;
}
... | ALGO | 0.999881 | 4.229032 |
900f5517-bf34-4dfd-baa5-660dc1055280 | Rikveet/Kattis-Solutions | Last Factorial Digit/main.cpp | #include <iostream>
using namespace std;
int main() {
int n=0;
cin >> n;
int f[n];
for(int i=0;i<n;i++){
cin>>f[i];
}
int lastDigit;
int multiplier;
for(int i=0;i<n;i++){
lastDigit =1;
multiplier = f[i];
while(multiplier>0&&lastDigit>0){
lastDi... | ALGO | 0.999912 | 3.410436 |
8fbc6fb0-3be6-47e8-9474-208dc8c4ba51 | thierrystevenin/dataStructures | word_analysis.cpp | #include <string>
/**
PSEUDOCODE:
algorithm MinimumWordLength
Input:
Output:
Your pseudocode goes here.
COMMENTS:
Add comments here that might help us to understand your
thought process, especially if you're unable to finish the
pseudocode or code. This can help us award points in the
code logic catego... | ALGO | 0.995498 | 5.134808 |
2868213f-261a-455d-8c75-8708d79b7f10 | Javtor/competitive-programming-problems | Other/Practica2/m.cpp | #include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fst first
#define snd second
#define all(cont) cont.begin(), cont.end()
#define fore(i, a, b) for (int i = a, almo5t = b; i < almo5t; i++)
#define SZ(x) ((int)x.size())
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define MOD 10... | ALGO | 0.99999 | 3.920547 |
3166a775-d204-45c0-921f-082de249f62e | HASAN-49/Competitive-Programming | AtCoder/dp_c.cpp | // بسم الله الرحمن الرحيم
// Problem Link --> https://atcoder.jp/contests/dp/tasks/dp_c?lang=en
#include<bits/stdc++.h>
using namespace std;
#define test int t; for(cin >> t; t; t--)
#define ll long long
#define ull unsigned long long
#define ld long double
#define all(a) a.begin(), a.end()
#define allr(a) a.rbegin... | ALGO | 0.999951 | 4.223907 |
be083161-5d49-43e3-a66d-5761f8830e06 | cloudysman/C_Programming_PTIT | Kiem_Tra_2/C04036_Doi_Tien.cpp | #include <stdio.h>
int main() {
int T, N;
int denominations[] = {1, 2, 5, 10, 20, 50, 100, 200, 500, 1000};
int num_denominations = sizeof(denominations) / sizeof(denominations[0]);
scanf("%d", &T);
for(int i = 0; i < T; i++) {
scanf("%d", &N);
int count = 0;
for(int j = nu... | ALGO | 0.999883 | 4.856597 |
1f512cdf-ad06-458d-be41-c55a1620f030 | Aditya24-rathore/CPP | whileloops.cpp/evennum.cpp | #include<iostream>
using namespace std;
int main()
{
int a=1;
while(a<=10){
if(a%2==0){
cout<<a;
}
}
} | ALGO | 0.992303 | 3.175673 |
ec2641c8-77f2-4329-90e8-aede37abcb7d | Octo-Siddharth/TCS-NQT-Coding-Questions | 9_Top_100_Codes/4_Operation_on_Strings/19_1st_and_nth_ch_capital.cpp | //Program to cpaitalize the first and the last character
#include<bits/stdc++.h>
using namespace std;
void upperCase(string s, int n)
{
for(int i = 0; i<n; i++)
{
if(i == 0 || i == (n - 1))
{
s[i] = toupper(s[i]);
}
else if(s[i] == ' ')
{
s[i - 1... | ALGO | 0.996619 | 3.838437 |
71554301-2f05-405b-980f-dde1d8d188d0 | SharifulCSECoU/Competitive_Programming.-.Online_Judge | LightOJ/1241 - Pinocchio.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int T, N, CASE = 1;
cin >> T;
while(T--)
{
cin >> N;
int BEG = 2, CNT = 0, A, i;
for(i = 0; i < N; i++)
{
cin >> A;
CNT = CNT + (A - BEG) / 5.0;
if((A - BEG) % 5 > 0)
... | ALGO | 0.999779 | 4.019943 |
abd805ec-3d9f-43c7-bf79-442ac0d40eaf | shahnehal0407/CPP | 1534-minimum-number-of-frogs-croaking/minimum-number-of-frogs-croaking.cpp | class Solution {
public:
int minNumberOfFrogs(string frog) {
int onGoing = 0;
int maxOngoing = 0;
vector<int> dp(5, 0);
for(auto a : frog){
if(a == 'c'){
dp[0]++;
onGoing++;
maxOngoing = max(maxOngoing, onGoing);
... | ALGO | 0.99995 | 4.873116 |
d755d19c-0e11-480b-b804-6c6dcd07c44c | K14KHaNaSa/bojPractice | 15104.cpp | #include <iostream>
using namespace std;
int main(void) {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
string s;
cin >> s;
int length = s.length();
for (int i = 0; i < length - 1; i++) {
if (s.substr(i, 1) == s.substr(i + 1, 1)) {
cout << "Or not.";
return 0;
}
}
cout << "Odd.";
} | ALGO | 0.99992 | 3.545724 |
3b46a79a-2a60-4d22-b776-c0e66c92a556 | akgmage/data-structures-and-algorithms | Graphs/single_cycle_check.cpp | /*
You're given an array of integers where each integer represents a jump of its value in the array. For instance, the integer
2 represents a jump of two indices forward in the array; the integer -3 represents a jump of three indices backward in the array.
If a jump spills past the array's bounds, it wraps over ... | ALGO | 0.999972 | 6.684101 |
eeaa7938-36f2-4847-947e-19bae25038f7 | iamnahid/CPP | INTERMEDIATE/135.cpp | #include <iostream>
using namespace std;
int main ()
{
int i,j,r,n;
cout<<"please input the number of column: ";
cin>>n;
cout<<endl<<endl;
for(i=1;i<=n;i=i+2)
{
for(r=n-i;r>=1;r=r-2)
{
cout<<' ';
}
... | ALGO | 0.999886 | 3.079524 |
53e1e463-c31c-42ef-b847-8689f46a63aa | AreYouKhush/dsa-cpp | C++ DSA/Dynamic Programming/target_sum.cpp | #include<bits/stdc++.h>
using namespace std;
int helper(vector<int>& nums, int target, int total, int i, vector<vector<int>>& dp, int offset) {
if(i == nums.size()) {
return total == target;
}
if(dp[i][total + offset] != -1) return dp[i][total + offset];
dp[i][total + offset] = helper(nums, ta... | ALGO | 0.999986 | 6.001574 |
abca6cc6-68b4-46eb-84ad-8247afd611be | Junghs-cloud/Baekjoon | Silver/2/_10971.cpp | #include <iostream>
using namespace std;
int** map;
bool* isVisited;
int N;
int answer = 987654321;
void backTracking(int depth, int start, int current, int sum)
{
if (depth == N-1)
{
if (map[current][start] != 0)
{
answer = min(answer, sum+map[current][start]);
}
}
else
{
for (int next = 0; next < N; n... | ALGO | 0.999917 | 3.930267 |
9cc0a22e-3158-4b33-9405-786a61201cdd | S-Popy/XPSC_phitron | week-3/vlad_building_beautiful_array.cpp | // problem Link: https://codeforces.com/problemset/problem/1833/C
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while(t--){
int n; cin >> n;
int odd_count = 0, even_count = 0, mi... | ALGO | 0.998934 | 5.66541 |
6f8fe91e-bcca-497d-8ce7-1d81276c006f | ishandutta2007/codeforces | vladprog/normal/259/A.cpp | #include<bits/stdc++.h>
#define DEBUG
#ifdef DEBUG
#define IFD(...) __VA_ARGS__
#else
#define IFD(...)
#endif // DEBUG
#define it iterator
#define rit reverse_iterator
#define mp make_pair
#define mems(a,b) memset(a,b,sizeof(a))
#define mem0(a) mems(a,0)
#define halt exit(0)
#define all(c) (c).begin() , (c).e... | ALGO | 0.999969 | 3.530867 |
a6ac82ad-8633-4039-9270-ec507646bc41 | 1emvr/HexaneC2-pre-alpha | core/src/cipher.cpp | #include <core/include/cipher.hpp>
namespace Xtea {
VOID Uint32ToBlock(const uint32 v0, const uint32 v1, uint8 *dst) {
dst[0] = v0 >> 24; dst[1] = v0 >> 16; dst[2] = v0 >> 8; dst[3] = v0;
dst[4] = v1 >> 24; dst[5] = v1 >> 16; dst[6] = v1 >> 8; dst[7] = v1;
}
VOID XteaEncrypt(const _ciphe... | ALGO | 0.997991 | 5.811434 |
772cc191-6e8f-44d7-b6d6-c3e83cdabe85 | MrWhitezz/Coding-during-Learning | C++/ProblemSolving/Term 1/Final exam/C.cpp | //ҷ >=xyzԻ
//Ȼʣ´xyz - 1ʼö
//ÿжʱȿȡٸ T3 ʽʽͬʱmod x ȻſԴŷ
// (T3 mod x) * k (a mod x) x ͬ࣬k
//ٿT1, T2 Ƶķ
//δȫŷһЩ̣˵һЩbug
#include<bits/stdc++.h>
using namespace std;
long long x, y, z, T1, T2, T3, r1, r2;
long long gcd(long long m, long long n);
long long extended_gcd(long long a, long long b, long long &x, long long &y);
... | ALGO | 0.999959 | 3.590605 |
3ca556a8-b250-49a6-9a26-8a28d125f05a | sushant2508/Sushant_7 | Tower Of Hanoi - GFG/tower-of-hanoi.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
// You need to complete this function
// avoid space at the starting of the string in "move disk....."
long long count =0;
long long toh(int N, int A, int C, int B) {
if(N... | ALGO | 0.999927 | 5.631192 |
9ac57a7a-5814-48ea-9ed3-06fa6ad6b478 | 660610809-kornkawin/lab17 | lab17_1.cpp | #include<iostream>
using namespace std;
int main() {
int nA, nB;
int *A, *B, **C;
cout << "Length of A: ";
cin >> nA;
A = new int[nA];
cout << "Input Array A: ";
for(int i = 0; i < nA; i++) cin >> A[i];
cout << "Length of B: ";
cin >> nB;
B = new int[nB];
cout << "Input ... | ALGO | 0.999442 | 3.644426 |
7fb50cbe-6a2e-46a6-a6e9-66fefee17c8d | neilkumar93600/cpp-assignment | average.cpp | #include <iostream>
class Average {
public:
static double calculate(double a, double b, double c) {
return (a + b + c) / 3;
}
};
int main() {
double a, b, c;
std::cout << "Enter the first number: ";
std::cin >> a;
std::cout << "Enter the second number: ";
std::cin >... | ALGO | 0.993799 | 6.207642 |
cab4c80c-7873-4e67-92e9-c78c7231c6a4 | Amagnum/Calculate-3D-Transformation-Point-Line-Plane-CG | lib/eigen-3.3.9/doc/examples/tut_arithmetic_scalar_mul_div.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
Matrix2d a;
a << 1, 2,
3, 4;
Vector3d v(1,2,3);
std::cout << "a * 2.5 =\n" << a * 2.5 << std::endl;
std::cout << "0.1 * v =\n" << 0.1 * v << std::endl;
std::cout << "Doing v *= 2;" << std::endl;
v *= 2;
std::cout << ... | ALGO | 0.972671 | 3.669638 |
26931f5f-27c1-4ea6-b423-4a2d653ca124 | ampl/coin | Ipopt/Ipopt/src/Algorithm/IpRestoIterateInitializer.cpp | #include "IpRestoIterateInitializer.hpp"
#include "IpRestoIpoptNLP.hpp"
#include "IpDefaultIterateInitializer.hpp"
namespace Ipopt
{
#if COIN_IPOPT_VERBOSITY > 0
static const Index dbg_verbosity = 0;
#endif
RestoIterateInitializer::RestoIterateInitializer
(const SmartPtr<EqMultiplierCalculator>& resto_eq_mult_c... | ALGO | 0.997143 | 6.452273 |
cc06a191-5212-4ee6-8f74-4bc22f386303 | zhuwenboa/data_struct | data/leetcode/graph/547.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class Solution
{
public:
void dfs(vector<vector<int>>& M, int index, vector<int>& visited)
{
visited[index] = 1;
for(int j = 0; j < M[0].size(); ++j)
{
if(M[index][j] == 1 && visited[j] == 0)
... | ALGO | 0.999983 | 6.160576 |
6f2f7e09-5c7b-42f6-9e4a-48cff7b59b45 | robotics-ETF/RPMPLv2 | src/planners/drbt/DRGBT.cpp | #include "DRGBT.h"
planning::drbt::DRGBT::DRGBT(const std::shared_ptr<base::StateSpace> ss_) : RGBTConnect(ss_)
{
planner_type = planning::PlannerType::DRGBT;
}
planning::drbt::DRGBT::DRGBT(const std::shared_ptr<base::StateSpace> ss_, const std::shared_ptr<base::State> q_start_,
cons... | ALGO | 0.999579 | 4.460792 |
d7c427df-4e8b-4a6e-94ef-926c53c92311 | alexandraback/datacollection | solutions_1483488_0/C++/bood/c.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <functional>
#include <cstdio>
#include <unordered_map>
#include <set>
using namespace std;
int t,a,b;
vector<char> m;
int ret;
void calc()
{
m.clear();
m.resize(10000001,'n');
ret = 0;
int n=1,j=a/10;
while(j>0) {... | ALGO | 0.999242 | 3.935509 |
e94a2fbf-ac3d-4283-8df8-6f937e827ec5 | tangye/Streamlines-Visualization | HierarchicalCluster.cpp |
#include <vtkDataSet.h>
#include <vtkStructuredGrid.h>
#include <vtkPoints.h>
#include <vtkPolyData.h>
#include <vtkStreamTracer.h>
#include <vtkAppendPolyData.h>
#include <vtkPolyDataWriter.h>
#include <vtkPolyDataReader.h>
#include <vtkDataSetAttributes.h>
#include <stdio.h>
#include <string>
#include <time.h>
#incl... | ALGO | 0.98258 | 3.200022 |
96df3ffa-3cf6-4aba-81c9-39bee061b1a5 | hitesharora1997/sorting_in_rust | dsa/c++/max.cpp | #include <climits>
#include <iostream>
using namespace std;
void swapping(int arr[], int n) {
int start = 0;
int end = n - 1;
while (start <= end) {
swap(arr[start], arr[end]);
start++;
end--;
}
for (int i = 0; i < n; i++) {
cout << "new" << arr[i] << endl;
}
}
int getMax(const int arr[... | ALGO | 0.999334 | 4.759214 |
009693ae-66ec-4186-8c5b-5afc2261c5d2 | pacocp/University-Works | Third Year/MH/Prácticas/Práctica1/software/src/random_ppio.cpp | #include <math.h>
#include "random_ppio.h"
unsigned long Seed = 0L;
#define MASK 2147483647
#define PRIME 65539
#define SCALE 0.4656612875e-9
void Set_random (unsigned long x)
/* Inicializa la semilla al valor x.
Solo debe llamarse a esta funcion una vez en todo el programa */
{
Seed = (unsigned long) x;
}
u... | ALGO | 0.974855 | 4.991993 |
f1731c3f-8778-4d44-a4da-e3dffb129c08 | searchkuldeepsingh/Data-Structures-and-Algorithms | Geeksforgeeks/Searching/FloorInSortedArray/UsingBinary.cpp | #include <bits/stdc++.h>
using namespace std;
long long floorSearch(vector<long long> arr, long long low, long long high, long long x)
{
if (low > high)
return -1;
if (x >= arr[high])
return high;
long long mid = (low + high) / 2;
if (arr[mid] == x)
return mid; ... | ALGO | 0.999983 | 4.982216 |
8c05ce0a-994b-47a9-ac8b-c86c9622ce2a | ZhenyingZhu/ClassicAlgorithms | src/CPP/src/leetcode/JumpGame.cpp | /*
* [Source] https://leetcode.com/problems/jump-game/
* [Difficulty]: Medium
* [Tag]: Array
* [Tag]: Greedy
*/
#include <iostream>
using namespace std;
// [Solution]: Use a pointer to track the farest position. If reach that position but cannot move forward, return false.
// [Corner Case]:
class Solution {
};
... | ALGO | 0.999883 | 5.849731 |
23e641ff-2624-4ce4-803c-cb909774df92 | umaidansari12/CP | 11_sliding_window/binary_subarrays_with_sum.cpp | class Solution {
public:
int numSubarraysWithSum(vector<int>& nums, int goal) {
int n = nums.size(), sum = 0, ans = 0;
unordered_map<int, int> hash_map;
for (int right = 0; right < n; right++) {
sum += nums[right];
if (sum == goal)
ans++;
i... | ALGO | 0.999984 | 6.465333 |
306a7d88-0937-42a6-84fd-7f532df65cac | RahulRaniwal/SDE_sheet_solution | 229. Majority Element II.cpp | class Solution {
public:
// boyer moore algo
vector<int> majorityElement(vector<int>& nums) {
int num1 = -1 , num2 = -1 , cnt1 = 0 , cnt2 = 0 , size = nums.size();
for(int i = 0; i < size; i++){
if(nums[i] == num1){
cnt1++;
}e... | ALGO | 0.999993 | 5.646717 |
66e415db-4100-4ad8-bb55-31707a242d04 | Kenny3Shen/MyLeetcode | leetcode_by_cpp/剑指 Offer 38. 字符串的排列.cpp | /* 输入一个字符串,打印出该字符串中字符的所有排列。
你可以以任意顺序返回这个字符串数组,但里面不能有重复元素。
示例:
输入:s = "abc"
输出:["abc","acb","bac","bca","cab","cba"] */
#include <vector>
#include <string>
using namespace std;
class Solution
{
public:
vector<string> res;
bool isOccured(string &s, int start, int end)
{
for (int i = start; i < end;... | ALGO | 0.999805 | 5.145254 |
0b499c53-98a1-4dc9-835b-60b7627657c5 | ClaesJensen/ERTS_Project_E24 | reverb/reverb_hls.cpp | #include "reverb.hpp"
// ==================================================
// Reverb Function
// ==================================================
void reverb( data_t inputData, data_t* outputData )
{
// ==================================================
// Allpass Filter Arrays
// ======================... | ALGO | 0.978592 | 4.528562 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.