uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
cafaa5c9-d706-4709-ae17-6ea02061a2c8 | limsub/Algorithm | 지금/Two Pointer/2003_수들의 합 2.cpp | #include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <sstream>
#include <algorithm>
using namespace std;
#include <queue>
#include <cstdio>
#include <set>
#include <map>
// #include <pair>
// #include <bits/stdc++.h>
// 2003 수들의 합 2
// 투포인터
int main() {
ios::sync_with_stdio(0);
ci... | ALGO | 0.999986 | 4.572368 |
bba98b73-4339-4d88-935a-5f07a2167179 | almishra/metadirective | llvm/lib/CodeGen/MachineDominators.cpp | #include "llvm/CodeGen/MachineDominators.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/InitializePasses.h"
#include "llvm/Support/CommandLine.h"
using namespace llvm;
namespace llvm {
// Always verify dominfo if expensive checking is enabled.
#ifdef EXPENSIVE_CHECKS
bool Veri... | ALGO | 0.999295 | 7.73012 |
eaed137a-89f9-4998-a180-be21fec8fccd | Ahmedkhalid404/codeforces-Solutions | CodeForces/GNU C++20 (64)/1521B | Nastia and a Good Array/196913270.cpp | /*
* Show me your beautiful smile :)
*
* author: Ahmed khaled ( _GOM3A_ )
*
* */
#include <bits/stdc++.h>
using namespace std;
#define fast_IO(x) ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define fraction cout<< fixed <<showpoint <<setprecision
#define what_is(x) ... | ALGO | 0.998896 | 3.365096 |
78263997-db02-4cb2-bec0-6c28a37fd6b1 | Liu554-bn/Mini-MLP | thirdParty/eigen-3.4.0/bench/sparse_trisolver.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
// -DNOGMM -DNOMTL
// -I /home/gael/Coding/LinearAlgebra/CSparse/... | ALGO | 0.997755 | 4.874496 |
0f1a5c93-5b2e-42ec-9e1b-2af885c59002 | ppathirana54/EC327-cpp | HW2/Q3.cpp | #include <iostream>
#include <bitset>
using namespace std;
int main()
{
int num1; int num2;
cout << "Enter two non-negative integers" << endl;
cin >> num1;
cin >> num2;
int a = num1 ^ num2;
std::bitset<32> ans(a);
bool different = false;
int hex_count = 0;
for (int i = 0; i < 3... | ALGO | 0.999242 | 4.798822 |
5009ec55-564e-4b3f-99a0-cb3ead6fd6a4 | NguyenTichDuy/DataStructuresAndAlgorithms | Long_Number/mutiLongNumber.cpp | #include<iostream>
#include<string.h>
#include<string>
using namespace std;
void multi(string str1, string str2)
{
int maxLength = str1.size() + str2.size();
int result[maxLength + 1], num1[str1.size()], num2[str2.size()];
memset(result, 0, sizeof(result));
for (int i = 0; i < str1.size(); i++)
{... | ALGO | 0.999989 | 4.213897 |
353be145-7f63-418e-b269-a6df01eb65f9 | Shokkenn/Data-Structures-And-Algorithms | Stack/6 Mergable Stack.cpp | #include <bits/stdc++.h> // Includes all standard libraries
using namespace std;
// Class representing a stack using a linked list
class Stack
{
// Structure representing a node in the linked list
struct node
{
int data; // Data stored in the node
node* next; // Pointer to the next node
... | ALGO | 0.999771 | 5.844881 |
62840de2-132c-4150-a94e-c64bfda206fe | ihalemi/Object-oriented-Programming-with-C- | Workshops/workshop7/w7_lab_prof.cpp | // OOP244 Workshop 7: Derived Classes
// File w7_athome.cpp
// Version 2.0
// Date 2017/01/12
// Author Hasan Murtaza, Chris Szalwinski
// Description
// This file demonstrates the client module of w7
/////////////////////////////////////////////////////
#include <iostream>
#include "Hero.h"
using namespa... | TOOL | 0.880969 | 4.426183 |
7d0b2905-7d40-4089-a42a-e6a22b7f47df | EmptyDust/Algorithm-Codes-and-writeups | codes/-0x30_competition/-0x3D_hdu/2024_summer_9/1001.cpp | #include <bits/stdc++.h>
#define ranges std::ranges
#define views std::views
using u32 = unsigned;
using i64 = long long;
using u64 = unsigned long long;
using pii = std::pair<i64, i64>;
using a3 = std::array<int, 3>;
using a4 = std::array<int, 4>;
const int N = 1e6;
const int MAXN = 1e6 + 10;
const int inf = 1e9;
... | ALGO | 0.999905 | 4.401617 |
28ad5808-442c-49a9-84f6-5f953678db64 | CandyRoms/frameworks_av-old | media/libstagefright/codecs/amrwb/src/preemph_amrwb_dec.cpp | /*
------------------------------------------------------------------------------
Filename: preemph_amrwb_dec.cpp
Date: 12/10/2004
------------------------------------------------------------------------------
REVISION HISTORY
Description:
-------------------------------------------------------------------... | ALGO | 0.999932 | 5.475962 |
ab28df16-11d9-415f-8eff-cd905d134c11 | w-mj/leetcode | 518.CoinChange2.cpp | #include "defines.h"
class Solution {
public:
int change(int amount, vector<int>& coins) {
int n = coins.size();
vector<int> dp(amount+1, 0);
dp[0] = 1;
for (int coin : coins) {
for (int i=coin; i<=amount; i++)
dp[i] += dp[i-coin];
}
re... | ALGO | 0.999892 | 5.923883 |
f6bad534-646b-4d3c-9263-41def89a9687 | GYPpro/ACM | 2_test/2023JNU TEST/苏神的荣耀.cpp | #define _USE_IOSTREAM_
// #define _PRIV_TEST_
#ifndef _USE_IOSTREAM_
#define _USE_STDIO_
#endif
#ifdef _USE_IOSTREAM_
#include <iostream>
#endif
#ifdef _USE_STDIO_
#include <stdio.h>
#endif
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <string>
#include <string.h>
#include <vector>
#include <ma... | ALGO | 0.999937 | 4.341988 |
2595ceef-e54b-4c24-b421-ea4f850de276 | adi907/Cp | Striver_SDEsheet/searchBST.cpp | // Approach: See left for smaller value, right for greater value. If same return
// Time complexity: O(N) ; Space complexity: O(1)
#include<bits/stdc++.h>
using namespace std;
struct TreeNode{
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(... | ALGO | 0.999996 | 5.512544 |
7c7f2b58-656e-4868-8c8f-90645b5e48f6 | Tapiocaman/sudoku | P2/nextPrime.cpp | #include "integer.h"
#include "imath.h"
namespace imath
{
//takes in the input number and the amount to compare to.
/*integer nextPrime(const integer& in, const integer& k){
while (!isPrime(in, k)){
//if in is odd
in=in +2;
//else
in = in+1;
}
return in;
}
*/
integer nextPrime(const integer& i, const inte... | ALGO | 0.999377 | 3.438183 |
693c8ff5-08dd-4555-86ec-6e7a1bc42d40 | thusinhtk/Advanced-C-Programing | Section7-PassingFunctionToFunction/35.UsingFunctionPointers/35.UsingFunctionPointers.cpp | // 35UsingFunctionPointers.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <vector>
#include <iostream>
#include <algorithm> // to call count_if function
using namespace std;
bool match(string test)
{
return test == "two";
//return test.size() == 3;
}
int countString(ve... | TOOL | 0.944443 | 5.39824 |
31b0853b-2631-4390-b129-c2d9efc38443 | devendrapandey333/CPP | STL/vector/nestedVector.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl "\n"
#define mod 1000000007
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define mem0(x) memset(x, 0, sizeof(x))
#define memneg(x) memset(x, -1, sizeof(x))
#define ld long double
#define f(i, a... | ALGO | 0.999558 | 4.040787 |
3b7f8f27-6ba3-4479-b41f-a58bf16605c5 | melonattacker/atcoder | contests/ABC/ABC227/c.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// const int INF = 1 << 30;
const long long INF = 1LL << 60;
int main() {
ll n;
cin >> n;
ll ans = 0;
for(ll a=1; a*a*a<=n; a++){
for(ll b=a; a*b*b<=n; b++){
ans+= n/a/b - b +1;
}
}
cout << ans << endl;
return 0;
} | ALGO | 0.999967 | 3.767347 |
7ce14c61-6c23-472b-bc6b-36541fff729b | SebastianHurtado98/paralela_tsp | V0_Pruebas/mpi.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <limits.h>
#include <fstream>
#include <openmpi/mpi.h>
#include <omp.h>
using namespace std;
int get_min_and_substract(int n, int mat[], int prev_rc)
{
int min;
int *rc = new int[n];
int i, j;
#pragma omp parallel fo... | ALGO | 0.999799 | 3.56626 |
8b9782ac-cfb6-4dad-ab6a-4d08c8773110 | Dennshirennshij/beyond-all-reason-recoil | rts/Sim/Misc/SmoothHeightMesh.cpp | #include <vector>
#include <cassert>
#include <limits>
#include "SmoothHeightMesh.h"
#include "Map/Ground.h"
#include "Map/ReadMap.h"
#include "Sim/Misc/ModInfo.h"
#include "System/float3.h"
#include "System/Log/ILog.h"
#include "System/SpringMath.h"
#include "System/TimeProfiler.h"
#include "System/Threading/ThreadP... | ALGO | 0.982091 | 6.557662 |
f146bdf6-7da9-4720-ab32-efb8bfad7fdb | Xilinx/hls-llvm-project | libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list.pass.cpp | // UNSUPPORTED: c++98, c++03
// <algorithm>
// template<class T>
// pair<T, T>
// minmax(initializer_list<T> t);
#include <algorithm>
#include <cassert>
#include "test_macros.h"
int main()
{
assert((std::minmax({1, 2, 3}) == std::pair<int, int>(1, 3)));
assert((std::minmax({1, 3, 2}) == std::pair<int, ... | TEST | 0.939644 | 5.909312 |
cc51d383-487b-47e1-8c15-fe505ba4b2d8 | li-ming-jiang/MyOpenSees | SRC/analysis/integrator/HHTGeneralized.cpp | // $Revision$
// $Date$
// $URL$
// Written: Andreas Schellenberg (<EMAIL>)
// Created: 10/05
// Revision: A
//
// Description: This file contains the implementation of the HHTGeneralized class.
#include <HHTGeneralized.h>
#include <FE_Element.h>
#include <FE_EleIter.h>
#include <LinearSOE.h>
#include <AnalysisModel.... | ALGO | 0.960543 | 4.442831 |
3b840a79-b99e-4175-a9d3-7d2e8753a7c7 | arpitagrawal24/Leetcode | 155-min-stack/155-min-stack.cpp | class MinStack
{
public:
vector<int> stack;
int gmin = INT_MAX;
MinStack() {}
void push(int val)
{
stack.push_back(val);
gmin = min(gmin, val);
}
void pop()
{
stack.pop_back();
gmin = INT_MAX;
for (auto &i: stack)
{
gm... | ALGO | 0.999791 | 6.357941 |
0ea93f78-f9c3-4ba1-a0ec-0eb4d81da4ad | El3ctric5had0w/Informatyka | Lekcje/lekcja 1-3-1 Zad.1.cpp | #include <iostream>
using namespace std;
int main(){
cout << "Prowadz 5 liczb";
int liczba[ 5 ];
for(int i=0; i <5; i++)
{
cin >> liczba[ i ];
}
cout << "Liczby parzyste: ";
for(int i=0; i <5; i++)
if(i!/2)
cout << liczba[ i ] << ", ";
return 0;
} | ALGO | 0.988254 | 3.342781 |
251c99d4-4ead-4169-909d-844a4136a266 | nathanPro/competitiveProgramming | codechef/APRIL17/dishlife.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 2e5;
int T;
int n, k;
int F[N];
set<int> I[N];
int main(){
scanf(" %d", &T);
while(T--){
scanf(" %d%d", &n, &k);
for(int i=0;i<k;i++) F[i] = 0;
for(int i=0;i<n;i++) I[i].clear();
for(int i=0;i<n;i++){
int p... | ALGO | 0.999574 | 4.094435 |
3aebaa74-5d0c-4e4b-ab65-4877aee786b4 | sarvex/leetcode-chicken | solution/1600-1699/1668.Maximum Repeating Substring/Solution.cpp | class Solution {
public:
int maxRepeating(string sequence, string word) {
int ans = 0;
string t = word;
int x = sequence.size() / word.size();
for (int k = 1; k <= x; ++k) {
if (sequence.find(t) != string::npos) {
ans = k;
}
t += wo... | ALGO | 0.999948 | 5.716488 |
7a793cc4-a5b4-4a55-b4b8-f46b5d9db59d | ishandutta2007/codeforces | 131131yhx/normal/933/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int maxn = (int)3e5 + 3;
int n, a[maxn], cnt, p[maxn], m, out[maxn];
LL f[maxn];
bool v[maxn];
int descension(int pos) {
int dt = min(a[pos], a[pos + 1]);
if(dt)
out[++m] = pos;
a[pos] -= dt;
a[pos + 1] -= dt;
return dt;
}
int main() {
sc... | ALGO | 0.999989 | 3.276815 |
e9cec893-891b-45e9-9462-91a339b214ab | stym01/LeetCode-Solutions | 1961-maximum-ice-cream-bars/1961-maximum-ice-cream-bars.cpp | class Solution {
public:
int maxIceCream(vector<int>& costs, int coins) {
int maxi=0;
for(auto it:costs) maxi=max(maxi,it);
vector<int>count(maxi+1,0);
for(auto it:costs){
count[it]++;
}
int cnt=0;
for(int i=0;i<=maxi;i++){
if(count[i]... | ALGO | 0.9994 | 5.910836 |
930c33c7-db0f-4ba6-a163-8ce55d4d6ab6 | saraffa13/c- | C_Common_Divisors.cpp | #include<bits/stdc++.h>
// =======================================================================================================
using namespace std;
#define endl '\n'
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define ll long long
#define ld long dou... | ALGO | 0.999775 | 3.854962 |
1c553164-2da8-4b9f-b9fa-2ef57626a49c | suola-makkara/PotatoEngine | PotatoEngine/3d_modeling/command_parser.cpp | #include "command_parser.hpp"
#include "test_command.hpp"
#include "empty_command.hpp"
#include "revert_command.hpp"
#include "redo_command.hpp"
#include <memory>
#include <set>
#include <iostream>
#include <list>
/*
* edit context
* - access thrugh config file
* - no gurantees on state after undo / redo which affect... | TOOL | 0.892843 | 7.33353 |
ba956fc8-812d-4881-b48f-a3f2f0aa51ed | yitianhao/gpu_sched_new | gpu-sched-exp/minor/boost_1_61_0/libs/compute/perf/perf_is_sorted.cpp | #include <algorithm>
#include <iostream>
#include <vector>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/is_sorted.hpp>
#include <boost/compute/algorithm/reverse.hpp>
#include <boost/compute/algorithm/sort.hpp>
#include <boost/compute/container/vector.hpp>
#include "perf.hpp"
int main(int arg... | ALGO | 0.996417 | 6.354411 |
13aa4d01-9066-49b4-9f97-4aee9267f974 | bala1144/ARAP---AS-RIGID-AS-POSSIBLE | libs/Eigen/bench/sparse_trisolver.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
// -DNOGMM -DNOMTL
// -I /home/gael/Coding/LinearAlgebra/CSparse/... | ALGO | 0.996872 | 4.874496 |
8c4ca35e-b4ca-4f15-9bf4-bbfa9daaa5c6 | shashwatiwari/gfg-potd | 2023/10-October/19-10-2023.cpp | /*
Author : Shashvat Tiwari
Date : 19/10/2023
Problem : Level of Nodes
Difficulty : Medium
Problem Link :https : https://practice.geeksforgeeks.org/problems/level-of-nodes-1587115620/1
Video Solution : NA
*/
int nodeLevel(int V, vector<int> adj[], int X)
{
vector<bool> visited(V, false);
vector<int> level(V,... | ALGO | 0.999879 | 5.377474 |
f74eebee-5819-4c20-ad71-173afc8ecf9b | akashkvyas/leetcode | 153.find-minimum-in-rotated-sorted-array.cpp | /*
* @lc app=leetcode id=153 lang=cpp
*
* [153] Find Minimum in Rotated Sorted Array
*/
#include <iostream>
#include <limits>
#include <vector>
using namespace std;
// @lc code=start
class Solution {
public:
int findMin(vector<int>& nums) {
int low = 0, high = nums.size() - 1;
int min_num = n... | ALGO | 0.999973 | 6.792749 |
4a42ec7a-cbd1-4060-9fbb-f3c6ffc0681c | TrianglesProject/triangles | src/pbkdf2.cpp |
#include <string.h>
#include "pbkdf2.h"
static inline uint32_t
be32dec(const void *pp)
{
const uint8_t *p = (uint8_t const *)pp;
return ((uint32_t)(p[3]) + ((uint32_t)(p[2]) << 8) +
((uint32_t)(p[1]) << 16) + ((uint32_t)(p[0]) << 24));
}
static inline void
be32enc(void *pp, uint32_t x)
{
uint8_... | ALGO | 0.997223 | 6.926346 |
c1421acd-5c23-4222-b162-e95f3459163f | Sindhujo/C-CPP-DS-Alg | pointer3.cpp | #include <iostream>
using namespace std;
int main() {
int i = 1, j=2;
int * ptr = &i;
cout << "value of i:" << i << endl;
cout << "value of ptr:" << ptr << endl;
i = 3;
cout << ">>>>>>>>>when i value is 3" << endl;
cout << "value of i:" << i << endl;
cout << "value of ptr:" << pt... | ALGO | 0.999075 | 3.180883 |
d2f0160c-0957-4973-9674-d154fccc565b | Zielon/3DScanning | Project/Tracker/external-libs/Eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_operatornorm.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
MatrixXf m(2,2);
m << 1,-2,
-3,4;
cout << "1-norm(m) = " << m.cwiseAbs().colwise().sum().maxCoeff()
<< " == " << m.colwise().lpNorm<1>().maxCoeff() << endl;
cout << "infty-norm(m... | ALGO | 0.999658 | 4.076589 |
1f8b1d18-d838-4d83-a229-f731681840de | ishandutta2007/codeforces | mateusz/normal/450/E.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <list>
#include <set>
#include <ctime>
#include <cmath>
#include <queue>
#define LD long double
#define LL long long
#define double long double
#define MP make_pair
#define ff first
#define ss second
#define PB push... | ALGO | 0.999843 | 3.343992 |
cc3d55f5-8d89-4a4e-91c9-d944e926fdfb | sidaphale/High_Performance_Computing-1 | HW1/P4/p4_cblas.cpp | //HPC-1 Assignment-1, Problem No. -4
//Program to calcuate vector vector dot product (L1 BLAS Function)
//Aim- To plot the performance
//Code compatible to generate vectors of size 64MBytes = 65536 kBytes with n = 24 (n = 1, vector size = 8 bytes, n = 2, vector size = 16 bytes....n = 24, vector size = 67108864 bytes)
... | ALGO | 0.987017 | 4.608745 |
409b5d26-51f4-4afd-b1d5-29a8a2dc9c6e | SamarthKadam/CodingBlocksDataStructureAlgo | 6 ChallengesArray/4RainWaterHarvesting.cpp | //This is 0(n2)approach
// #include<iostream>
// using namespace std;
// int CountWaters=0;
// void RainWater(int arr[100],int n)
// {
// int left;
// int right;
// for(int i=1;i<n-1;i++)
// {
// left=arr[i];
// for(int j=0;j<i;j++)
// {
// left=max(left,arr[j]);
// }
// right=arr[i];
// fo... | ALGO | 0.999992 | 5.824262 |
b8c5ef2b-0704-42eb-ac43-194d05cb24b9 | AarambhaAnta/CSES | Sliding-Window-Problems/Sliding_Window_Sum.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
void solve() {
int n, k, x, a, b, c;
cin >> n >> k >> x >> a >> b >> c;
vector<int> A(n);
A[0] = x;
for (int i = 1; i < n; i++) {
A[i] = (a * A[i - 1] + b) % c;
}
int head = -1, tail = 0;
int ans = 0;
int... | ALGO | 0.999946 | 3.784391 |
d760c95c-d865-48f8-ac44-936502c7364b | tikhonshw/itProgerC | Less07 Библиотека стандартных шаблонов/Практика/7.5/main.cpp | #include <iostream>
#include <clocale>
#include <list>
using std::cout;
using std::endl;
int main() {
setlocale(LC_ALL, "Russian");
std::list<int> numbers = {7, 5, 3, 8, 4};
// cout << numbers.front() << endl;
// cout << numbers.back() << endl;
std::list<int>::iterator iter;
// numbers.s... | TOOL | 0.99811 | 3.36356 |
f48b9bcf-fba3-4489-b958-0e77f682b57c | FWaldi/campus_job_structureData | tugas_jobsheet7/kode_percobaan/jobsheet7_percobaan4.cpp | //Dibuat_oleh_Fitri-Waldi_NIM-22343021
#include <stdio.h>
#define ukuran 5
int deque[ukuran];
int f = -1, r = -1;
// Fungsi untuk menambahkan nilai pada bagian depan
void insert_front(int x)
{
if((f==0 && r==ukuran-1) || (f==r+1))
{
printf("Overflow");
}
else if((f==-1) && (r==-1))
{f=r=0;
deque[f]=x;
}else if(... | ALGO | 0.999006 | 4.399309 |
fefa5f2e-8ced-4527-b145-e6e11fd95acf | anand434/Project-Euler | euler49.cpp | #include <bits/stdc++.h>
using namespace std;
void genPrims(long n){
for(long i = 2; i <= sqrt(n) ; i++)
}
void swap(char *x , char *y){
char temp;
temp = *x;
*x = *y;
*y = temp;
}
void permute(char *a , int l , int r){
if(l == r)
cout << a << "\n";
else {
for(int i = l ; i <= r ; i++){
swap((a+l) , (a... | ALGO | 0.999537 | 4.467579 |
cc428b77-450d-482b-9a1e-dcc76231ccc1 | itsmedurgesh/Coding-Practice-CPP | CLRS/xor_linkedlist1.cpp | #include <stdio.h>
#include <stdlib.h>
// Node structure of a memory efficient doubly linked list
struct node
{
int data;
struct node* npx; /* XOR of next and previous node */
};
/* returns XORed value of the node addresses */
struct node* XOR (struct node *a, struct node *b)
{
return (struct node*) ((... | ALGO | 0.999894 | 4.541184 |
ba67f223-5a83-45dd-9db8-82034f45091d | watemus/cp-prog | codeforces/cf665/D.cpp | //
// Created by watemus on 21.08.2020.
//
#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
using namespace std;
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()
#define FF first
#define SS second
using ll = long long;
using ld = long double;
#define int ll
template<typen... | ALGO | 0.999901 | 4.94126 |
d7aef7bf-3dc6-40da-8f7a-339872a77965 | igasa-KCompetitiveProgramming/Atcoder | ABC306/c.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pint = pair<int,int>;
using pll = pair<long long, long long>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i,n) for (int i = 1; i <= (int)(n); i++)
#define YesNo(bool) if(bool) cout << "Yes" <... | ALGO | 0.999975 | 3.428396 |
16ee91ca-0f8c-46c6-89e8-bb8d085ce5d9 | IamAnkit19/Codes | C++ Programs/DSA/POTD/Day170-MaxMinHeight.cpp | // Day: 170
// Date: 30/06/2025
// Day: Monday
#include<iostream>
#include<vector>
#include<queue>
#include<unordered_map>
#include<stack>
#include<string>
#include<algorithm>
#include<cmath>
#include<climits>
#include<map>
#include<numeric>
using namespace std;
class Node {
public:
int data;
Node *left, *ri... | ALGO | 0.999988 | 5.446355 |
058e275c-cd6d-4554-9b95-ee7da18d7a02 | yourpriyanshu/My-Codes | Recursion/factorial_pattern.cpp | // A number n is called a factorial number if it is the factorial of a positive integer. For example, the first few factorial numbers are 1, 2, 6, 24, 120,
// Given a number n, the task is to return the list/vector of the factorial numbers smaller than or equal to n.
// Input: n = 6
// Output: 1 2 6
// Explanation: The... | ALGO | 0.999953 | 6.135993 |
e338f128-42a3-43c5-bd58-efa0df49962b | zuru-zuru/soltgbackend | solc_new/solidity/libsolidity/interface/FileReader.cpp | #include <liblangutil/Exceptions.h>
#include <libsolutil/CommonIO.h>
#include <libsolutil/Exceptions.h>
#include <libsolutil/StringUtils.h>
#include <boost/algorithm/string/predicate.hpp>
#include <range/v3/view/transform.hpp>
#include <range/v3/range/conversion.hpp>
#include <functional>
using solidity::frontend:... | TOOL | 0.928818 | 7.231767 |
58b7df18-9df7-4419-8f2b-2370f05b869a | mdurasevic/electoral_systems_combination | crp/crp/PR4.cpp | #include "PR4.h"
#include "SelectHighestContainerStrategy.h"
#include "SelectHighestContainerAlwaysStrategy.h"
#include "SelectMostContainersStrategy.h"
#include "SelectFirstAvailabelContainerStrategy.h"
PR4::PR4(double retrievalRate)
{
this->retrievalRate = retrievalRate;
}
void PR4::Solve(ContainerYard& containerY... | ALGO | 0.995492 | 4.455018 |
2ab81f6d-4d6d-4100-a65e-f6b0300d4ab9 | jadhavanu/CppPrograms | Assignment no1/assign1prog66.cpp | /*66. Write a C++ program to add all the numbers from 1 to a given number.
Add 1 to 4: 10
Add 1 to 100: 5050
*/
#include <iostream>
#include <math.h>
using namespace std;
int main(){
int n,sum;
cout<<"\nInput the number up to which you want to add : ";
cin>>n;
sum=0;
for(int i=1;i<=n;i++)
... | ALGO | 0.994469 | 4.081684 |
05b1a687-fda4-429b-92b8-89e866baa4af | Eviassor789/KNN-Server | MinkowskiDistance.cpp | #include <vector>
#include <cmath>
#include "MinkowskiDistance.h"
using namespace std;
/**
* @brief Get the Minkowski Distance of two vectors of the same size and a given constant P.
*
* @param vec1 vector 1
* @param vec2 vector 2
* @param vectorSizes the size of the 2 vectors
* @param p a constant for the Minkowski ... | ALGO | 0.992982 | 4.656569 |
946b9196-53db-447b-9b29-82d528adeaad | loceaner/OI_Code | luogu/luogu2330.cpp | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int n,m,maxn=-0x7fffffff;
int g[301][301],minn[301];
bool u[301];
int main() {
memset(g,0x7f,sizeof(g));
memset(minn,0x7f,sizeof(minn));
memset(u,true,sizeof(u));
scanf("%d%d",&n,&m);
int x,y,z;
for(int i=1; i<=m; i++... | ALGO | 0.999971 | 3.512509 |
36b2156a-369f-49ac-9b58-4056b0d7c27a | mahimalmuntashir/CodeForces | 1300-1399/1324C-FrogJumps.cpp | #include <iostream>
int main(){
std::ios_base::sync_with_stdio(false);
long t; std::cin >> t;
while(t--){
std::string s; std::cin >> s;
s += 'R';
long mx(0), last(-1);
for(long p = 0; p < s.size(); p++){
if(s[p] == 'L'){continue;}
long diff = p - las... | ALGO | 0.997209 | 3.741265 |
e7500665-5ddc-4b1a-a5ec-06b62914c53a | lucky00122/px4_study | src/lib/controllib/BlockLowPass.cpp | /**
* @file blocks.cpp
*
* Controller library code
*/
#include <math.h>
#include <float.h>
#include "blocks.hpp"
namespace control
{
float BlockLowPass::update(float input)
{
if (!PX4_ISFINITE(getState())) {
setState(input);
}
float b = 2 * float(M_PI) * getFCut() * getDt();
float a = b / (1 + b);
setSt... | ALGO | 0.980011 | 5.652858 |
b557e2ef-064e-46db-bc11-609e94cdf82a | isseii10/atcoder | abc/183/e.cpp | #include <bits/stdc++.h>
//#include <atcoder/all>
#define rep(i, n) for (int i=0; i < (n); i++)
using namespace std;
//using namespace atcoder;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int, int> P;
const int INF = 1 << 30;
const ll LINF = 1LL << 61;
const int NIL = -... | ALGO | 0.999956 | 4.214354 |
0b91345f-8fc1-47c4-ab80-66e1f55e0b27 | walk2run/Algorithms | leetcode/47/Permutations II.cpp | #include <vector>
#include <stdio.h>
using namespace std;
struct Pair {
Pair(int v, int c) : value(v), count(c) {}
int value, count;
};
class Solution {
public:
vector<vector<int> > permuteUnique(vector<int> &num) {
bool find;
for (int i : num) {
find = false;
for (auto &pair : pairs) {
if (pair.... | ALGO | 0.999992 | 4.968786 |
097a7cf1-5008-46a4-9bb4-c77b8f3dde4b | 984727216/oj1 | HDU/2094/10991853_AC_31ms_1892kB.cpp | #include <iostream>
#include <cstdio>
#include <map>
#include <cstring>
using namespace std;
const int maxn = 1005;
map<string, int> m;
int edge[maxn];
int n;
char name1[100], name2[100];
int main(){
while(scanf("%d", &n) != EOF && n){
memset(edge, 0, sizeof(edge));
m.clear();
int idx = 1;
for(int i = 0; i < n... | ALGO | 0.999884 | 3.979027 |
56753bab-6e55-4910-a7b3-6dc6da79cded | Alienge/learngit | test2/test2/test2.cpp | #include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
using namespace std;
using namespace cv;
static void help()
{
cout << "\nThis program demonstrates GrabCut segmentation -- select an object in a region\n"
"and then grabcut will attempt to segment it... | ALGO | 0.871305 | 5.459316 |
4defcf7d-c143-40ab-a182-95a545ca9029 | Adityalad-25/Arrays | 11.RightRotateArraybyK.cpp | //Rotate an array by k elements to the right
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
void rotateArray(vector<int>& arr, int k)
{
int n = arr.size();
// Mod k with the size of the array
// To handle the case where k is greater than the size of the array
k %= n;
// array... | ALGO | 0.999957 | 5.617565 |
62dde609-7649-4a39-a622-6c134cd6108b | Maati-Mohamed/Problem-solving-codeforces | contest#3/3_Choose_Elements.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long n,k;
cin>>n>>k;
long long arr[n];
for(int i = 0; i < n; i++){
cin>>arr[i];
}
sort(arr, arr+n);
reverse(arr, arr+n);
long long sum;
for(int x = 0; x < k; x++){
if(arr[x] < 0){
break;
... | ALGO | 0.999979 | 4.060718 |
222c9000-14f1-43da-9529-e12685e926da | PaulaLuana/resolucao-programacao-competitiva | curso-ed-neps/estrururas-intermediarias/tacos-de-bilhar.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, num, prod = 0;
cin >> n;
set<int> tacos;
for(int i = 0; i < n; i++){
cin >> num;
if(tacos.size() == 0){
tacos.insert(num);
prod += 2;
}else if(tacos.count(num)){
tacos.erase(num);
}else{
tacos.insert(num);
prod += 2;
}
... | ALGO | 0.998976 | 3.771931 |
558c381c-4b4c-44d2-9461-61191171d0d4 | vivek6201/DSA | recursion/assignment/checkPalindromeRE.cpp | #include<iostream>
#include<string.h>
using namespace std;
bool checkPalindrome(string str, int start, int end){
if(start > end) return true;
if(str[start] != str[end]) return false;
return checkPalindrome(str, start + 1, end - 1);
}
int main(){
string str = "babbab";
if(checkPalindrome(str, 0... | ALGO | 0.999889 | 4.317393 |
36c6f334-b078-4799-bb3b-386aad75c5d9 | vaibhavgup3003/cp | programming assignments/C++/Programming in Modern C++/vector.cpp | #include <iostream>
#include <stdlib.h>
#include <vector>
using namespace std;
void display(vector<int> &v)
{
for (int i = 0; i < v.size(); i++)
{
cout << v[i] << " ";
}
}
int main()
{
cout << "Enter the No. of elements \n ";
int count, sum = 0;
cin >> count;
vector<int> arr; // This will initiallis... | ALGO | 0.972778 | 3.776787 |
ec187c4f-aaa9-4951-90f8-886989538f42 | cropinghigh/sdrpp-vhfvoiceradio | src/dsp/dsd_dmr.cpp | #include "dsd.h"
namespace dsp {
int NewDSD::processDMRdata(int count, const uint8_t* in) {
int usedDibits = 0;
if(curr_state == STATE_PROC_FRAME_DMR_DATA) {
uint8_t cc = 0;
char bursttype[5];
bursttype[4] = 0;
char syncdata[25];
char sy... | TOOL | 0.927028 | 4.525471 |
51929d81-4f48-4eab-8f0c-f99f1d76989f | doocs/leetcode | solution/0400-0499/0492.Construct the Rectangle/Solution.cpp | class Solution {
public:
vector<int> constructRectangle(int area) {
int w = sqrt(1.0 * area);
while (area % w != 0) --w;
return {area / w, w};
}
}; | ALGO | 0.998964 | 6.465598 |
a656cd0f-43ae-40d6-8bc3-31ef047283ce | 01LuGuang/Algorithm | Practice/Greedy/活动大师丁丁妹.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int T, n;
cin >> T;
while(T--) {
cin >> n;
int end = -1;//上一个活动的结束时间
int ans = 0; //可以做的活动数量
vector<pair<int, int>> thing(n);
for(int i = 0; i < n; i ++) {
cin... | ALGO | 0.999965 | 4.833635 |
b1fdc635-ab5a-4b9d-b14c-abbc1ce3714d | Liouvi/IG-SLAM | thirdparty/lietorch/eigen/doc/examples/make_circulant2.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
// [circulant_func]
template<class ArgType>
class circulant_functor {
const ArgType &m_vec;
public:
circulant_functor(const ArgType& arg) : m_vec(arg) {}
const typename ArgType::Scalar& operator() (Index row, Index col) const {
Index index = ... | ALGO | 0.999697 | 5.569832 |
dbf31048-3cea-405b-9e0a-5e4011934d99 | a1981611080/snake | src/snake.cpp | #include "snake.h"
#include <QDebug>
//snake::snake() :
//{
//}
void snake::addData()
{
zuobiao *temp = new zuobiao;
temp->x=lasttail.x;
temp->y=lasttail.y;
temp->last=snakeTail;
temp->next=NULL;
snakeTail->next=temp;
snakeTail=temp;
}
void snake::runData()
{
lasttail.x=snakeTail->x;
last... | TOOL | 0.960575 | 4.129066 |
3ff64700-c6ae-46d9-8908-0a9b0c209384 | ThreeStones1029/leetcode | 40.组合总和-ii.cpp | // @before-stub-for-debug-begin
#include <vector>
#include <string>
#include "commoncppproblem40.h"
using namespace std;
// @before-stub-for-debug-end
/*
* @lc app=leetcode.cn id=40 lang=cpp
*
* [40] 组合总和 II
*/
// @lc code=start
class Solution {
private:
vector<vector<int>> result;
vector<int> path;
... | ALGO | 0.99988 | 6.57813 |
e4df10fc-04b3-4005-bf0c-fb0cff406346 | tfcpanda/cBaseExercises | CExercises17/Exercises01_01.cpp | #include<stdio.h>
void inputdata(int a[],int n);
void outputdata(int a[],int n);
void swap(int a,int b);
int main()
{
int n,m,a[99],i,j;
n = 8;
inputdata( a, n);
for ( i = 0; i < n-1; i++)
{
for ( j = 0; j < n - 1 - i; j++)
{
if (a[j] > a[j + 1])
{
i... | ALGO | 0.999973 | 3.191922 |
7da759f8-ba8c-4bca-87b8-f03206654f79 | PRINCERAHUL1/CrackYourPlacement | Stack and Queues/Backspace String Compare.cpp | class Solution {
public:
bool backspaceCompare(string s, string t) {
int m= s.length();
int n= t.length();
stack<char> st1;
stack<char> st2;
for(int i=0;i<m;i++)
{
if(s[i] == '#')
{
if(!st1.empty())
st1.pop... | ALGO | 0.999954 | 6.189394 |
5b88680e-d37b-4e17-9006-659f75ef6490 | cyber-hoax/LeetCodeQues | 977-squares-of-a-sorted-array/977-squares-of-a-sorted-array.cpp | class Solution {
public:
vector<int> sortedSquares(vector<int>& nums) {
int n = nums.size() ;
int start = 0 , end = n-1 , pos = n-1;
vector<int> ans(n);
while(start <= end) {
if(abs(nums[start]) < abs(nums[end])){
ans[pos--] = nums[end] * nums[end];
... | ALGO | 0.999989 | 5.802322 |
2f31700c-7d34-4b48-b142-61e6d6741b14 | FRC-Team-Vern/SteamPunkGogglesOpenCVPlugin | lib/cppprocess.cpp | #include "cppprocess.h"
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/core/core.hpp>
#include <iostream>
// Contours typedef for simpler coding of parameters
typedef std::vector<std::vector<cv::Point>> Contours;
// Declare Global contants
const cv::Scalar RED(255, 0, 0);
const cv::Scalar GREEN(0, 255, 0);... | TOOL | 0.982254 | 4.775228 |
947d44c7-0e92-4e0e-a4d2-191e457a1297 | beshubh/InterviewPrep | IB/dp/buy_and_sell_stocks_twice.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pi;
typedef vector<pair<int, int>> vpi;
typedef vector<pair<ll, ll>> vpl;
typedef vector<pair<double, double>> vpd;
#define maxvec(vec) *max_element(vec.begin(), vec.end())
#define ... | ALGO | 0.999713 | 4.019154 |
fe337b48-6dd1-4e99-a16c-b2ce9aab06b5 | lleviackermann/CpCodes | codeforces/C_Did_We_Get_Everything_Covered.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define endl "\n"
#define fo(i, n) for (i = 0;... | ALGO | 0.999977 | 3.734722 |
a12bdddd-0481-4c2e-a9d3-d275c245e424 | Divyanshu-012/LeetcodeCommits | 3455-minimum-length-of-string-after-operations/3455-minimum-length-of-string-after-operations.cpp | class Solution {
public:
int minimumLength(string s) {
int n = s.size();
unordered_map<int,int> mp;
for(int i = 0 ; i< n ; i++){
mp[s[i]]++;
}
int sum= 0;
for(auto it : mp){
if(it.second > 2){
if(it.second %2 != 0){
... | ALGO | 0.999946 | 5.789902 |
4bc0c953-6a20-4a36-9fa2-cc8e3ba2304d | Soundug/Peer-programming | Day 16/xenia_and_divisors.cpp | #include<iostream>
using namespace std;
int main()
{
int n, x, count[8] = { 0 };
cin >> n;
for (int i = 0; i < n; ++i)
{
cin >> x;
count[x] ++;
}
bool solution;
if (count[5] == 0 && count[7] == 0 && count[2] >= count[4] && count[1] == count[4] + count[6] && count[2] + count[3] == count[4] + count[6])
{
... | ALGO | 0.99998 | 3.644959 |
ca30c8da-0011-4091-9c96-6dfa26cb3bbc | ashhere/income_expense | 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 |
cff7d230-1f7e-482b-bca1-cc6c94b9ef3a | subhasish/Algo | 09.BinaryTree/09.KthNodeInTree.cpp | /*
* 09.KthNodeInTree.cpp
*
* Problem: Find kth node in a binary tree, in the order of inorder traversal.
* Assume that each node has number of nodes in the subtree under it.
*
* Created on: Jan 13, 2018
* Author: subha
*/
#include <bits/stdc++.h>
using namespace std;
// Solution: It can be do... | ALGO | 0.999978 | 5.644531 |
5e327f10-f24d-411c-9a4b-96b570a78437 | xrayFan/xray_history | xr_3da/xrGame/detail_path_manager_criteria.cpp | ////////////////////////////////////////////////////////////////////////////
// Module : detailed_path_manager_criteria.h
// Created : 04.12.2003
// Modified : 04.12.2003
// Author : Dmitriy Iassenev
// Description : Detail path manager criteria path builder
///////////////////////////////////////////////////////... | ALGO | 0.996207 | 3.731162 |
dc345398-529d-4ac8-9cf2-14b57f7e12c4 | mohitkadwe19/leetcode-solutions | count-symmetric-integers.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
bool isSymmetric(int x)
{
string s = to_string(x);
int n = s.length() / 2;
string first_half = s.substr(0, n);
string second_half = s.substr(s.length() - n);
int sum_first_half = 0;
int sum_second_half = 0;
for (char... | ALGO | 0.999832 | 6.018579 |
a562e3d5-bcde-4d33-99f6-2b86d4d3374e | AI1379/OILearning | Practices/Training/Competition/SummerVacation/20190723/source/jn02-42_192.168.100.42_陈思翰/twonum.cpp | #include<bits/stdc++.h>
using namespace std;
long long a1,a2,x1,x2,yy1,y2,h1,h2,t,m,ti,w1,w2;
bool a[1001][1001],p=0;
int main(){
freopen("twonum.in","r",stdin);
freopen("twonum.out","w",stdout);
cin>>t;
for(int i=1;i<=t;i++){
cin>>m;
cin>>h1>>a1;
cin>>x1>>yy1;
cin>>h2>>a2;
cin>>x2>>y2;
p=0;
t... | ALGO | 0.999938 | 3.693544 |
dec446e7-e271-4813-b6f8-f77caddc8287 | sugiyem/LeetCode | medium/Longest Substring Without Repeating Characters/Solution.cpp | class Solution {
public:
int lengthOfLongestSubstring(string s) {
unordered_map<char, int> lastLocation;
int start = -1, ans = 0;
for (int i = 0; i < s.length(); i++) {
if (lastLocation.count(s[i])) {
start = max(start, lastLocation[s[i]]);
}
... | ALGO | 0.999938 | 6.540537 |
8197d49c-0090-4423-837b-ff0968ebd49a | winterfell30/LeetCode | 剑指offer/和为S的两个数字.cpp | class Solution {
public:
vector<int> FindNumbersWithSum(vector<int> array,int sum) {
if (array.size() <= 1) return {};
int l = 0, r = array.size() - 1;
vector<int> ans;
while (l < r)
{
if (array[l] + array[r] == sum)
{
ans.push_back(arr... | ALGO | 0.999963 | 5.597707 |
685406c9-7f09-48d2-b32a-02775605b13b | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_3580_4.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int j, i, z = 0, n, a[100005], cnt = 0, s = 0, mx = -1;
cin >> n;
for (int i = 0; i < n; i++) cin >> a[i];
while (z < n) {
i = z;
int rep = 1 + cnt;
for (j = i + 1; j < n; j++)
if (i != j && a[j] == a[i])
rep++, i = j;
el... | ALGO | 0.99993 | 3.806242 |
775f63d5-6974-45b9-9b1c-3976ebfd0a6a | Cyrus2D/SS2D_KickCount | eigen3/doc/examples/tut_arithmetic_dot_cross.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
using namespace std;
int main()
{
Vector3d v(1,2,3);
Vector3d w(0,1,2);
cout << "Dot product: " << v.dot(w) << endl;
double dp = v.adjoint()*w; // automatic conversion of the inner product to a scalar
cout << "Dot product via a matrix product... | ALGO | 0.99914 | 4.042919 |
bc1cd9f1-10b3-48ca-adad-4cd5ae3b0bb8 | wells-wei-wei/smplify-x_in_docker | boost_1_72_0/libs/interprocess/example/doc_move_containers.cpp | int main ()
{
using namespace boost::interprocess;
//Typedefs
typedef managed_shared_memory::segment_manager SegmentManager;
typedef allocator<char, SegmentManager> CharAllocator;
typedef basic_string<char, std::char_traits<char>
,CharAllocator> MySh... | TEST | 0.864089 | 4.882582 |
7e29e62f-2eee-41f0-a377-463c22afdda4 | oiu850714/leetcode2022 | 958-check-completeness-of-a-binary-tree.cpp | #include "headers.hpp"
class Solution {
public:
bool isCompleteTree(TreeNode *Root) {
std::vector<TreeNode *> OldQueue, NewQueue;
size_t NextLevelFullNumber = 2;
OldQueue.push_back(Root);
while (!OldQueue.empty()) {
bool HasSeenNullChild = false;
size_t NextLevelNodeCount = 0;
for ... | ALGO | 0.970171 | 6.557212 |
18abd76a-c924-43d8-9f77-2c544e2ee9e1 | Bits-Coin/bits-coin | src/timedata.cpp | #if defined(HAVE_CONFIG_H)
#include <config/bitscoin-config.h>
#endif
#include <timedata.h>
#include <netaddress.h>
#include <sync.h>
#include <ui_interface.h>
#include <util.h>
#include <utilstrencodings.h>
#include <warnings.h>
static CCriticalSection cs_nTimeOffset;
static int64_t nTimeOffset GUARDED_BY(cs_nTimeO... | TOOL | 0.876677 | 6.485449 |
3ee88722-ed65-4577-afe5-ed4b18fe7bd2 | shakhawatsalam/Phitron_DSA_Shakhawat | Introduction to Data-Structure/Module-03/binary_search.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
int a[n];
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
int x;
cin >> x;
int l = 0;
int r = n - 1;
bool flag = false;
while (l <= r)
{
int mid = (l + r) / 2;
if (a[mid] ... | ALGO | 0.999898 | 5.024934 |
bccc3b3d-ac76-4e72-9f96-099b55857748 | vinniefalco/DSPFiltersDemo | JUCEAmalgam/include/juce_gui_extra_amalgam.cpp | #define JUCE_AMALGAMATED_INCLUDE 1
#if !defined(__APPLE__) || defined(__OBJC__)
/*** Start of inlined file: juce_gui_extra.cpp ***/
#if defined (__JUCE_GUI_EXTRA_JUCEHEADER__) && ! JUCE_AMALGAMATED_INCLUDE
/* When you add this cpp file to your project, you mustn't include it in a file where you've
already included a... | TOOL | 0.862204 | 3.982935 |
075598bc-b6a5-43db-88ca-e2e565dca36f | pratikwayal01/CP-Solutions | 1071-greatest-common-divisor-of-strings/1071-greatest-common-divisor-of-strings.cpp | class Solution {
public:
string gcdOfStrings(string str1, string str2) {
if (str1 + str2 != str2 + str1) {
return "";
}
int gcdLength = gcd(str1.size(), str2.size());
return str1.substr(0, gcdLength);
}
}; | ALGO | 0.999935 | 6.264654 |
9c635ca9-d712-4366-971f-52014778e44f | PagalavanPagal66/Leetcode_Solutions | 0934-shortest-bridge/0934-shortest-bridge.cpp | class Solution {
public:
int arr[5]={0,1,0,-1,0};
void dfs(int i,int j,vector<vector<int>>& grid,queue<pair<int,int>>& q){
int m=grid.size();
int n=grid[0].size();
if(i<0 || i==m || j<0 || j==n || grid[i][j]!=1) return;
grid[i][j]=2;
q.push({i,j});
for(int k=0;k<4;k++){
dfs(i+arr[k],j+ar... | ALGO | 0.999959 | 5.883934 |
d08d156e-2f65-40b2-a274-8337fe142629 | JingyuanZhou/Issac_Quadruped_Simulation | extern/eigen3/doc/examples/TutorialLinAlgSelfAdjointEigenSolver.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix2f A;
A << 1, 2, 2, 3;
cout << "Here is the matrix A:\n" << A << endl;
SelfAdjointEigenSolver<Matrix2f> eigensolver(A);
if (eigensolver.info() != Success) abort();
cout << "The eigenvalues of A ... | ALGO | 0.999511 | 3.836841 |
038fd063-32b1-4489-b419-9402279bb5f6 | StevenDunn/CodeEval | PokerHands/cpp/ph.cpp | // poker hands cpp soln for code eval by steven a dunn
#include <algorithm>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
using std::copy;
using std::count;
using std::cout;
using std::endl;
using std::ifstream;
using std::istringst... | ALGO | 0.999401 | 5.490962 |
12d468e3-06c6-4023-be48-023bb9b84f9d | chenchen-cs/oj | 单链表.cpp | #include<stdio.h>
#include<malloc.h>
#include<stdlib.h>
typedef struct Node
{
int data;
struct Node *pNext;
}NODE,*PNODE;
PNODE create_list() //创造链表函数
{
int len;//用来存放有效节点的个数
int val;//用来临时存放用户输入的节点的值
//分配了一个不存放有效数据的头结点
PNODE pHead=(PNODE)mallo... | ALGO | 0.999967 | 3.686254 |
3f4a64d1-00df-4885-8d37-81bb185a760a | ctk0418/data_static | src/4/7-2.cpp | #include <windows.h>
#include <math.h>
#include <stdio.h>
#include <malloc.h>
#include <c:\\simulated_book\\include_dll\\DLL_function_type.cpp>
double dividewangxx=(double)32767*(double)32767*(double)32767;
double uniform_simulated(double alpha,double beta)
{
double tep1,tep=0,dividewangx;
again:
tep1=((doub... | ALGO | 0.999697 | 3.529342 |
24b36d7e-41b9-4816-9dba-1047886a8a28 | innekuk/beakjoon | code/1107.cpp | #include<iostream>
#include<algorithm>
using namespace std;
int check(int val, int * brokenbutton);
int main(){
int n;
int brokenbutton[10] = {0};
int min,max;
int cnt;
scanf("%d" , &n);
int a;
scanf("%d" , &a);
for (int i =0; i<a; i++){
int b;
scanf("%d", &b);
brokenbutton[b] = 1;
}
cnt = abs(n-100)... | ALGO | 0.999587 | 3.110997 |
e0ebd614-3e49-4d9f-b582-a724c96331e7 | naveenkm21/LeetCode_DSA | 0219-contains-duplicate-ii/0219-contains-duplicate-ii.cpp | class Solution {
public:
bool containsNearbyDuplicate(vector<int>& nums, int k) {
unordered_set<int> window;
for (int i = 0; i < nums.size(); i++) {
if (window.count(nums[i])) return true;
window.insert(nums[i]);
if (window.size() > k) {
window.e... | ALGO | 0.999797 | 6.456809 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.