uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
1a10b5aa-642c-40c0-ab15-367830630202 | QIDITECH/QIDISlicer | sandboxes/its_neighbor_index/main.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <tuple>
#include <random>
#include "ItsNeighborIndex.hpp"
#include "libnest2d/tools/benchmark.h"
#include "libnest2d/utils/metaloop.hpp"
namespace Slic3r {
enum { IndexCreation, Split };
struct MeasureResult
{
static constexpr const char * Names[... | ALGO | 0.975925 | 6.199203 |
81e6c87b-eb54-41f2-9e45-ca504d385ec5 | asr053/LeetCode-Solutions | 1004-max-consecutive-ones-iii/1004-max-consecutive-ones-iii.cpp | class Solution {
public:
int longestOnes(vector<int>& nums, int k) {
int res = 0;
queue<int>q;
for(int i=0;i<nums.size();i++){
if(nums[i]==0){
if(q.size()==k+1){q.pop();}
q.push(i);
}
if(q.size()==k+1){res=max(res,i-q.front(... | ALGO | 0.999979 | 6.035033 |
c2196969-6776-4386-a5c5-98dd2537954a | ishandutta2007/codeforces | deemo/normal/932/D.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
const ll MAXN = 5e5 + 10;
const ll LOG = 20;
const ll INF = 1e17;
ll n = 1, w[MAXN], par[MAXN][LOG], sm[MAXN][LOG];
ll getFirstPar(ll v, ll p){
if (w[p] >= w[v])
return p;
for (ll ww = LOG-1; ~ww; ww--)
if (... | ALGO | 0.999913 | 4.03978 |
67fc0a06-80c1-4cc0-855f-1302cf91b02e | bsorav/llvm-project2 | libc/src/math/ceilf.cpp | #include "src/__support/common.h"
#include "utils/FPUtil/NearestIntegerOperations.h"
namespace __llvm_libc {
float LLVM_LIBC_ENTRYPOINT(ceilf)(float x) { return fputil::ceil(x); }
} // namespace __llvm_libc
| ALGO | 0.97605 | 5.38615 |
dd5efa32-db76-4dc3-8e4f-b8de10ca878e | Nouman-Usman/Class-Work | Week 05/Lab/task12.cpp | #include <iostream>
#include <cmath>
using namespace std;
bool issymmetrical(int number);
main()
{
int number;
cout <<"Enter 3 digit number:";
cin>>number;
issymmetrical(number);
}
bool issymmetrical(int number){
int num1,num2,num3;
num1=number%10;
number=number/10;
num2=number%10;
number=number/10;
num3=number%10;
... | ALGO | 0.999537 | 4.263127 |
7018aedd-2fa4-4c01-aac8-17f6a245243f | Kumarrajbogireddy29/C-language | arm strong or not arm strong.cpp | #include<stdio.h>
int main()
{
int n,r,sum=0,temp;
printf("enter the number=r");
scanf("%d",&n);
temp=n;
while(n>0)
{
r=n%10;
sum=sum+(r*r*r);
n=n/10;
}
if (temp==sum)
printf("arm strong number");
else
printf("not arm strong number");
return o;
}
| ALGO | 0.999924 | 3.711143 |
753a9c2a-d2a6-421f-825c-4d2527439969 | abhishek201202/competitive-programming | Solution/Atcoder/c.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
template<class T1, class T2> ostream &operator<<(ostream &os, const pair<T1,T2> &p){ os << '{' << p.first << ", " << p.second << '}'; return os;}
template<typename C,t... | ALGO | 0.999869 | 4.512385 |
28b76729-b945-4e1f-abc2-e1c9e7d54c1b | bsc-mem/Mess-Paraver | libs/boost_1_79_0/doc/html/boost_asio/example/cpp03/http/server4/request_parser.cpp | #include "request_parser.hpp"
#include <algorithm>
#include <cctype>
#include <boost/lexical_cast.hpp>
#include "request.hpp"
namespace http {
namespace server4 {
// Enable the pseudo-keywords reenter, yield and fork.
#include <boost/asio/yield.hpp>
std::string request_parser::content_length_name_ = "Content-Length"... | WEB | 0.851869 | 5.997179 |
2e8c7a0e-0bbf-44b6-b0c8-f022892f59a0 | Tahsin-Zaman-Jilan/Codeforce-Solutions-By-ZIlanJaman | pract.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxm=1e7+10;
bool mark[maxm];
void sieve(){
for(int i=2;i*i<=maxm;i++){
if(mark[i]){
continue;
}
for(int j=i+i;j<maxm;j++){
mark[i]=true;
}
}
}
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
f... | ALGO | 0.997704 | 3.216065 |
0f6e3931-0abe-41f0-ba8c-3c194032e325 | iamtasir/Competitive-programming | 2021/july/L_M.cpp | ///* ***Bismillahir Rahmanir Rahim*** */
/*
Algorithm Used:
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double dl;
typedef unsigned long long ull;
#define pb push_back
#define eb emplace_back
#define PB pop_back
#define nn "\n"
#define O_O \
... | ALGO | 0.999828 | 4.208725 |
9e453818-4f92-495d-ac2c-7f18c55b77bd | AvatarSenju/Competitive | cpp/CCL-EVENM.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define rep(i, a, b) for (i = a; i < b; i++)
#define repr(i, a, b) for (i = a; i >= b; i--)
#define F first
#define S second
#define p_b push_back
#define m_p make_pair
#define all(a) (a).begin(), (a).end()
void solve(... | ALGO | 0.999867 | 3.852503 |
22fc9403-b77e-4d59-a730-7137fca99899 | VikramBabariya/DSA | DP/DP on Strings/longest common subsequenc(lcs).cpp | #include<bits/stdc++.h>
int lcsHelp(int ind1, int ind2, string &s1, string &s2, vector<vector<int>> &dp){
if(ind1 < 0 || ind2 < 0) return 0;
if(dp[ind1][ind2] != -1) return dp[ind1][ind2];
if(s1[ind1] == s2[ind2]){
return dp[ind1][ind2] = 1 + lcsHelp(ind1-1, ind2-1, s1, s2, dp);
}
int pos1 = lcsHelp(ind1-... | ALGO | 0.999882 | 4.761761 |
c1e7ffb9-60be-4587-953f-5a8cb150f736 | magicdog/algorithm | stringmatch/main.cpp | #include <iostream>
#include <string>
using namespace std;
bool isMatch_genaral(string Source, string match);
bool isMatch_number(string Source, string match);
bool isMatch_status(string Source, string match);
bool isMatch_kmp(string Source, string match);
int main()
{
string SourceString = "abbbaabaca";
string Ma... | ALGO | 0.999365 | 3.913278 |
26c972ed-63d3-45dd-a69a-ef2a10cad66e | thisisshub/HacktoberFest | cpp/rabin-karp.cpp | /* Following program is a C++ implementation of Rabin Karp
Algorithm given in the CLRS book */
#include <bits/stdc++.h>
using namespace std;
// d is the number of characters in the input alphabet
#define d 256
/* pat -> pattern
txt -> text
q -> A prime number
*/
void search(char pat[], char txt[], int... | ALGO | 0.999978 | 5.96033 |
7f580e89-91ce-43e7-9ebb-fa664f20f855 | csuyangpeng/ros_src | src/opencv3/opencv_contrib/tracking/src/unscented_kalman.cpp | #include "precomp.hpp"
#include "opencv2/tracking/kalman_filters.hpp"
namespace cv
{
namespace tracking
{
void UnscentedKalmanFilterParams::
init( int dp, int mp, int cp, double processNoiseCovDiag, double measurementNoiseCovDiag,
Ptr<UkfSystemModel> dynamicalSystem, int type )
{
... | ALGO | 0.998404 | 6.073445 |
ccc528c6-9d41-4950-997e-55f2a095a9f3 | Manpreet-2002/Interview-Prep | DP/LCS/minNoOfInsertionDeletion.cpp | #include <bits/stdc++.h>
using namespace std;
pair<int, int> func(string x, string y)
{
int n = x.length();
int m = y.length();
int t[n + 1][m + 1];
for (int i = 0; i < n + 1; i++)
{
for (int j = 0; j < m + 1; j++)
{
if (i == 0 || j == 0)
{
t[... | ALGO | 0.999994 | 4.765007 |
313ec0aa-7f2f-4fa2-9999-e2d53606a38f | The-No-Hands-company/RudeBase3D | third_party/libigl/libigl-2.5.0/include/igl/planarize_quad_mesh.cpp | namespace igl
{
template <typename DerivedV, typename DerivedF>
class PlanarizerShapeUp
{
protected:
// number of faces, number of vertices
long numV, numF;
// references to the input faces and vertices
const Eigen::MatrixBase<DerivedV> &Vin;
const Eigen::MatrixBase<DerivedF> &Fin;
... | ALGO | 0.998962 | 4.725152 |
858a56a1-2258-4378-b2e2-bab50eac8af3 | medranSolus/study_archive | PP/Laboratorium2.cpp | /*
Autor: Marek Machliski
Grupa: WTN 7:30
Temat: Laboratorium 2
Data: 10 padziernika 2017 r.
*/
#include <iostream>
#include <cmath>
#include <iomanip>
#include <climits>
#include <ctime>
#include <cstdlib>
using namespace std;
void minMaxRandom();
void minMax();
void chain();
void table(double min, double max, unsig... | ALGO | 0.994455 | 4.36991 |
d9e4cc6e-a423-40fa-b144-bee519d24ffa | Thyme0113/astnn_with_semi-supervised_learning | ssl_750/data/src/gcd/recursive50.cpp | int gcd(int x, int y) {
return y ? gcd(y, x % y) : x;
}
int main() {
int a, b;
scanf("%d %d", &a, &b);
printf("%d\n", gcd(a, b));
return 0;
}
| ALGO | 0.999641 | 4.816175 |
9a24d6cc-e2ac-4764-9233-61d5d64f3c12 | sanjaydraws/DatastrucureAndAlogorithms | Tree/easy_0110_balanced_binary_tree.cpp | class Solution {
public:
// Helper function to calculate the height of the tree
int height(TreeNode* root) {
// Base case: empty subtree has height 0
if (root == nullptr) return 0;
// Recursively calculate the height of left and right subtrees
return max(height(root->left), hei... | ALGO | 0.999982 | 7.477258 |
7218b4bb-02c6-45fb-b8d9-32f0dcf8a570 | Richard-m-j/LeetCode | 228-SummaryRanges/228-SummaryRanges.cpp | // Last updated: 7/24/2025, 8:32:37 AM
class Solution {
public:
vector<string> summaryRanges(vector<int>& nums) {
if(!nums.size())
return {};
vector<string> res;
int start = nums[0],end = nums[0];
for(int i=1;i<nums.size();i++){
if(nums[i]==end+1){
... | ALGO | 0.999933 | 6.692621 |
99730516-1588-40c7-bf4a-c56927f1a4fc | Noymul-Islam/problems | shamim.cpp | #include <stdio.h>
int main()
{
long int a,b,i,j,k,res;
while(scanf("%ld %ld",&a,&b)==2 )
{
if(a==0 && b==0)
break;
if(b>a/2)b=a-b;
res=1;
for(i=a,j=1;i>b,j<=b;i--,j++){
res=res*i;
res=res/j;
}
printf("%ld\n",res);
}
return 0;
}
| ALGO | 0.999951 | 3.443094 |
d829ebc4-3056-4763-a5ad-ec656b9ea671 | alexandraback/datacollection | solutions_1482494_0/C++/minus9d/b2.cpp | #include <cstdio>
#include <vector>
#include <deque>
#include <queue>
#include <map>
#include <algorithm>
#include <functional>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
typedef struct { int star; int level; } data_t;
class comp{
public:
bool operator()(const data_t& l, const da... | ALGO | 0.99933 | 4.189209 |
ebb48335-608b-4a45-8a94-3cdca6dae278 | sgolodetz/hesperus2 | source/engine/core/hesp/math/geom/UniquePlanePred.cpp | #include "UniquePlanePred.h"
#include <cmath>
#include "Plane.h"
namespace hesp {
//#################### CONSTRUCTORS ####################
UniquePlanePred::UniquePlanePred(double angleTolerance, double distTolerance)
: m_angleTolerance(fabs(angleTolerance)), m_distTolerance(fabs(distTolerance))
{}
//##############... | ALGO | 0.893818 | 6.73963 |
624966b6-3650-4036-9e61-42006c2632bb | Muskan2512/CP-Problems | Day7/cp3.cpp | #include<iostream>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
int N=n/2;
int evensum=0,oddsum=0;
if((N & 1)!=0){
//odd aa raha
cout<<"NO"<<endl;
}
else{
cout<<"YES"<<endl;
for(int i=2;i<=n;i+=2){
cout<<i<<" ";
eve... | ALGO | 0.999864 | 4.348231 |
c8704abf-e83b-4a24-8a03-ad640e71c324 | babirms/estudos_ED | Lista 4/funcao_merge.cpp | #include <stdio.h>
int vetor[8] = {5,7,8,9,1,3,6,11};
// estudando Merge
void Merge(int A[],int e,int meio,int d){
int i = 0; // percorre a primeira metade
int j = meio+1; // percorre a segunda metade
int k = 0; // percorre a lista auxiliar
int C[d+1];
// percorrer as duas metades ao mesmo tempo
while... | ALGO | 0.99997 | 5.077365 |
9964ec32-beb7-4123-9881-e4345d445bbc | vishalkandu01/leetcode_solution | 1884-minimum-changes-to-make-alternating-binary-string/minimum-changes-to-make-alternating-binary-string.cpp | class Solution {
public:
int minOperations(string s) {
int n = s.size();
int countForAlternate_0 = 0;
int countForAlternate_1 = 0;
for(int i = 0; i < n; i++) {
if(i % 2 == 0) {
if(s[i] == '0') {
countForAlternate_1 += 1;
... | ALGO | 0.999977 | 6.047847 |
cf6eaa53-5b89-47d7-8401-8a347a652d50 | lcbcFoo/coding-competitions | codeforces/rounds/r785/p4/p4.cpp | #include <functional>
#include <iostream>
#include <map>
#include <utility>
#include <vector>
#include <set>
#include <algorithm>
#include <numeric>
#include <bits/stdc++.h>
#define DEBUG
#ifdef DEBUG
#include "../../../../debug.hpp"
#else
#define dbg(...)
#endif
#define ll long long int
#define ull long long int
... | ALGO | 0.999596 | 4.313342 |
aeadbb1a-a769-4ff5-a437-ba325d9570fc | depuilln/MonteCarlo | TP1/src/TP1.cpp | #include "pnl/pnl_random.h"
#include "pnl/pnl_mathtools.h"
#include "pnl/pnl_vector.h"
#include "pnl/pnl_specfun.h"
#include <iostream>
#include <cmath>
#include <math.h>
void brownien(PnlVect* g, PnlVect* gPrime, double N, double T, PnlRng* rng){
pnl_vect_rng_normal(g, N, rng);
double ecart = sqrt(T/N);
p... | ALGO | 0.999754 | 5.124073 |
7795cbb2-8c90-45fb-a176-febe4175e37c | 2605govind/Data_Structure_And_Algorithms- | Day 5/linkedlist_Tree.cpp | // Linked list and tree both combination data structure implement by ~ Govind Suthar
#include<bits/stdc++.h>
using namespace std;
// Template for (TreeNode)
class TreeNode {
public:
int data;
TreeNode *left, *right;
TreeNode(int x) {
data = x;
left = right = NULL;
}
};
// Template for... | ALGO | 0.999845 | 4.964127 |
606072f4-0bd6-474d-8c23-14aa1c10cbee | luckydoglzh/luckydsolzh.github.io | c++study/常见算法实现/sorting/递归选择排序.cpp | /**
* @file
* @brief 使用递归实现的 [选择排序](https://en.wikipedia.org/wiki/Selection_sort)
* @details
* 选择排序算法将输入列表分为两部分:已排序的子列表(从左到右构建)和剩余的未排序项。
* 初始时,已排序的子列表为空,未排序的子列表是整个输入列表。
* 算法通过在未排序的子列表中找到最小(或最大)元素,并将其与最左边的未排序元素交换,
* 然后将子列表的边界向右移动一个元素。
*
* ### 实现
* FindMinIndex
* 该函数通过递归找到数组(列表)的最小元素,方法是将数组大小减少1,并将其与数组的最后一个元素进... | ALGO | 0.999994 | 6.957316 |
ebc1c9db-0ef6-4272-84eb-5ab7ab417546 | FaceAR/OpenFaceIOS | FaceAR_SDK_IOS_OpenFace_RunFull/lib/local/GazeEstimate/GazeEstimation.cpp | // * Any publications arising from the use of this software, including but
// not limited to academic journal and conference publications, technical
// reports and manuals, must cite at least one of the following works:
//
// OpenFace: an open source facial behavior analysis toolkit
// Tadas... | ALGO | 0.998441 | 5.009571 |
3e18d89c-c3ac-4540-a517-6657ee1a2999 | h3136514/Algorithm | baekjoon/알고리즘기초/정렬/10817.cpp | #include<cstdio>
#include<algorithm>
using namespace std;
int num[3], i;
int main(){
for(i=0; i<3; i++){
scanf("%d", &num[i]);
}
sort(num, num+3);
printf("%d\n",num[1]);
return 0;
} | ALGO | 0.999967 | 3.74654 |
bead805a-f14d-4960-8d84-8f882e571717 | alexandraback/datacollection | solutions_1483488_1/C++/ReiraCofage/C.cpp | #include <cstdio>
#include <cstring>
using namespace std;
int T, A, B, C=1;
int dezna[12];
int digs(int n) {
return (n==0 ? 0 : 1 + digs(n/10) );
}
int main() {
dezna[0] = 1;
for (int i=1;i<12;i++)
dezna[i] = 10*dezna[i-1];
for(scanf("%d",&T);T--;) {
scanf("%d %d",&A,&B);
i... | ALGO | 0.999418 | 4.150912 |
29a12654-9ee5-43f6-87e7-bc1e6b24720f | harshpreet07/CP-Graph | Week 1/binsearch.cpp | #include<iostream>
using namespace std;
int solve(int a[],int x,int start,int high){
if(high<start){
return -1;
}
int mid=(high+start)/2;
if(a[mid]==x){
return mid;
}
if(x<a[mid]){
return solve(a,x,start,mid-1);
}
if(x>a[mid]){
return solve(a,x,mid+1,high... | ALGO | 0.999891 | 4.860623 |
b83d2c7f-d2be-439e-8056-e19a71e01ef2 | khalid52/079_201123 | selfdrive/controls/lib/lateral_mpc/generator.cpp | #include <acado_code_generation.hpp>
#define PI 3.1415926536
#define deg2rad(d) (d/180.0*PI)
const int controlHorizon = 50;
using namespace std;
int main( )
{
USING_NAMESPACE_ACADO
DifferentialEquation f;
DifferentialState xx; // x position
DifferentialState yy; // y position
DifferentialState psi; // v... | ALGO | 0.999224 | 4.976051 |
e0bb7182-bd73-443b-89d5-55b853bf97fb | akshayupadhyay008/CpTemplate1 | cp1-part1/cp23.cpp | #include <bits/stdc++.h>
using namespace std;
// #pragma GCC target ("avx2")
// #pragma GCC optimize ("O3")
// #pragma GCC optimize ("unroll-loops")
#define ill int long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define MP make_pair
// #define fo(i,k,n) for(ill i=k;i<n;i++... | ALGO | 0.999772 | 4.57516 |
fe065a3f-b39c-4e55-9969-0546af3e39f8 | mingjun97/Introduction-to-algorithm-test | LinerFind/LinerFind.cpp | // LinerFind.cpp : ̨Ӧóڵ㡣
//
#include "stdio.h"
int LinerFind(int A[], int Target, int sPos, int ePos);
int main()
{
int A[] = { 5,8,5,8,5,2,5,1,4,3,4,3,4,2,6,1,2,6,1,5 };
int pos = -1;
int startPos = 0;
do {
startPos = pos + 1;
pos = LinerFind(A, 5,startPos , sizeof(A) / sizeof(int));
printf("%d \n", pos);
... | ALGO | 0.999468 | 4.663808 |
8340d758-d1df-451e-acdc-de1c258f15be | nkvelkov/UP2014 | exams/usten/zad9.cpp | #include <iostream>
using namespace std;
bool monot(int* a, int n, int k)
{
//bool flag = true;
for (int i = 0; i < k*n; i += 2*n)
{
for (int j = i + 1; j < i + n; j++)
{
if (a[j] <= a[j -1]) return false;
}
for (int j = i + n + 1; j < i + 2*n && j < k*n;... | ALGO | 0.999859 | 3.194059 |
8080b9b6-1773-4b68-8349-c04f591530b3 | cicada44/sibsutis | 2sem/saod/lab1/sort.cpp | #include <sys/time.h>
#include <cassert>
#include <iostream>
template <typename T>
size_t partition(T* arr, int low, int high) {
size_t pivot = arr[high];
size_t i = (low - 1);
for (int j = low; j <= high - 1; ++j) {
if (arr[j] < pivot) {
i++;
std::swap(arr[i], arr[j]);
}
}
std::swap(a... | ALGO | 0.999679 | 4.881563 |
eba6596a-2ebc-490d-aeb1-33df3979c650 | darkinfusion/frameworks-av | media/libstagefright/codecs/amrnb/common/src/div_s.cpp | /*
Pathname: ./gsm-amr/c/src/div_s.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Created separate file for the div_s function. Sync'ed up
with the current template and fixed tabs.
Description: Making changes based on review meeting.
Des... | ALGO | 0.999748 | 5.689935 |
2692e1a3-bd65-41bc-b113-f0d7deb5e67b | qicheng888/CppGym | 回溯/subsets_backtracking.cpp | /*
* 问题: 子集
*
* 给定一个整数数组 nums,数组中的元素互不相同,返回该数组所有可能的子集(幂集)。
*
* 示例 1:
* 输入: nums = [1, 2, 3]
* 输出: [[], [1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3]]
*
* 示例 2:
* 输入: nums = [0]
* 输出: [[], [0]]
*/
#include <vector>
class Solution {
public:
std::vector<std::vector<int>> subsets(std::vector<int>& n... | ALGO | 0.999478 | 6.738755 |
7f18d389-53c1-4ad4-80d2-82bb8938fe34 | Fighohji/Competitive-Programming | Record/PassRecord/ZJNU9.19/G.cpp | #include <map>
#include <set>
#include <array>
#include <cmath>
#include <queue>
#include <stack>
#include <tuple>
#include <bitset>
#include <cctype>
#include <cstdio>
#include <random>
#include <string>
#include <vector>
#include <cassert>
#include <cstring>
#include <iomanip>
#include <limits.h>
#include <iostream>
... | ALGO | 0.999979 | 4.713106 |
aac65ca1-04a5-4746-a43d-bdb0de7c24e7 | abdirakhman/Olymp | Codeforces Archive/149E/main.cpp | /**
SXR0aXAkI0JwbXptI3FhI3Z3I293bCNqY2IjUG0jMCNicG0jVHFkcXZvLyNCcG0jQW10bjBhY2phcWFicXZvLyNNYm16dml0MSNWdyNhdGN1am16I2tpdiNhbXF9bSNQcXUjVnd6I0F0bW14MSNQcWEjaXptI2l0dCNicHF2b2EjUXYjYnBtI3BtaWRtdmEjaXZsI3d2I21pemJwMSNFcHcjcWEjYnBtem0ja2l2I3F2Ym16a21sbSNRdiNQcWEjeHptYW12a20jbXtrbXhiI0lhI3BtI3htenVxYmJtYnBHI1BtI3N2d2VtYnAj... | ALGO | 0.999906 | 4.222483 |
e8dab46d-29f7-4c3e-ae89-0767334c193c | geoffrey-anto/leetcode-solutions | 1562-people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list/solution.cpp | #define it(a) begin(a), end(a)
class Solution {
public:
vector<int> peopleIndexes(vector<vector<string>>& f) {
unordered_map<string, int> map;
int val = 0;
int n = f.size();
vector<vector<int>> com(n);
for(int i=0; i<n; i++) {
for(auto &j: f[i]) {
... | ALGO | 0.999978 | 5.485225 |
5d471dfb-925e-4922-b45a-ad76eede9a5a | sulabhmatele/Highway-Path-Planning_SelfDrivingCar_Term3_P1 | src/Eigen-3.3/doc/snippets/Tutorial_solve_triangular.cpp | Matrix3f A;
Vector3f b;
A << 1,2,3, 0,5,6, 0,0,10;
b << 3, 3, 4;
cout << "Here is the matrix A:" << endl << A << endl;
cout << "Here is the vector b:" << endl << b << endl;
Vector3f x = A.triangularView<Upper>().solve(b);
cout << "The solution is:" << endl << x << endl;
| ALGO | 0.999593 | 3.045018 |
96a4cb89-a6a9-4f40-a8bd-10682c2207ae | Qiti0/codeforces | 狼狼的备忘录.cpp | #include <bits/stdc++.h>
using namespace std;
const int mod = 1e9+7;
const double pi = acos(-1.0);
const int N = 2e5 + 10;
typedef long long ll;
typedef pair<int,int> pii;
inline int lowbit(int x) {return x & (- x);}
struct bwl
{
string name;
int len;
string s[20];
bool operator < (const bwl x) const{... | ALGO | 0.99953 | 3.732653 |
6540efe9-5106-4635-8c53-5c199bf83d1e | liangkang233/leetcode-cpp | 338.比特位计数.cpp | /*
* @lc app=leetcode.cn id=338 lang=cpp
*
* [338] 比特位计数
*/
#include <vector>
#include <iostream>
using namespace std;
// @lc code=start
// O(n) 遍历生成
class Solution {
public:
void mydfs(vector<int>& ans, const int& n, int now, int count, int N) { // now为当前遍历值 N代表位数
if(N == 0) {
if(now <= n... | ALGO | 0.999974 | 7.003952 |
047bc246-b73e-44d6-94b8-22395f8ba3de | DeepBBak/HW | Lotto/Lotto/Lotto.cpp |
#include "pch.h"
#include <iostream>
#include"LottoMachine.h"
int main()
{
LottoAMchine LT;
int n;
cout << "몇게임 하시겠습니까?(최대 5 게임) : ";
cin >> n;
LT.GiveNumber(n);
}
| TOOL | 0.879407 | 3.568579 |
2951bdc7-f7ad-4542-bdf2-ecadaffadfc7 | AkashSaraf-16/DSA | 0190-reverse-bits/0190-reverse-bits.cpp | class Solution {
public:
uint32_t reverseBits(uint32_t n) {
uint32_t res=0;
for(int i=0;i<32;i++){
// left shifting it because in the next itertaion we have to consider the next bit
res<<=1;
if(n&1)
res++;
n>>=1;
}
retur... | ALGO | 0.999967 | 5.761908 |
a2eca41b-1e56-45ff-8aea-f171772f08de | access-softek/llvm-project-dil | llvm/lib/CodeGen/BasicBlockSections.cpp | #include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/CodeGen/BasicBlockSectionUtils.h"
#include "llvm/CodeGen/BasicBlockSectionsProfileReader.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/... | TOOL | 0.9726 | 5.3745 |
101ca913-d40e-49b6-bb7f-a43d82e7d9dd | raghav161/Leetcode | 2503-longest-subarray-with-maximum-bitwise-and/2503-longest-subarray-with-maximum-bitwise-and.cpp | class Solution {
public:
int longestSubarray(vector<int>& nums) {
int maxi=*max_element(nums.begin(), nums.end()), ans=0, count=0;
for(int i=0;i<nums.size();i++)
{
if(nums[i]==maxi)
count++;
else
count=0;
ans=max(ans, count)... | ALGO | 0.999901 | 5.632971 |
08dd679a-b704-4db6-8048-a9d95d841652 | vedmukherjee15/placement | Recursion/sumofdigits.cpp | #include<bits/stdc++.h>
using namespace std;
int sum(int n)
{
if(n==0)
return 0;
int d = n/10;
int r = n%10;
return r+sum(d);
}
int main()
{
int n;
cin>>n;
cout<<sum(n);
return 0;
} | ALGO | 0.999719 | 4.018571 |
dd21d25d-31fa-4fd7-88f3-02a8fa2b778e | david-perez/competitive-programming | UVa/000352.cpp | #include <iostream>
using namespace std;
int N;
int grid[25][25];
int dr[] = {1,1,0,-1,-1,-1,0,1};
int dc[] = {0,1,1,1,0,-1,-1,-1};
int floodfill(int r, int c) {
if (r < 0 || r >= N || c < 0 || c >= N) return 0;
if (grid[r][c] != 1) return 0;
int ans = 1;
grid[r][c] = 0;
for (int d = 0; d < 8; d... | ALGO | 0.995513 | 4.12395 |
b98246a1-312a-493a-b53e-458c283360b4 | Laharika28/LeetCode-Self-Solutions | 0783-minimum-distance-between-bst-nodes/0783-minimum-distance-between-bst-nodes.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.999983 | 6.458276 |
e1d1a24d-85e1-4b31-9c23-9741bd150ea7 | Cheonilyeong/Baekjoon-Programmers | 프로그래머스/0/181914. 9로 나눈 나머지/9로 나눈 나머지.cpp | #include <bits/stdc++.h>
using namespace std;
int solution(string number) {
int sum = 0;
for(char c : number)
sum += c - '0';
return sum % 9;
} | ALGO | 0.999647 | 5.300124 |
2ebce2d1-6917-441d-a13b-a46c87d0b3e3 | MinhPhuc2k3/CODE-PTIT | DSA03016.cpp | //Le Minh Phuc CN02
#include <bits/stdc++.h>
#define all(x) x.begin(),x.end()
using namespace std;
const int mod=1e9+7;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
int main()
{
std::ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t;
cin>>t;
whil... | ALGO | 0.999474 | 5.139212 |
99f3f2d8-271f-44b3-8933-06f0e69661f5 | sxyugao/Codes | Luogu/P2704/P2704.cpp | #include <cstdio>
#include <iostream>
using namespace std;
const int N = 105;
const int M = 10;
int n, m, tot, s[1 << M], cnt[1 << M];
char str[M];
int a[N], f[2][1 << M][1 << M];
void init(int k, int t, int num) {
if (k > m) return (void)(s[++tot] = t, cnt[tot] = num);
init(k + 1, t << 1, num);
if (t & 1 || (t >... | ALGO | 0.999819 | 3.749269 |
6be30020-c0c8-4d42-a8a1-2d93ca0e9fd0 | HHS-Proclub/hhs-pro-club-website | solutions2020/PRB10/ashwisp@gmail.com.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <list>
using namespace std;
struct Coord
{
int x;
int y;
};
bool comp(Coord a, Coord b)
{
return a.x < b.x;
}
int main()
{
long long int N;
cin >>... | ALGO | 0.999961 | 3.879225 |
1c688730-bbeb-4e18-a8cd-87a7e5062cac | ishandutta2007/codeforces | kude/normal/1593/D1.cpp | #include<bits/stdc++.h>
using namespace std;
#define rep(i,n)for (int i = 0; i < int(n); ++i)
#define rrep(i,n)for (int i = int(n)-1; i >= 0; --i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
template<class T> void chmax(T& a, const T& b) {a = max(a, b);}
template<class T> void chmin(T... | ALGO | 0.999948 | 4.314526 |
9f1e4da1-b4ff-4061-8376-f3cbb0bb982c | Auburngrads/SMRD | src/WQMMLESSS_wqm_mlboth_wqm_mlfit_wqm_upck.cpp | #include <base/base.hpp>
//' Untransform (antilog) fitted values, residuals,
//' and quantile estimates with a check.
//'
//' We have small and big here to limit the size of
//' the fitted value by distribution
double wqm_upck(double y,
int kdist){
Rcpp::NumericVector big = Rcpp::NumericVec... | ALGO | 0.998837 | 5.840139 |
0da4e80c-463b-4f95-a84a-389c2c1900d6 | MAA1117/DSA | euler_project/euler26_findPeriod_012824.cpp | // Problem: https://projecteuler.net/problem=26
/*
Find the value of d < 1000 for which 1/d contains the longest recurring cycle
in its decimal fraction.
*/
#include <iostream>
#include <cstdint>
#include <algorithm> // std::__gcd()
typedef uint64_t UI64;
UI64 findPeriod(UI64 numerator, UI64 denominator){
UI64 g... | ALGO | 0.999027 | 6.442059 |
b6bef8d0-8111-4bd0-8cc6-9f48614233af | ArtoriasKein/cpp-search-server | search-server/string_processing.cpp | #include "string_processing.h"
using namespace std;
vector<string_view> SplitIntoWords(string_view text) {
vector<string_view> result;
text.remove_prefix(min(text.find_first_not_of(" "), text.size()));
while (!text.empty()) {
size_t position_first_space = text.find(' ');
string_view tmp_sub... | ALGO | 0.926673 | 4.563542 |
5bba4728-76b5-4766-bdcc-f4640d768312 | alexandraback/datacollection | solutions_1595491_1/C++/DuDa/duda_1_0.cpp | #include <cstdio>
#include <cstdlib>
#include <algorithm>
#define MAX 100
#define SWAP(x,y) {int t; t = x; x = y; y = t;}
using namespace std;
void quick_sort(int *array,int low,int high) {
int pivot_point,pivot_item,i,j,temp;
if(high<=low){return;}
pivot_item = array[low];
j=low;
fo... | ALGO | 0.999687 | 3.317715 |
acf74a4c-7184-4740-9b13-5a6a33b3a661 | AnkitRajCode/MyCodes | ApniKasha/functions/Coeff.cpp | #include <iostream>
#include <math.h>
using namespace std;
int factorial(int num){
int mult =1;
for(int i=num; i>=1; i--){
mult = mult * i ;
}
return mult;
}
// we can also use this function code down here
// int factorial(int num){
// int mult =1;
// for(int i=2; i<=num; i++){
// ... | ALGO | 0.999963 | 4.885282 |
2290b828-7044-467a-b4f7-9b44814a6b00 | Kristpher/leet_code | 0128-longest-consecutive-sequence/0128-longest-consecutive-sequence.cpp | class Solution {
public:
int longestConsecutive(vector<int>& nums) {
unordered_map<int, int> map1;
for (int i = 0; i < nums.size(); i++) {
map1[nums[i]] = 1;
}
int j = 0;
int k = 0;
int maxim = 0;
int l = 0;
for (int i = 0; i < nums.size();... | ALGO | 0.999933 | 5.353307 |
b1ec1827-f2a5-4f3c-8453-b39c4fae66a0 | mlbismls/PSI_PRO | thirdparty/linux/boost/libs/fiber/examples/asio/ps/server.cpp | #include <cstddef>
#include <cstdlib>
#include <map>
#include <memory>
#include <set>
#include <iostream>
#include <string>
#include <boost/asio.hpp>
#include <boost/utility.hpp>
#include <boost/fiber/all.hpp>
#include "../round_robin.hpp"
#include "../yield.hpp"
using boost::asio::ip::tcp;
const std::size_t max_le... | WEB | 0.905397 | 7.052537 |
39d56a4f-c32b-4eea-adc8-5d978425e05b | aryashsaxena/leetcode_problems | vertical-order-traversal-of-a-binary-tree/vertical-order-traversal-of-a-binary-tree.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.999997 | 6.078314 |
9a46ad90-ca23-41db-8bf4-fe37453f3d42 | tss0823/openjdk8 | jdk/src/share/native/sun/security/ec/ECC_JNI.cpp | #include <jni.h>
#include "impl/ecc_impl.h"
#define ILLEGAL_STATE_EXCEPTION "java/lang/IllegalStateException"
#define INVALID_ALGORITHM_PARAMETER_EXCEPTION \
"java/security/InvalidAlgorithmParameterException"
#define INVALID_PARAMETER_EXCEPTION \
"java/security/InvalidParameterException"
#define KEY_EX... | TOOL | 0.858239 | 7.173624 |
fb774430-ffc9-4ee7-a4ad-9f8eb5745187 | Shintaro0105/Competitive-programming | atcoder/abc/183/f.cpp | #include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll = long long;
int main(){
int n,q;cin>>n>>q;
vector<int> c(n);
dsu d(n);
map<int,map<int,int>> mp;
rep(i,n){
cin>>c[i];
c[i]--;
... | ALGO | 0.999741 | 4.307594 |
12c93fb6-8b1f-4a0e-9a31-18206a1e0c2e | yonsei-hpcp/gcom | third-party/boost_1_86_0/libs/graph/test/vf2_sub_graph_iso_test.cpp | // Revision History:
// 8 April 2013: Fixed a typo in random_functor. (Flavio De Lorenzi)
#include <iostream>
#include <fstream>
#include <map>
#include <algorithm>
#include <cstdlib>
#include <time.h>
#include <boost/core/lightweight_test.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/vf2_sub_... | TEST | 0.899919 | 6.960482 |
8fabe55c-d316-471e-9a6d-bb22296256b1 | syntacore/snippy | compiler-rt/test/sanitizer_common/TestCases/Posix/recursion-in-qsort.cpp | // Check that a qsort() comparator that calls qsort() works as expected
// RUN: %clangxx -O2 %s -o %t
// RUN: %run %t 2>&1 | FileCheck %s
#include <stdio.h>
#include <stdlib.h>
struct Foo {
int array[2];
};
int global_array[12] = {7, 11, 9, 10, 1, 2, 4, 3, 6, 5, 8, 12};
#define array_size(x) (sizeof(x) / sizeof(x[... | TEST | 0.966301 | 5.907065 |
0ad1ae6a-3bab-40e7-ae26-dd929f824e19 | jquk/cppedxtut | L1_Intermediate/2_3_scope_in_classes/MyMath.cpp | #include "MyMath.h"
#include <iostream>
using namespace std;
MyMath::Math::Math()
{
}
MyMath::Math::~Math()
{
}
int MyMath::Math::pow(int base, int exp)
{
cout << endl << "in MyMath::Math::pow" << endl;
int result = 1;
if(exp != 0)
{
for(int i = 0; i < exp; i++)
{
result = result * base;
... | ALGO | 0.970927 | 3.007347 |
cd76fefe-501e-4b73-9063-f707cb6ebbb4 | karouzakisp/llvm-bit-manip | libcxx/test/std/containers/sequences/vector/vector.cons/construct_size_value.pass.cpp | // <vector>
// vector(size_type n, const value_type& x);
#include <vector>
#include <cassert>
#include "test_macros.h"
#include "test_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
template <class C>
TEST_CONSTEXPR_CXX20 void
test(typename C::size_type n, const typename C::value_type& x)
{
C ... | TEST | 0.942254 | 7.17904 |
8b5d166c-13ad-453d-af38-68cdfa29bfda | MichaleGo/Algorithm | 2018-10-short-semester/梅丽渡.cpp |
//https://blog.csdn.net/winter2121/article/details/72848482
//??m???
#include"stdio.h"
#include"string.h"
long long int a[500003],n;
long long int dp[4][500003];
long long int max[4][500003];
int main()
{
memset(dp,0,sizeof(dp));
memset(a,0,sizeof(0));
memset(max,0,sizeof(max));
scanf("%lld",&n);
for(long long i... | ALGO | 0.999976 | 3.215901 |
1a419559-3533-4df7-a6bd-801cead8ade4 | gucwakj/librs | deps/osg/src/osgParticle/FluidProgram.cpp | #include <osgParticle/FluidProgram>
osgParticle::FluidProgram::FluidProgram():
Program()
{
setFluidToAir();
}
osgParticle::FluidProgram::FluidProgram(const FluidProgram& copy, const osg::CopyOp& copyop):
Program(copy, copyop),
_acceleration(copy._acceleration),
_viscosity(copy._viscosity),
_de... | TOOL | 0.906809 | 5.882055 |
08c79a7c-398e-4f07-90c4-e56da9665307 | mitchellgblack/ESOF_3 | BTNode.cpp | class BTNode{
private:
int val;
BTNode * left, * right;
public:
BTNode(int val) : val(val){}
int get_val(){
return val;
}
int set_val(int in_val){
val = in_val;
}
BTNode * get_left(){
return left;
}
BTNode * get_right(){
return right;
}
BTNode * set_left(BTNode * in_left){... | ALGO | 0.997138 | 3.547493 |
c8eb200c-65db-4e88-9d8b-de5e1fdae2c0 | simone-silvestri/interpolate | spline.cpp | #include "functions.h"
void interp3D(Grid *n, Grid *o)
{
myfloat tx[n->imax+2][o->jmax+2][o->kmax+2];
myfloat txy[n->imax+2][n->jmax+2][o->kmax+2];
//start the grid loop
for(int j = 1; j < o->jmax+1; j++)
{
for(int k = 1; k < o->kmax+1; k++)
{
myfloat temp[o->imax+2],temp2[o->imax+2];
for(int i = 1; i ... | ALGO | 0.998132 | 4.137042 |
a493062c-e2fb-4aea-a973-06c68dd5a3e1 | PedroAngeli/Competitive-Programming | Solutions/cses/Sorting and Searching/sum_of_two_values.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
long long n,x;
cin >> n >> x;
vector < pair <long long,int> > vet;
for(int i=0;i<n;i++){
long long a;
cin >> a;
vet.push_back({a,i});
}
sort(vet.begin(),vet.end());
int i=0;
int j=n-1;
while(true){
if(i >= j)
bre... | ALGO | 0.999848 | 4.130651 |
0344d25e-0ee6-43af-a0bf-bdf56b584b68 | gabs-vieira/data-structure-algorithms | I/TDEs/2-InserirCartasOrdenadas.cpp | // Created by gabriel vieira on 15/03/24.
//
#include <stdio.h>
#define tamanho_vetor 9
//Métodos
void ver_lista_cartas( int *cartas, int posicao){
if ( tamanho_vetor == posicao ) return;
printf("%d\n" , cartas[posicao]);
ver_lista_cartas( cartas, (posicao + 1) );
}
void ver_lista_cartas_invertida(int *c... | ALGO | 0.998397 | 3.614053 |
e5da202c-95de-4b53-97a5-1c7d13853f79 | cyanboros/ORB_SLAM2_MonoAR | Thirdparty/g2o/g2o/core/estimate_propagator.cpp | #include "estimate_propagator.h"
#include <queue>
#include <vector>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <fstream>
//#define DEBUG_ESTIMATE_PROPAGATOR
using namespace std;
namespace g2o {
# ifdef DEBUG_ESTIMATE_PROPAGATOR
struct FrontierLevelCmp {
bool operator()(EstimatePropa... | ALGO | 0.999896 | 5.578137 |
34d950ca-e1c8-469e-956d-ef4514aad950 | alexherce/estructura-datos | recursividadMCD/recursividadMCD/main.cpp | #include <iostream>
using namespace std;
int mcd(int m, int n);
int main(int argc, const char * argv[]) {
int num1, num2;
cout << "Ingresa un numero: ";
cin >> num1;
cout << "Ingresa otro numero: ";
cin >> num2;
cout << "El MCD es: " << mcd(num1, num2) << endl;
return ... | ALGO | 0.99525 | 4.210812 |
3fc58e5a-652e-4cf1-b18f-742d61470312 | MinuLoL/CppBOJ | DP/연속 합.cpp | #include<bits/stdc++.h>
using namespace std;
int arr[100000];
int dp[100000];
int dpFunc(int x)
{
if(x==0)return dp[x]=arr[x];
if(dp[x]!=0)return dp[x];
else
{
return dp[x]=max(arr[x]+dpFunc(x-1),arr[x]);
}
}
int main()
{
int n;
cin>>n;
for(int i=0;i<n;++i)
{
cin>>arr[i];
}
dpFunc(n-1);
// for(int i=... | ALGO | 0.999977 | 3.852264 |
4ecea28f-5298-42d7-a7fb-7a7656f2898c | Nebyat19/Competitive-Programming | week1/sort-colors.cpp | class Solution {
public:
void sortColors(vector<int>& nums) {
for(int i=1;i<nums.size();++i){
int key=nums[i]; int j=i-1;
while(j>=0&&key<nums[j]){
nums[j+1]=nums[j];
--j;
}nums[j+1]=key;
}
}
};
| ALGO | 0.999957 | 5.866456 |
a6d73617-1edd-4385-8adb-0271e94446fc | Rahulrao859/LeetCode | 1574-maximum-product-of-two-elements-in-an-array/1574-maximum-product-of-two-elements-in-an-array.cpp | class Solution {
public:
int maxProduct(vector<int>& nums) {
// Check if the array has less than 2 elements
if (nums.size() < 2) {
cout << "Array must have at least two elements!" << endl;
return -1; // Error code
}
// Sort the array in non-decreasing order
sort(nums.begin(), nu... | ALGO | 0.999936 | 6.067555 |
d82adc63-e2cc-49dc-b953-0bdc6eb1ba4c | ishandutta2007/codeforces | s2speed/normal/1614/B.cpp | #include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize ("Ofast")
#define all(x) x.begin() , x.end()
#define sze(x) (ll)(x.size())
#define mp(x , y) make_pair(x , y)
#define wall cerr<<"--------------------------------------"<<endl
typedef long long int ll;
typedef pair<ll , ll> pll;
typedef pair<int , int... | ALGO | 0.999951 | 3.640763 |
8c90d035-4b7e-4635-bcd8-8fc2b9f520f5 | 20060705Sean/judges | h559 pC 共享自行車 (bike) ver1.cpp | // https://drive.google.com/file/d/1RSq17g00V-ygkC8x37iLhtNteoqLAwZg/view
/*
input(G)
for each vertex:calculate_degree
sort_by_degree
*/
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
struct vertex {
vector<pair<int, int>> connection;
int deg, bikes, self;
bool operator<(vertex &that) ... | ALGO | 0.999969 | 3.801735 |
2177cc6d-862b-41ab-9a4c-e03d0ce075cc | Shtirlits1972/Draggable1 | draggable_test1/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.998555 | 6.786404 |
cab31137-f7e0-4bdb-80af-a8c77a6d3158 | pastgonex/Algorithm_Ultimate | NX数据结构/04_二分找limX2.cpp | #include <iostream>
using namespace std;
const int N = 1e6 + 10;
int n, x;
int a[N];
int main(void)
{
scanf("%d%d", &n, &x);
for(int i = 0; i < n; i++) scanf("%d", &a[i]); // 输入的是一个升序的序列
int l = 0, r = n - 1;
while(l < r)
{
int mid = l + r >> 1;
if(a[mid] >= x)
r = mi... | ALGO | 0.999996 | 3.75004 |
8a325e08-c82f-479b-ba0c-bee546d6f444 | MostafaMohamed2001/C-Data-Structure | .history/hello_20240714200422.cpp | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
int arr[n];
for (int i = 0; i < n; i++){
cin >> arr[i];
}
for (int i = 0; i < n; i++){
cout << arr[i] << " ";
i++;
}
for (int i ... | ALGO | 0.999621 | 3.213885 |
0b95fdf6-7a88-41dc-b802-4e876e866343 | tuzi4981/JianZhiOffer | question17.cpp | /*
题目描述
输入两棵二叉树A,B,判断B是不是A的子结构。(ps:我们约定空树不是任意一个树的子结构)
author : bo
*/
/*
struct TreeNode {
int val;
struct TreeNode *left;
struct TreeNode *right;
TreeNode(int x) :
val(x), left(NULL), right(NULL) {
}
};*/
class Solution {
bool isSubtree(TreeNode* pRootA, TreeNode* pRootB) {
if (pRootB == NULL) return t... | ALGO | 0.999901 | 5.551895 |
46cb21ae-91e1-4d4c-91ac-0f361b71e963 | jijo-OO7/Leetcode_Solutions | string.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
string str ="DipankaRajbhandari";
int count[26] ={0};
for(int i=0;i<str.length();i++)
count[str[i]-'a']++;
for(int i=0;i<26;i++)
{
if(count[i]>0)
cout<<(char)(i+'a')<<" "<<count[i]<<endl;
}
} | ALGO | 0.999691 | 3.798613 |
5e3599f3-7157-457f-809b-22f02db59b5a | privateLLM001/Private-LLM-Inference | EzPC/SCI/extern/eigen/doc/examples/TutorialLinAlgExSolveColPivHouseholderQR.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix3f A;
Vector3f b;
A << 1,2,3, 4,5,6, 7,8,10;
b << 3, 3, 4;
cout << "Here is the matrix A:\n" << A << endl;
cout << "Here is the vector b:\n" << b << endl;
Vector3f x = A.colPivHouseholderQr... | ALGO | 0.999946 | 3.347913 |
2cae1dac-55cc-4382-86a7-c44459175ad0 | plctlab/plct-gem5 | src/systemc/tests/systemc/examples/updown/updown.cpp | #include "systemc.h"
#include "specialized_signals/scx_signal_int.h"
#include "specialized_signals/scx_signal_signed.h"
#include "specialized_signals/scx_signal_uint.h"
#include "specialized_signals/scx_signal_unsigned.h"
SC_MODULE(up_down)
{
sc_in_clk clk;
sc_in<sc_uint<1> > up;
sc_in<sc_ui... | TOOL | 0.992548 | 4.042355 |
5f304af3-b516-46dc-ad37-a68e71da2b75 | Swarsel/CSE_TUWIEN | WS2023/High Performance Computing/Projekt/program/lib/GameOfLife.cpp | #include "GameOfLife.hpp"
#include <iostream>
#include <cstdlib>
#include <thread>
#include <chrono>
#include <mpi.h>
#include <algorithm>
#include <iterator>
GameOfLife::GameOfLife(int rows, int cols, int seed, double probability,int px,int py)
: _rows(rows + 2), _cols(cols + 2), _seed(seed), _probability(probabi... | ALGO | 0.99961 | 4.451096 |
6d7a4272-2227-42d0-8141-6315140024b5 | engineersajid/FinalExamCPP | Practice/repeatfirst.cpp | #include <iostream>
using namespace std;
#define PI 3.1416
//abstract class
class Shape
{
public:
virtual double area() const = 0; // pure virtual function
virtual double perimeter() const = 0; // pure virtual function
virtual ~Shape() {} // virtual destructor
};
class Rectan... | ALGO | 0.998717 | 4.938406 |
a218371c-fbd4-4655-9cc8-7b4cecc94e87 | bogdan-lab/Algorithm_puzzles | Tasks/CF_1669_task_C.cpp | #include <iostream>
#include <sstream>
#include <vector>
void Solution(std::istream& input = std::cin);
void RunTests();
int main() {
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
// RunTests();
Solution(std::cin);
return 0;
}
void Solution(std::istream& input) {
int t;
input >> t;
wh... | ALGO | 0.998988 | 5.307518 |
db98cf56-c7dc-477c-aa98-cd80435aff83 | jungh150/PS | baekjoon/4198.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
vector<int> a(n + 1);
for (int i = 1; i < n + 1; i++) cin >> a[i];
a[0] = 0;
int ans = 0;
for (int i = 1; i < n... | ALGO | 0.999949 | 4.042921 |
38070f82-a3b6-4f5e-a118-e047b2e8a497 | Dineshdharman/customer_recognition_FAISS | dlib-19.24/dlib-19.24/examples/quantum_computing_ex.cpp | /*
This is an example illustrating the use of the quantum computing
simulation classes from the dlib C++ Library.
This example assumes you are familiar with quantum computing and
Grover's search algorithm and Shor's 9 bit error correcting code
in particular. The example shows how to simulate bot... | ALGO | 0.997189 | 6.215884 |
d5c16f32-668a-4776-8fe5-2dddf7445446 | knsssuraj16/DSA-Revision | AtoJLadder/A/10_A_Twins.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl ("\n")
#define pi (3.141592653589)
#define mod 1e9+7
#define float double
#define fast ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
int32_t main(){
fast
int n ;
cin >> n;
vector<int> arr(n);
int tot =0;
... | ALGO | 0.999969 | 4.470008 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.