uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
8f1faa73-5f1f-4f30-9519-e706218accce | Coloradohusky/Sagrada | Boost/libs/compute/perf/perf_stl_includes.cpp | #include <vector>
#include <algorithm>
#include <iostream>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);
}
int main(int argc, char *argv[])
{
perf_parse_args(argc, argv);
std::cout << "size: " << PERF_N << std::endl;
std::vector<int> v1(PERF_N);
... | TEST | 0.967148 | 5.960803 |
48e3c3f5-922c-4e08-a1d6-513366fee799 | shraddhanahar/FindingMaxMin | StraightMaxMin0.cpp | #include<iostream>
using namespace std;
/*BestAlgorithmToFindMaxMinInAccordanceToTimeComplexity*/
int main()
{
int a[100],i,n,min,max;
cout<<"Enter size of array :\t";
cin>>n;
/* #####AcceptArray##### */
for(i = 1 ;i<=n;i++)
{
cin>>a[i];
}
... | ALGO | 0.999582 | 4.034508 |
1a3adddd-30d7-49bc-b737-1498d6e4f50a | LeoParadox10/CodingPractice | 2443-check-if-there-is-a-valid-partition-for-the-array/check-if-there-is-a-valid-partition-for-the-array.cpp | class Solution {
public:
bool solve(vector<int> &a, vector<int> &dp, int i, int n)
{
if(i>=n)
return true;
if(dp[i]!=-1)
return dp[i];
if(i+1<n && a[i]==a[i+1])
{
dp[i]=solve(a, dp, i+2, n);
if(dp[i])
return true;
if(i+2<n && a[i]==a[i+2])
{
dp[i]... | ALGO | 0.999979 | 5.463649 |
d01232c8-49cf-47f4-9a65-5b3943d0ea63 | Sunwoongiii/CSD | Assignment11-1/2.cpp | #include <iostream>
using namespace std;
template <typename T>
void reverseArray(T arr[], int size) {
for (int i = 0; i < size / 2; i++) {
T temp = arr[i];
arr[i] = arr[size - i - 1];
arr[size - i - 1] = temp;
}
}
int main() {
int x[] = {1, 10, 100, 3, 5};
reverseArray(x, 5);
for (int i = 0; i ... | ALGO | 0.99978 | 5.629537 |
f34435dd-7c4f-45e2-96ce-fd3cf8b71684 | akashsingh96/Placement-2018-2019- | Apple/distinct_pairs.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
int main()
{
int t;
cin>>t;
while(t--)
{
int n,x;
cin>>n>>x;
vector<int>v(n);
for(int i=0;i<n;i++)
cin>>v[i];
sort(v.begin(),v.end());
int count=0;
... | ALGO | 0.999783 | 3.804271 |
810024a7-51fe-4bfd-b418-9276da5ae0ef | WindBlowAssCold/ollvm | libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort/ranges_partial_sort.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
// <algorithm>
// template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less,
// class Proj = identity>
// requires sortable<I, Comp, Proj>
// constexpr I
// ranges::partial_sort(I firs... | TEST | 0.99704 | 7.83701 |
81ff65f1-82bd-4bef-8874-a789e8d8fc51 | alexgunkel/eulerPlayGround | src/700/main.cpp | #include "euler_coin.hpp"
#include <iostream>
int main()
{
EulerCoin coin{1'504'170'715'041'707, 4'503'599'627'370'517};
//EulerCoin coin{997, 3167};
auto result = coin.first();
uint64_t sum{0};
while (result) {
std::cout << result.factor << ": " << result.value << "\n";
sum += res... | ALGO | 0.997517 | 4.414852 |
dd013cfc-2f26-4a62-bb37-5b00a16d491e | fsocietychain/fsociety | src/bloom.cpp | #include <bloom.h>
#include <primitives/transaction.h>
#include <evo/specialtx.h>
#include <evo/providertx.h>
#include <evo/cbtx.h>
#include <llmq/quorums_commitment.h>
#include <hash.h>
#include <script/script.h>
#include <script/standard.h>
#include <random.h>
#include <streams.h>
#include <math.h>
#include <stdlib... | ALGO | 0.927085 | 7.311583 |
a23c34e9-a6f7-4ecf-b2e6-1a1ee913518e | dev7060/codegladiators | 1_3.cpp | /*Enter your code here. Read input from STDIN. Print your output to STDOUT*/
#include <iostream>
#include <string>
#include <string.h>
using namespace std;
int main()
{
string comp;
long long int n;
getline (cin, comp);
cin>>n;
string str[n];
long long int i=0;
cin.ignore();
while(n--){
... | ALGO | 0.999421 | 3.896699 |
4049dbf8-0c4a-4284-8abe-40f77c7c8d75 | ishandutta2007/codeforces | sexpert/normal/235/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MSK = (1 << 30) - 1;
const int PI = 303;
vector<int> ps;
int prime[2001];
map<ll, ll> dp;
ll to(ll a, ll b, ll c, ll i) {
return (a<<45)|(b<<30)|(c<<15)|i;
}
ll solve(int a, int b, int c, int i) {
int p = ps[i];
if(a < p && b < p && c < ... | ALGO | 0.999882 | 4.772767 |
53c23ff7-1b77-4fc7-8b99-8182a63e40c1 | sachinsrivastava1028/DSA--Rohit-Negi | Day 22-Introduction to Arrays/ThirdLargestElemInArray.cpp | #include<iostream>
#include<climits>
using namespace std;
int main()
{
int n;
cout << "Enter the number of elements in the array: ";
cin >> n;
if (n < 3)
{
cout << "NOT VALID";
}
else
{
int arr[n];
cout << "\nEnter " << n << " elements:\n";
for (int i = ... | ALGO | 0.999678 | 3.927629 |
81e8c2ef-c506-4dd4-942e-4e37c4e20834 | ankushgarg1998/Competitive_Coding | practice-websites/codechef-ccdsap/Stack and Queue/Alternating Current.cpp | #include<iostream>
#include<stack>
using namespace std;
int main() {
string str;
stack<char> s;
cin>>str;
for(char ch: str) {
if (!s.empty() && s.top() == ch)
s.pop();
else
s.push(ch);
}
if(s.empty())
cout<<"Yes\n";
else
cout<<"No\n";
... | ALGO | 0.999997 | 4.357654 |
007d598c-a80b-4c1e-8601-2e1bb7254bca | rajatsen91/XtremeContextualBandits | lib/eigen/test/denseLM.cpp | #include <iostream>
#include <fstream>
#include <iomanip>
#include "main.h"
#include <Eigen/LevenbergMarquardt>
using namespace std;
using namespace Eigen;
template<typename Scalar>
struct DenseLM : DenseFunctor<Scalar>
{
typedef DenseFunctor<Scalar> Base;
typedef typename Base::JacobianType JacobianType;
typed... | TEST | 0.958283 | 5.862647 |
85963527-72cf-447a-9c45-70000e8ea0ef | AlexMan2000/Stanford_CS106 | CS106B_X/assigns/Assignment 4/Permutations.cpp | #include "Permutations.h"
using namespace std;
/* Returns all permutations of the given input string.
*
* NOTE: THE INITIAL IMPLEMENTATION PROVIDED HERE IS INCORRECT. You will need
* to isolate the bug by using the debugger, then answer some questions about
* why this code is incorrect. Remember that the error con... | ALGO | 0.998957 | 6.656662 |
32f54aa0-b0ef-41a6-af33-38c62932c5ad | ishandutta2007/codeforces | ljc00118/normal/1421/B.cpp | #include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define per(i, a, b) for (int i = a; i >= b; i--)
using namespace std;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef long long ll;
template <typename _T>
inline void read(_T &f) {
f = 0; _T fu = 1; char c = getchar()... | ALGO | 0.999932 | 3.345568 |
9d7545f1-d640-4576-8835-d63b3d8892c3 | Bikash0717/DSA-with-CPP | practice/exam_practice/recursion.cpp | #include<iostream>
using namespace std;
/* int factorial(int n)
{
if(n==1)
{
return 1;
}
else
{
return n*factorial(n-1);
}
}
int sum(int n)
{
if(n==0)
{
return 0;
}
else
{
return n+sum(n-1);
}
}
int fib(int num)
{
if(num==0||num==1)
... | ALGO | 0.999378 | 3.775521 |
ef134a4e-67bf-4783-916e-a7ac936b2909 | akanksha0812/Data-Structures | Love Babbar/SwapAlternate.cpp | #include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
void reverseAlternate(int arr[], int size)
{
int start = 0, end = size - 1;
while (start <= end)
{
swap(arr[start], arr[start + 1]);
swap(arr[end], arr[end - 1]);
start++;
end--;
}
}
void printArray(int arr[... | ALGO | 0.999917 | 4.611669 |
980f13c3-217d-4e43-b6de-45ed7d6f472a | MAHY-MAHY/Int_18_04 | diffuse.cpp | #include "Diffuse.h"
#include <omp.h>
Diffuse:: Diffuse(double Tfin,double inf_x, double sup_x,double inf_y,double sup_y,int nb_cell, int n_fonc,double CFL,int Cond_lim,double Beta)
{
m_Tfin = Tfin;
m_nFonc = n_fonc;
a =2.;// coefficient pour la fonction u
twelth=1./12.;
third=1./3.;
m_CFL=CFL;
m_CL=Cond... | ALGO | 0.999301 | 4.18457 |
89a04fbb-9191-43fb-8e81-56a58d45a908 | Ginakira/Code-Archive | Leetcode/剑指 Offer 41. 数据流中的中位数.cpp | // 剑指 Offer 41. 数据流中的中位数
#include <algorithm>
#include <numeric>
#include <queue>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
class MedianFinder {
private:
priority_queue<int> small;
priority_queue<int, vector<int>, greater<int>> big;
public:
/** initialize you... | ALGO | 0.999984 | 6.568496 |
10abe3cc-46ab-49aa-a8f1-d97aed744970 | WengFengQiang/3Dslice | ThirdPartyDependence/eigen3/doc/examples/TutorialLinAlgExSolveLDLT.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix2f A, b;
A << 2, -1, -1, 3;
b << 1, 2, 3, 1;
cout << "Here is the matrix A:\n" << A << endl;
cout << "Here is the right hand side b:\n" << b << endl;
Matrix2f x = A.ldlt().solve(b);
cout << "... | ALGO | 0.999932 | 3.807622 |
276e2927-37e9-41ea-87e8-47f4411f7f92 | mauryavinay1407/DSA-cpp | Tree/Minimum_Number_of_Operations_to_Sort_a_Binary_Tree_by_Level.cpp | // problem: https://leetcode.com/problems/minimum-number-of-operations-to-sort-a-binary-tree-by-level
/*
Approach - BFS + Minimum operations to sort an array excluding duplicate element
Time Complexity : O(N*logN)
Space Complexity : O(N)
*/
class Solution {
public:
int minimumOperations(TreeNode* root) {
... | ALGO | 0.999981 | 6.487733 |
f14dfee8-8ba3-4a29-a02d-38db11a9fe96 | wkdtpeo/MyGame | Engine/Source/ThirdParty/ICU/icu4c-53_1/source/common/ustring.cpp | #include "unicode/utypes.h"
#include "unicode/putil.h"
#include "unicode/ustring.h"
#include "unicode/utf16.h"
#include "cstring.h"
#include "cwchar.h"
#include "cmemory.h"
#include "ustr_imp.h"
/* ANSI string.h - style functions ------------------------------------------ */
/* U+ffff is the highest BMP code point, t... | TOOL | 0.993976 | 6.223773 |
087aeb1a-3647-454c-85f2-f2e1dee083ad | axelu/leetcode | cpp/00500-00999/convertbinarysearchtreetogreatertree.cpp |
// 538. Convert BST to Greater Tree
// https://leetcode.com/problems/convert-bst-to-greater-tree/
// same as
// https://leetcode.com/problems/binary-search-tree-to-greater-sum-tree/
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* Tre... | ALGO | 0.99995 | 6.430324 |
728d75ad-60bf-4bcf-a7be-0bc8b57c1d78 | hokhanhlinh2006/BAIVENHASESON4 | Bài về nhà Seson4.7.cpp | #include <stdio.h>
int main() {
int year;
printf("Nhap vo mot nam: ");
scanf("%d", &year);
if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {
printf("Nam %d l nam nhuan.\n", year);
} else {
printf("Nam %d khng phai l nam nhuan.\n", year);
}
return 0;
}
| ALGO | 0.999309 | 3.465816 |
fd41d81c-fcb4-455c-ab9b-ee667cded1eb | AMIRIOX/MyLuoguRepo | template/stage1/template#SPFA.cpp | // #include <bits/stdc++.h>
// using namespace std;
// int n, m, s;
// const int maxn = 5e5 + 10;
// struct edge
// {
// int to, w, nxt;
// } g[maxn];
// int tot, head[maxn];
// void addEdge(int u, int to, int w)
// {
// g[++tot].to = to;
// g[tot].w = w;
// // >=.=.=.=.=.=.=.=.=.=.=.=.=.=.=
// g[to... | ALGO | 0.9999 | 4.921032 |
e0a5b223-f337-4827-a440-6662fb8c6eab | CUAVcaijie/CUAV-Nora | ArduCopter/inertia.cpp | #include "Copter.h"
// read_inertia - read inertia in from accelerometers
void Copter::read_inertia()
{
// inertial altitude estimates. Use barometer climb rate during high vibrations
inertial_nav.update(vibration_check.high_vibes);
// pull position from ahrs
Location loc;
ahrs.get_position(loc);
... | ALGO | 0.854106 | 5.56914 |
66fe054e-e746-4fb5-aa36-ee08c11a6526 | WangSimiao2000/GAMES101-Assignments | opencv/sources/modules/core/src/hal_internal.cpp | #include "precomp.hpp"
#include "hal_internal.hpp"
#ifdef HAVE_LAPACK
#include <complex.h>
#include "opencv_lapack.h"
#include <cmath>
#include <algorithm>
#include <typeinfo>
#include <limits>
#include <complex>
#include <vector>
#define HAL_GEMM_SMALL_COMPLEX_MATRIX_THRESH 100
#define HAL_GEMM_SMALL_MATRIX_THRESH... | TOOL | 0.993015 | 6.125821 |
69d717ae-42b6-4ec8-b7b1-65bb6ff6c8b0 | shehza-d/DSA | calio-us-berkeley/2024/problems/cousins/templates/cousins_template.cpp | #include <iostream>
#include <vector>
using namespace std;
/**
* For each game, output who wins the game in one line.
*
* N: size of the game board
* M: number of different games
* A: game board
* G: description of each game
*/
void solve(int N, int M, vector<int>& A, vector<vector<int>>& G) {
// YOUR CODE... | ALGO | 0.999987 | 4.549348 |
006b7bfa-9167-40d8-b324-4b4e66041f92 | Quypham14/Code_nam_3 | KTCOBAN108_ptit.cpp | #include <iostream>
#include <queue>
#include <cstring>
using namespace std;
const int N = 205;
int T, n, f[N][N], p10[N] = {1};
void solve()
{
cin >> n;
for (int i = 0; i <= 200; i++)
{
for (int j = 0; j <= 200 - i; j++)
{
f[i][j] = -1;
}
}
for (int i = 1; i <... | ALGO | 0.999817 | 4.448322 |
be54e44a-b452-4428-b35c-f1c7ab7398c1 | SansPapyrus683/usaco-solutions | src/official/o2020/feb/gold/memories/milking_ptsd.cpp | #include <iostream>
#include <fstream>
#include <cassert>
#include <vector>
#include <queue>
#include <algorithm>
using std::cout;
using std::endl;
using std::vector;
using std::pair;
// 2020 feb gold (this solution was more convoluted than i thought it would be)
int main() {
std::ifstream read("timeline.in");
... | ALGO | 0.999974 | 4.097195 |
ccb2ba01-e374-49f6-98fb-32b699772362 | BriMonzZY/roborts-mas | src/robortsmas/roborts_costmap/src/inflation_layer.cpp | #include <algorithm>
#include <mutex>
#include "costmap_math.h"
#include "footprint.h"
#include "inflation_layer.h"
#include "inflation_layer_setting.pb.h"
namespace roborts_costmap {
InflationLayer::InflationLayer()
: inflation_radius_(0),
weight_(0),
inflate_unknown_(false),
cell_inflation_radi... | TOOL | 0.961765 | 7.319086 |
28ff3254-7d3d-4850-9cb1-41265b186f68 | priyanshuanandd/Code_Submissions | 217.contains-duplicate.cpp | /*
* @lc app=leetcode id=217 lang=cpp
*
* [217] Contains Duplicate
*/
// @lc code=start
class Solution
{
public:
bool containsDuplicate(vector<int> &nums)
{
set<int> s;
for (auto i : nums)
{
if (s.count(i) == 1)
{
return true;
}
... | ALGO | 0.99942 | 6.036608 |
5826f5f8-710c-4134-8373-9717213ad429 | Jeevan-kumar-Raj/InterviewBit-Topicwise-Solutions | Stacks and Queues/MinStack.cpp | // https://www.interviewbit.com/problems/min-stack/
stack<int> st;
stack<int> minSt;
MinStack::MinStack() {
while(!st.empty()){
st.pop();
}
while(!minSt.empty()){
minSt.pop();
}
}
void MinStack::push(int x) {
st.push(x);
if(minSt.size() == 0){
minSt.push(x);
}
... | ALGO | 0.999778 | 6.295383 |
a9a71f9c-6130-42fa-bf3b-68215da2765b | shubhambhatt037/test | Graph/articulation.cpp | #include<unordered_map>
#include<list>
#include<iostream>
using namespace std;
void dfs(int node, int parent, vector<int> &disc, vector<int> &low, unordered_map<int, bool> &vis,
unordered_map<int, list<int> > &adj, vector<int> &ap, int &timer)
{
vis[node] = true;
disc[node] = low[node] = timer++;
int chi... | ALGO | 0.99983 | 5.310633 |
1e6942bc-ae1c-4d26-8bbb-48e3d4f4fdc4 | semicolon-id/AlgoPemograman_2C2240006 | pertemuan2&3/for.cpp | #include <iostream>
using namespace std;
int main() {
int nilaiAwal, nilaiAkhir;
cout << "Masukan nilai awal : ";
cin >> nilaiAwal;
cout << "Masukan nilai akhir : ";
cin >> nilaiAkhir;
for (int i = nilaiAwal; i <= nilaiAkhir; i++){
cout << i << " FOLLOW @classyscience.iu " << endl;
}
return 0;
} | TOOL | 0.933009 | 3.026626 |
99e45602-51c0-4876-b6f4-c7faad11c81f | ishandutta2007/codeforces | leapfrog/normal/1451/D.cpp | //
#include<bits/stdc++.h>
using namespace std;
template<typename T>inline void read(T &x)
{
x=0;char c=getchar(),f=0;
for(;c<'0'||c>'9';c=getchar()) if(!(c^45)) f=1;
for(;c>='0'&&c<='9';c=getchar()) x=(x<<1)+(x<<3)+(c^48);
if(f) x=-x;
}
int T,n,m,a[100005];
inline void solve(double k)
{
int n=k;for(int i=1;i<=n;i... | ALGO | 0.999679 | 3.837117 |
fc7bedd6-536f-4388-8392-065fa6d185a9 | Balpreet1003/LeetCode | 0921-minimum-add-to-make-parentheses-valid/0921-minimum-add-to-make-parentheses-valid.cpp | class Solution {
public:
int minAddToMakeValid(string s) {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int ans=0;
stack<char>st;
for(char c:s){
if(c=='('){
st.push(c);
}
else{
if(!st.em... | ALGO | 0.999469 | 5.798089 |
d340d3c2-14cd-479c-9114-31067755063f | ExpoSeed/pokereverie | tools/scaninc/scaninc.cpp | #include <cstdio>
#include <cstdlib>
#include <list>
#include <queue>
#include <set>
#include <string>
#include "scaninc.h"
#include "source_file.h"
bool CanOpenFile(std::string path)
{
FILE *fp = std::fopen(path.c_str(), "rb");
if (fp == NULL)
return false;
std::fclose(fp);
return true;
}
c... | TOOL | 0.933389 | 4.469528 |
706c3f68-30cf-4254-94d5-a842208509d4 | Stevy-aimery/ToolsFast | 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 |
169d1119-994a-44f3-8516-757920d11d3e | HuyNgyuen/DSA-starter | 06_Cay_va_cac_cay_tim_kiem/Cay_nhi_phan_va_cay_tim_kiem/bai006.cpp | #include <iostream>
using namespace std;
struct node {
int info;
struct node* pLeft;
struct node* pRight;
};
typedef struct node NODE;
typedef NODE* TREE;
NODE* CreateNode(int x) {
NODE* p = new NODE;
if (p == NULL)
return NULL;
p->info = x;
p->pLeft = NULL;
p->pRight = NULL;
... | ALGO | 0.999969 | 4.182992 |
b37872e3-1c3e-4845-a7a2-8a9490280e01 | Precipitating/LeetCode | Letter Tile Possibilities/Source.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
class Solution
{
public:
int numTilePossibilities(string tiles)
{
string curr;
vector<bool> visited(tiles.size(), false);
sort(tiles.begin(), tiles.end());
Solve(curr, tiles, visite... | ALGO | 0.999965 | 6.977065 |
a79e9fd0-765a-486f-9076-c6d6f84e89de | VougaDev/node-mta | src/cpp/dkim.cpp |
#include "dkim.hpp"
namespace dkim
{
Canonicalization::Canonicalization(
const std::string &name,
std::function<std::string(const std::string &, const std::string &)> forHeader,
std::function<std::string(std::string &)> forBody) : name{name}, forHeader{forHeader}, forBody{forBody}
{
}
Canon... | ALGO | 0.971532 | 7.007134 |
b09568f5-bd58-47f6-9a4b-dfab258f255c | Sridev001/TOC | programs/19.cpp | #include <stdio.h>
#include <stdbool.h>
#include <string.h>
// Function to check if the given string belongs to the CFG language
bool belongsToLanguage(const char* str) {
int len = strlen(str);
int i = 0;
// Check if the string starts with 'A'
if (str[i] == 'A') {
i++;
} else {
ret... | TOOL | 0.904344 | 6.356373 |
533f0cb4-021d-44e7-81ec-3049fdaed22e | lllray/ray-astr | hybrid-astar-planner/test.cpp | #include "include/Planner.hpp"
State getStartState();
State getTargetState();
int main(){
Map map;
State start=getStartState();
State target=getTargetState();
Planner astar;
astar.plan(start, target, map);
}
State getStartState()
{
//to do: read from yml file
//return State(700, 100, 126);
return Sta... | ALGO | 0.968673 | 3.337 |
b8bc8af7-5de6-4089-96ef-f2b66e031f6c | rladmschd235/codetree-TILs | 240126/n번 더하기/add-n-times.cpp | #include <iostream>
using namespace std;
int main() {
int a, n;
cin >> a >> n;
for(int i = 0; i < n; i++)
{
cout << a+n << endl;
a += n;
}
return 0;
} | ALGO | 0.999803 | 3.254702 |
65ab1969-5eab-49f7-8487-ded4a5d7433d | zshengzhe/learn_cpp_primer | ch10/ex10_22.cpp | /**
* Created by Linus Zhang on 2023/4/9.
*/
#include <iostream>
#include <vector>
#include <string>
auto bigger_than_num(const std::string &s, std::size_t sz) -> long
{
return s.size() > sz;
}
int main()
{
std::vector<std::string> v{"linus", "1234567", "1234567", "1234567", "1234567"};
std::cout << std::coun... | ALGO | 0.880161 | 4.603146 |
9ffe03fa-c862-435f-b6e1-a54fa54883c7 | karabaos/UnrealVN | Engine/Source/ThirdParty/openexr/OpenEXR-1.7.1/openexr-1.7.1/IlmImf/ImfEnvmap.cpp | //-----------------------------------------------------------------------------
//
// Environment maps
//
//-----------------------------------------------------------------------------
#include <ImfEnvmap.h>
#include "ImathFun.h"
#include <algorithm>
#include <math.h>
using namespace std;
using namespace Imath;
nam... | ALGO | 0.900217 | 6.83356 |
b93b70cd-7a33-4f78-88f7-ae41561d20eb | huwenao/mteasan | llvm-project/llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp | #include "llvm/CodeGen/DbgEntityHistoryCalculator.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/LexicalScopes.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstr.h"
#incl... | TOOL | 0.921294 | 7.954088 |
1c89f595-01d6-4702-af3c-81870ebfe467 | Shruti-k1/cpp_basic_programs | basic questions/straight line points.cpp | /* Given three points (x1, y1), (x2, y2) and (x3, y3), write a program to check if all the three points fall on one straight line.*/
#include <iostream>
using namespace std;
int main()
{
int x1,y1,x2,y2,x3,y3,a,b;
cout<<"ENTER FIRST POINT (X1,Y1): " ;
cin>>x1>>y1;
cout<<"ENTER SECOND POINT (X2,Y2) :... | ALGO | 0.999741 | 3.989173 |
ea334503-4702-4991-87cc-6a41aba01a62 | dev-rajm/ds-algo-lib | leetcode/222-count-complete-tree-nodes.cpp | #include <bits/stdc++.h>
using namespace std;
int countNodes(TreeNode *root)
{
if (root == NULL)
{
return 0;
}
int leftCount = countNodes(root->left);
int rightCount = countNodes(root->right);
return 1 + leftCount + rightCount;
} | ALGO | 0.99967 | 5.548458 |
d1bbcfcb-6a3a-4b58-9d0d-d5618da3524c | jahid0002/All-code | stateManegment/example2/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.997621 | 6.76073 |
abc1d244-0dfc-49be-94dd-856efe937ee5 | Arushigupta04/foodie_foodorderingwebsite | Frontend/src/components/Home/image/soln.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{
int t;
cin >> t;
while(t--)
{
int n;
cin >> n;
}
} | ALGO | 0.995972 | 3.942407 |
a823cf69-f7c4-4cc4-a7a3-db9db495e108 | mdalaminhossain2108051/CSE_182-lab-9 | lab9prac4.cpp | #include<iostream>
using namespace std;
int reverseArray()
{
int n,i,arr[n];
cout<<"range of array: ";
cin>>n;
cout<<"enter the elements of array: ";
for(i=0;i<n;i++)
{
cin>>arr[i];
}
cout<<endl;
int s=0;
int e=n-1;
while(s<e)
{
swap(arr[s],arr[e]);
... | ALGO | 0.998065 | 4.260201 |
720492f2-0c86-4a31-b07f-e18c2216739b | ThisIsATest369/SensorsCalibration | factory_calib/3rdparty/eigen3/doc/examples/Tutorial_BlockOperations_vector.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::ArrayXf v(6);
v << 1, 2, 3, 4, 5, 6;
cout << "v.head(3) =" << endl << v.head(3) << endl << endl;
cout << "v.tail<3>() = " << endl << v.tail<3>() << endl << endl;
v.segment(1,4) *= 2;
cout << "after 'v.segment(1,4) *= 2', v... | ALGO | 0.995912 | 3.072667 |
8f5416a6-3842-4fdc-bddb-4168aa735947 | Mohammed-eid35/LeetCode | Hard/2306. Naming a Company/2306. Naming a Company.cpp | class Solution {
public:
long long distinctNames(vector<string>& ideas) {
vector<unordered_set<string>> groups(26);
for (auto &idea : ideas)
groups[idea[0] - 'a'].insert(idea.substr(1));
long long numOfNames = 0;
for (int i = 0; i < 26; ++i) {
for (in... | ALGO | 0.999949 | 5.758195 |
f38d149b-9994-4725-ad33-4b09acf8af50 | cxyfer/OJ | Leetcode/cpp/medium/1382.cpp | /*
* @lc app=leetcode.cn id=1382 lang=cpp
*
* [1382] 将二叉搜索树变平衡
*/
// @lcpr-template-start
#include <bits/stdc++.h>
using namespace std;
// @lcpr-template-end
// @lc code=start
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNo... | ALGO | 0.999979 | 6.759295 |
69c98a26-a3e6-4bec-9d78-394a451d33cd | vanshu778/DSA-2025 | patterns/Alphabet_pattern.cpp | #include<iostream>
using namespace std;
int main(){
// Pattern 1:
// A
// AB
// ABC
// ABCD
// ABCDE
// int n;
// cin>>n;
// for(int i=0; i<n; i++){
// for (char ch='A'; ch<='A'+i; ch++){
// cout<<ch;
// }
// cout<<endl;
// }
// Pattern 2:
// E
// DE
// CDE
// BCDE
// ABCDE
// int n;
// cin>... | ALGO | 0.999818 | 4.164717 |
6719e2b5-1eaf-4caf-aee6-39495b2b5455 | passagemath/upstream-gfan | src/tropical2.cpp | #include "tropical2.h"
#include <stdlib.h>
#include <iostream>
#include "buchberger.h"
#include "division.h"
#include "tropical.h"
#include "wallideal.h"
#include "dimension.h"
#include "halfopencone.h"
#include "breadthfirstsearch.h"
#include "tropicalbasis.h"
#include "tropicalcurve.h"
#include "linalg.h"
#include... | ALGO | 0.999456 | 5.739622 |
e98f09ac-01f7-4761-a868-349408327ba9 | Schallaven/topino | eigen3/doc/examples/class_FixedBlock.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
template<typename Derived>
Eigen::Block<Derived, 2, 2>
topLeft2x2Corner(MatrixBase<Derived>& m)
{
return Eigen::Block<Derived, 2, 2>(m.derived(), 0, 0);
}
template<typename Derived>
const Eigen::Block<const Derived, 2, 2>
topLeft2... | TOOL | 0.910216 | 6.661391 |
baf47165-deb2-4e68-bbdf-facbc5dae15a | fjanisze/Problems | ABearAndGame.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define printv(data) for(auto& e:data) cout<<e<<","; cout<<endl;
#define sortv(data) std::sort(data.begin(),data.end());
#define rsortv(data) std::sort(data.rbegin(),data.rend());
#define fori(start,end) for(size_t i{start};i<end;i++)
#de... | ALGO | 0.999877 | 4.042759 |
409141f7-5c30-446c-aef5-17e6a22c6f91 | dzungpng/material-point-method-jello-simulation | Deps/libigl/include/igl/edges_to_path.cpp | #include "edges_to_path.h"
#include "dfs.h"
#include "sort.h"
#include "slice.h"
#include "ismember.h"
#include "unique.h"
#include "adjacency_list.h"
template <
typename DerivedE,
typename DerivedI,
typename DerivedJ,
typename DerivedK>
IGL_INLINE void igl::edges_to_path(
const Eigen::MatrixBase<DerivedE> &... | ALGO | 0.999654 | 4.948503 |
e2a1aed4-fa91-41e2-b70e-88bdab0b2ebc | Glory-Day/Solutions | Programmers/Level-03/Cpp/표_편집.cpp | #include <iostream>
#include <vector>
#include <set>
using namespace std;
int getValue(string cmd) {
string s = "";
for (int i = 2; i < cmd.size(); i++) {
s += cmd[i];
}
return stoi(s);
}
string solution(int n, int k, vector<string> cmd) {
string answer(n, 'O');
vector<int> prev;
... | ALGO | 0.999924 | 4.855482 |
e60d1b2b-4c3d-4e2b-a7b5-bed9f5db6256 | langyanashish/Competitive-Programming | anagram1.cpp | #include<bits/stdc++.h>
using namespace std;
#define LL long long
#define LD long double
#define PB push_back
#define LOOP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define mod 1000000007
int hash1[11],hash2[11];
void reset()
{
LOOP(i,10)
{
hash1[i]=0;
hash2[i]=0;
}
}
i... | ALGO | 0.999824 | 3.770529 |
5c3a104d-cb89-4375-95ce-f7671980530e | Matthew5716/Scheduling | Scheduler.cpp | #include "Scheduler.h"
#include <cmath>
#include <iostream>
#include <algorithm>
using std::cout;
using std::min;
using std::sort;
using std::stringstream;
using std::ostringstream;
Scheduler::Scheduler(int timeQuantum, vector<Process>& allProcesses, int nQueues, int ageing, int startTick) {
handleIO = false;
... | ALGO | 0.996428 | 4.308872 |
d4d731f6-7d8b-4b2e-bff0-94f0870bdd04 | Rovinota/Codeforces-Solutions | Div4 Contest2/D. X-Sum.cpp | #include <bits/stdc++.h>
using namespace std;
void solve () {
int n, m;
cin >> n >> m;
int a[n][m];
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cin >> a[i][j];
}
}
long long ans = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
long long sum = a[i][j]... | ALGO | 0.999704 | 4.070523 |
50d7d6e6-ed80-4430-a8fc-2089218292fa | nezogame/Algorithms_and_Data_Structures | 13Lab3Sem(C++)/main/main.cpp | // main.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
using namespace std;
struct Node {
int key, priority;
Node* left, * right;
Node(int k, int p) : key(k), priority(p), left(nullptr), right(nullptr) {}
};
class Treap {
Node* root;
... | ALGO | 0.998294 | 4.615896 |
b6be6be4-6120-44d6-8cdc-7109ccff1f29 | madhur3u/DSA-Questions | Graphs/Number Of Islands2.cpp | // https://practice.geeksforgeeks.org/problems/number-of-islands/1
// DSU CLASS STARTS
class DSU {
vector<int> size, parent;
public:
DSU(int n) {
size.resize(n + 1, 1);
parent.resize(n + 1);
for (int i = 0; i <= n; i++){
parent[i] = i;
}
}
int findParent(... | ALGO | 0.999986 | 6.513072 |
ea861291-a4eb-4d2a-88f2-81b3cc0a2f2f | MinByeongChan/myMBC | Codingtest/Baekjoon/1912_SeuqenceAdd.cpp | #include <iostream>
#include <vector>
using namespace std;
// variable init
vector<long long int> dp;
vector<long long int> v;
int N;
long long int mx = -1000;
/*
스택오버플로우로 인한 실패
N이 5000이상이면 스택이 쌓여 도중에 중단됨.
*/
void BinarySearch1(int i, long long int sum) {
long long int sum_temp = sum + v[i];
if (sum_temp < dp[i])... | ALGO | 0.999914 | 3.981216 |
74c5fb37-efff-4f3a-8aea-d2f215e22356 | asrafulmolla/100-plus-C-Plus-Plus-Basic-Problem-And-Solve-With-Code | 58_revers_number.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int num,rem,sum=0,temp;
cin>>num;
temp=num;
while(temp!=0)
{
rem=temp%10;
sum=sum*10+rem;
temp/=10;
}
cout<<sum;
} | ALGO | 0.999964 | 4.43177 |
ac73cf03-329c-48d5-a0ca-8d2cb64f0ab8 | ishandutta2007/codeforces | lzr_010506/normal/908/B.cpp | #include <bits/stdc++.h>
#define rep(i, x, y) for(int i = x; i <= y; i ++)
#define rrep(i, x, y) for(int i = x; i >= y; i --)
#define ll unsigned long long
#define X first
#define Y second
#define pb push_back
#define mp make_pair
#define ls rt << 1
#define rs rt << 1 | 1
#define INF 0x3f3f3f3f
#define pll pair<ll, ... | ALGO | 0.999961 | 3.681726 |
33d59d54-0d3f-41b7-a21e-4fe208a381d5 | PranabNandy/CS700---Algorithms-And-Complexity | Assignment3/Code.cpp | #include<bits/stdc++.h>
#include<sys/resource.h>
#include<unistd.h>
using namespace std::chrono;
using namespace std;
fstream output_2;// for storing component information
int r=remove("output_2.txt");
class Node{
public:
int val;
Node *next;
Node(int x){
val=x;
next=nullptr;
}
};
un... | ALGO | 0.995072 | 4.243476 |
e4c183ce-904b-4c88-8924-a7b7af9c6aaf | vivekyadav6838/DSA-solution | Chef_and_Races.cpp | #include<bits/stdc++.h>
// #define for(i,n) for (int i = 0; i < n; ++i)
// #define int long long int
// #define arr(n) int arr[n]
using namespace std;
int main()
{
int t;
cin>>t;
while(t--){
int x,y,a,b;
cin>>x>>y>>a>>b;
int ans=2;
if(x==a||x==b)
{
ans--;
}
if(y==a ||y==b)
{
... | ALGO | 0.99963 | 3.609249 |
e56ea9dc-c2fe-45b1-9c01-c5a07b3e8066 | sumit-gade/DSA-Problem-Solving-Repository | MATRIX/search_IN_row_col_sortedMatrix.cpp | #include <iostream>
#include <vector>
using namespace std;
bool search(vector<vector<int>> matrix, int n, int m, int x) {
int i = 0, j = m - 1;
while (i < n && j >= 0) {
if (matrix[i][j] == x) return true;
else if (matrix[i][j] > x) {
j--;
} else {
i++;
}... | ALGO | 0.99999 | 6.271093 |
5a0146b9-002c-457d-9856-bb48e2a58181 | Narendra-JNU-2k13/First_C-_Repository | alternate2_reverse_link_list.cpp | #include<stdlib.h>
#include<iostream>
using namespace std;
struct node
{
int data;
struct node *next;
};
struct node * create_list()
{
struct node *temp=NULL,*head=NULL,*prev=NULL;
char ch;
do
{
prev=temp;
temp=(struct node *)malloc(sizeof(struct node));
if(temp!=NULL)
{
temp->next... | ALGO | 0.998686 | 3.757534 |
333335d6-6daa-4179-91dd-fda7e2d5acef | CoderSwarup/DSA_Mastery | 28_Graphs/3_Graph_Questions/15_Minimum_Spanning_Tree/2_Kruskal_Algorithm.cpp | #include <queue>
using namespace std;
#include<iostream>
#include <vector>
int FindParent(int u, vector<int> &parent){
if(u == parent[u])
return u;
return parent[u] = FindParent(parent[u], parent);
//this step for the path compression
}
void UnionByRank(int u, int v ,vector<int> &parent, vector<int> &rank){
... | ALGO | 0.999936 | 5.091646 |
72984fb2-a469-4ebe-b6a5-6cffee3b1707 | jiho5993/solving_algorithm | BOJ/16916.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef priority_queue<int> pqi;
#define fr(i, a, b) for(int i=a; i<b; i++)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define pt(a) cout << (a) << '\n'
#define pt1(a) cout << (a) << ' ... | ALGO | 0.999971 | 4.749297 |
62f491b5-0000-4d96-b50c-12e9be9851ff | adityarathore063/striver-dsa | Graph/biparitite_bfs.cpp | #include <bits/stdc++.h>
using namespace std;
bool bipartite_bfs(vector<int> adj[], int color[], int node)
{
queue<int> q;
q.push(node);
color[node] = 1;
while (!q.empty())
{
int src = q.front();
q.pop();
for (auto it : adj[node])
{
if (color[it] == -1)... | ALGO | 0.99999 | 5.452621 |
898c352f-3d5a-446e-a0f4-63ce144b9d7f | neelchoudhury/cp | Project Euler/Euler4.cpp | #include<iostream>
#include<cmath>
#define ll long long int
using namespace std;
ll checkpalin(ll n,ll m)
{
if(n<10 && m<10)
{
return 1;
}
else if(n<10 && m==10)
{
return 0;
}
else
{
return (n/m==n%10)&& checkpalin((n%m-n%10)/10,m/100);
}
}
int main()
{
ll cnt=0;
for(int i=999; i>=900; i--)
{
... | ALGO | 0.999471 | 3.158774 |
24c15101-43de-4321-8b3b-a3dbe0e5d410 | alvinnardo/licode | leetcode/790.v.cpp | #include "../template/head.h"
#include <bits/stdc++.h>
int numTilings(int n) {
// 思路:DP + 找规律
// 时间 O(n),空间 O(1)
// 从 4 开始就多了两个特殊的,两个角是 三个块 的,中间插入 两个块 的
int mod = 1e9 + 7;
long long a = 0, b = 0, c = 0, d = 0;
long long cnt = 0; // 统计之前的,用于后面计算特殊的
for (int i = 1; i <= n; i++) {
if ... | ALGO | 0.999978 | 5.463192 |
864a68f9-da44-420a-b7a8-ba8067fce667 | AkashKumarMaurya01/LEET-POTD | sliding window/1438LongestContinuousSubarrayWithAbsoluteDiffLessThanorEqualtoLimit.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
typedef pair<int,int>P;
int longestSubarray(vector<int>& nums, int limit)
{
int n = nums.size();
priority_queue<P> maxPq;
priority_queue<P, vector<P>, greater<P>> minPq;
int i =0;
int j =0;
... | ALGO | 0.99999 | 4.888182 |
fa1133d6-3ee2-4f99-8a33-354fa1d5d519 | raincross7/code-similarity | codes/train_code/problem052/problem052_174.cpp | #include <iostream>
#include <algorithm>
int main(int argc, const char *argv[]) {
std::string str;
std::cin >> str;
int q;
std::cin >> q;
std::string command, p;
int a, b;
for (int i = 0; i < q; i++) {
std::cin >> command >> a >> b;
if (command == "replace") {
st... | ALGO | 0.998509 | 4.944714 |
ca5566ba-c11f-42eb-9aaf-8f0502b5e1c1 | santi1475/asistenciaML | backend/entrenamientos opencv ruidos/opencv-master/modules/stitching/src/stitcher.cpp | #include "precomp.hpp"
namespace cv {
#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900/*MSVS 2015*/)
// Stitcher::ORIG_RESOL is initialized in stitching.hpp.
#else
const double Stitcher::ORIG_RESOL = -1.0;
#endif
Ptr<Stitcher> Stitcher::create(Mode mode)
{
Ptr<Stitcher> stitcher = makePtr<Sti... | TOOL | 0.88506 | 6.368211 |
9b31d854-d7be-440d-acd9-07104ac6f173 | wz2002zw/ROS_ROBOT | src/moveit2/moveit_ros/perception/lazy_free_space_updater/src/lazy_free_space_updater.cpp | /* Author: Ioan Sucan */
#include <moveit/lazy_free_space_updater/lazy_free_space_updater.h>
#include <rclcpp/logging.hpp>
#include <rclcpp/clock.hpp>
namespace occupancy_map_monitor
{
static const rclcpp::Logger LOGGER = rclcpp::get_logger("moveit.ros.perception.lazy_free_space_updater");
LazyFreeSpaceUpdater::Lazy... | ALGO | 0.967413 | 7.212962 |
292dcc2d-2def-4f2a-ab9e-26418892f8b0 | git2014yangyuan/leetcode | c++/reverse_words_in_a_string/main.cpp |
#include <string>
#include <vector>
using namespace std;
//http://baike.baidu.com/view/1005388.htm?fr=aladdin#4
//string &erase(int pos = 0, int n = npos);//删除pos开始的n个字符,返回修改后的字符串
//两次翻转 单词翻转 句子翻转
class Solution {
private:
void reverseStr(string& s, string::size_type left, string::size_type right)
{
while (left... | ALGO | 0.999787 | 4.687938 |
a95d61d0-a459-4ec9-a74e-4b3a758236f2 | fabsig/GPBoost | external_libs/compute/perf/perf_stl_reverse_copy.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);
}
int main(int argc, char *argv[])
{
perf_parse_args(argc, argv);
std::cout << "size: " << PERF_N << std::endl;
// create ve... | TOOL | 0.903834 | 5.296047 |
023f1b39-9640-4635-bed3-2437045a91f5 | tyler-vb/RushBoTT-ros2_ws | src/rushbott_common/rover_controller/src/odometry.cpp | /*
* Author: Tony Najjar
*/
#include "rover_controller/odometry.hpp"
namespace rover_controller
{
Odometry::Odometry(size_t velocity_rolling_window_size)
: x_(0.0),
y_(0.0),
heading_(0.0),
linear_speed_(0.0),
angular_speed_(0.0),
wheel_radius_(0.0),
modules_({}),
old_wheel_positions_(... | ALGO | 0.984724 | 6.811433 |
5c010faa-2c2b-46a2-b3fa-afb3670dd86e | Rexx0801/codeptit_c_cpp | dayconlientiepcotonglonnhat.cpp | #include <bits/stdc++.h>
using namespace std;
const int mod = 1e9+7;
using ll = long long;
void inp(int a[], int n)
{
for(int i = 0; i < n; i++)
cin >> a[i];
}
int main()
{
int t; cin >> t;
while(t--)
{
int n; cin >> n;
int a[n];
inp(a, n);
int sum = 0, ans = 0;
for(int i = 0; i < n; i++)
{
sum =... | ALGO | 0.999891 | 4.73503 |
c080c5b9-684c-424d-b07c-67cdc32b7405 | ujjwal-45/codeforces | A_Qunitomania.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl '\n'
#define forr(i,x,n) for (int i = x; i < n; ++i)
#define forr1(i,x,n) for (int i = x; i <= n; ++i)
#define all(a) a.begin(),a.end()
#define vi vector<int>
#define vvi vector<vector<int>>
#define fast ios_base::sync_with_stdio(0);cin.ti... | ALGO | 0.999753 | 4.790872 |
4b1b977f-7aca-4b80-ab71-3e345d095433 | adhyan-jain/CodeVault | C++/Day-079 - Inline Functions Prcatice/02.cpp | /*
Problem Statement
Suppose you are given a task to write a program that checks if a given number is an Armstrong number or not.
Additionally, if the number is an Armstrong number, the program should print its factors. Write a code for
the same using inline functions.
Function specifications:
inline bool isArmstr... | ALGO | 0.997453 | 6.486181 |
defc7c24-24bd-4a0b-8987-aeb801f900e9 | skku-swpc/gpu-mem-tracer | src/intersim2/networks/dragonfly.cpp | #include "booksim.hpp"
#include <vector>
#include <sstream>
#include "dragonfly.hpp"
#include "random_utils.hpp"
#include "misc_utils.hpp"
#include "globals.hpp"
#define DRAGON_LATENCY
int gP, gA, gG;
//calculate the hop count between src and estination
int dragonflynew_hopcnt(int src, int dest)
{
int hopcnt;
... | ALGO | 0.998937 | 4.851771 |
e21b7c29-9a05-465d-9765-b26f875c8385 | AdamRashid96/cs184-final-project | ext/nanogui/ext/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.986093 | 4.383477 |
7d940f97-3d38-4fa0-a6bc-c6692f8cbc19 | nikesh33/DSA | Week 3 Basics of Programming Level 2/Lec 2 Array/Revision/02_printAllPair.cpp | #include <iostream>
using namespace std;
int main()
{
// print all pair
int arr[] = {10, 20, 30};
int n = 3;
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
cout << arr[i] << ", " << arr[j] << endl;
}
}
} | ALGO | 0.957734 | 3.587126 |
6046ab83-54ad-4fbf-b01c-29205b218557 | shingst/ExaHyPE-Engine | ApplicationExamples/EulerFlow/EulerFlow_FV/MyEulerSolver.cpp | #include "MyEulerSolver.h"
// @todo Has to be included by generator
#include "MyEulerSolver_Variables.h"
#include "kernels/KernelUtils.h"
#include "InitialData.h"
#include "tarch/la/Vector.h"
void Euler::MyEulerSolver::init(const std::vector<std::string>& cmdlineargs,const exahype::parser::ParserView& constants) {
}... | ALGO | 0.999488 | 5.529839 |
b6510dd4-bf63-4a8f-9169-1478b43e907b | ishandutta2007/codeforces | sevlll777/normal/1470/D.cpp | #include <bits/stdc++.h>
#define pb push_back
// #define int long long
#define ld long double
using namespace std;
const int M = 998244353;
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int t;
cin >> t;
while (t--) {
int n, m;
cin >> n >> m;
... | ALGO | 0.999969 | 5.52099 |
9b88648c-a34a-475e-8153-0bb01a1ff719 | openkylin/webkit2gtk | Source/JavaScriptCore/b3/air/AirLowerMacros.cpp | #include "config.h"
#include "AirLowerMacros.h"
#if ENABLE(B3_JIT)
#include "AirCCallingConvention.h"
#include "AirCode.h"
#include "AirEmitShuffle.h"
#include "AirInsertionSet.h"
#include "AirPhaseScope.h"
#include "B3CCallValue.h"
#include "B3ProcedureInlines.h"
#include "B3ValueInlines.h"
namespace JSC { namespac... | TOOL | 0.873286 | 6.622746 |
71a278d2-155d-47a7-b0e5-4de4cff56d1c | pkjmesra/FaceDetection-FaceRecognition | FaceDetection/FaceRecognition/ThirdParty/OpenCV/modules/contrib/src/ba.cpp | #include "precomp.hpp"
#include "opencv2/calib3d/calib3d.hpp"
#include <iostream>
using namespace cv;
LevMarqSparse::LevMarqSparse() {
Vis_index = X = prevP = P = deltaP = err = JtJ_diag = S = hX = NULL;
U = ea = V = inv_V_star = eb = Yj = NULL;
num_cams = 0, num_points = 0, num_err_param = 0;
num_cam_par... | ALGO | 0.99852 | 4.695643 |
f1071b30-cf1c-47a5-ae55-1169e07b27c3 | AJinks28/LeetCode | 2104-sum-of-subarray-ranges/2104-sum-of-subarray-ranges.cpp | class Solution {
public:
void findne(vector<int>& arr,vector<int>& nse,vector<int>& nge){
int n=arr.size();
stack<int> st1,st2;
for(int i=n-1;i>=0;i--){
while(!st1.empty() && arr[st1.top()]>=arr[i]) st1.pop();
if(st1.empty()) nse[i]=n;
else n... | ALGO | 0.999983 | 5.12553 |
ba1a69f7-dfaf-4dcc-a150-ddffc6f07cbc | SohamDuttae/klinker | Alphastar/CC41B/Dynamic Programming on a Multidimension Array/hpsgold.cpp | #include <bits/stdc++.h>
using namespace std;
//i swear not doing usaco for a week has got be a bit rusty
//getting ready to say goodbye to my long haircut in a week
//gold here i come, praise be to brian dean
//calculates the result of each game. H = 0, P =1, S =2. Returns 0 if FJ win, 1 if Bessie wins.
int bw(int f, ... | ALGO | 0.999866 | 3.951296 |
e113f989-8e89-481e-91cd-abdbe06baed5 | parksandrecs/cvfd | opencv/modules/dnn/src/ocl4dnn/src/ocl4dnn_softmax.cpp | #include "../../precomp.hpp"
#include <vector>
#include "../include/common.hpp"
#include "../include/ocl4dnn.hpp"
#include "opencl_kernels_dnn.hpp"
namespace cv { namespace dnn { namespace ocl4dnn {
template<typename Dtype>
OCL4DNNSoftmax<Dtype>::OCL4DNNSoftmax(OCL4DNNSoftmaxConfig config)
{
softmax_axis_ = config... | ALGO | 0.991317 | 6.738354 |
10d6124f-ee09-46a0-8cd7-849c3171e2f8 | encodeshohan/Data-Structure-Lab | 22, Nov DS LAB/problem-2.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node{
int data;
struct Node* next;
};
struct Node * head = NULL;
void push(int value){
struct Node *n1;
n1 = new Node();
n1->data = value;
n1-> next = NULL;
if(head == NULL){
head = n1;
}
else{
n1->next = head;
... | ALGO | 0.999646 | 4.564879 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.