uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
007a441d-af8c-4cd6-a60d-4f1daf61c145 | qw-Zhang/data_structure_deng | BinaryTree/BinTree_test.cpp | #include "BinTree.h"
#include <iostream>
// template <typename T>
// static void visit(T &x)
// {
// std::cout << x << " ";
// }
int main(void)
{
BinTree<int> b;
b.insertAsRoot(0);
b.insertAsLC(b.root(),100);
b.insertAsRC(b.root(),101);
b.insertAsRC(b.root()->lc,102);
BinNodePosi(int) temp... | ALGO | 0.998083 | 4.698886 |
9aeec96a-5694-410e-82a7-a07328c71f65 | kaihchang/things_you_need_to_make_sweep_bling_LP | qmk_files/full_source/lib/chibios-contrib/ext/mcux-sdk/devices/LPC824/mcuxpresso/startup_lpc824.cpp | #if defined (DEBUG)
#pragma GCC push_options
#pragma GCC optimize ("Og")
#endif // (DEBUG)
#if defined (__cplusplus)
#ifdef __REDLIB__
#error Redlib does not support C++
#else
//*****************************************************************************
//
// The entry point for the C++ library startup
//
//********... | CONFIG | 0.888109 | 7.498006 |
b5db0eef-520c-46ca-8cb0-880609936394 | yyytir777/Codes | C++/Baekjoon/2470.cpp | // 2470 cpp
#include <bits/stdc++.h>
#define ll long long
using namespace std;
typedef pair<int, int> Pair;
int n;
vector<ll> liquid;
vector<pair<ll, Pair>> minCandidate;
void input() {
cin >> n;
ll temp;
for(int i = 0; i < n; i++) {
cin >> temp;
liquid.push_back(temp);
}
}
bool com... | ALGO | 0.999991 | 4.244369 |
b17ba151-1873-4f6b-8b13-ce49d712ae71 | 3xp10it3r/LeetcodeByDG | Google-Interview-Preparation_PREMIUM/312-burst-balloons/burst-balloons.cpp | class Solution {
public:
int rec(int i, int j, vector<int>& nums, vector<vector<int>>& dp) {
if(i > j) return 0;
if(dp[i][j] != -1) return dp[i][j];
int mx = 0;
for(int k = i; k <= j; k++) {
int burst = nums[k] * nums[i-1] * nums[j+1] + rec(i, k-1, nums, dp) + rec(k ... | ALGO | 0.999987 | 5.245998 |
f9b7ad6c-271a-490f-a05a-d21f00e346ba | amonbansod/SE-OOP-LAB-ASSIGNMENTS | oop12.cpp | #include<iostream>
using namespace std;
#include<deque>
int main()
{
deque<int>dq;
int ch,element;
go:
cout<<"\n1>INSERT AT END";
cout<<"\n2>INSERT AT FRONT";
cout<<"\n3>DELETE AT END";
cout<<"\n4>DELETE AT FRONT";
cout<<"\n5> DISPLAY FRONT ELEMENT";
cout<<"\n... | ALGO | 0.912298 | 3.649166 |
e4901d2f-d3ae-429a-a20b-d072b46c016a | thegamer1907/Code_Analysis | Implementation/8.cpp | #include <iostream>
#include <iomanip>
#include <map>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <ctime>
#include <cassert>
using namespace std;
typedef long long ll;
const int MAXN = 22;
int N, M;
int orr[MAXN][MAXN];
int arr[MAXN][MAXN];
vector <vector <int> > moves;
vector <... | ALGO | 0.999984 | 3.535687 |
7393bd70-4441-40c6-a9f4-8a1078c0e9d7 | raincross7/code-similarity | codes/train_code/problem344/problem344_175.cpp | #include <iostream>
#include <set>
#include <queue>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
#include <numeric>
#include <functional>
using namespace std;
#define ALL(x) ... | ALGO | 0.999889 | 3.405631 |
f68e8a4b-f227-4f65-abe4-b27db139c803 | DPrinceKumar/HacktoberFest2020-1 | C/tic_tac_toe_game.cpp | #include<bits/stdc++.h>
using namespace std;
void draw_board(char[]);
int check_winner(char[]);
int check_double(char[]);
int main()
{
int i;
char sign;
int win;
char board[9]={'1','2','3','4','5','6','7','8','9'};
for(i=0;i<9;i++)
{
win=check_winner(board);
if(win==1)
{
sy... | ALGO | 0.999825 | 4.501741 |
eec5b75e-5da5-460e-a57f-6ed76520043c | byGeek/learning_cpp | src/CPPLearning/sync_app/sync_app.cpp | #include <Windows.h>
#include <process.h>
#include <cstdio>
CRITICAL_SECTION g_cs;
long g_sum = 0;
SRWLOCK g_srwlock;
void cleanup_resource() {
DeleteCriticalSection(&g_cs);
//there is no delete function to SRWLOCK
}
unsigned __stdcall thread_process(void *pvoid) {
auto thread_id = GetCurrentThreadId();
prin... | TOOL | 0.870526 | 4.250722 |
f9094116-d168-4826-92bd-af00987e2cfb | s-spillias/EMs-with-LLMs | POPULATIONS/POPULATION_0005/BROKEN/INDIVIDUAL_GHZFZZK4/model.cpp | #include <TMB.hpp>
template<class Type>
Type objective_function<Type>::operator() ()
{
// Data
DATA_VECTOR(Year); // Time series years
DATA_VECTOR(sst_dat); // Sea surface temperature (°C)
DATA_VECTOR(cotsimm_dat); // COTS larval immigration (individuals/m2/year)
DATA_VE... | ALGO | 0.997925 | 6.322699 |
f7d74ad2-3f7d-4f41-84b4-78c8fc6ffafa | Shauryagoyal04/ChessEngine-Gacrux | io.cpp | #include<iostream>
#include "defs.h"
#include<cstdio>
using namespace std;
char *PrSq(const int sq) {
static char SqStr[3];
int file = FilesBrd[sq];
int rank = RanksBrd[sq];
sprintf(SqStr, "%c%c", ('a'+file), ('1'+rank));
return SqStr;
}
char *PrMove(const int move) {
static char MvStr[6];
int ff = Files... | ALGO | 0.992297 | 3.731539 |
92410eff-f349-4c63-8b3d-587c6e4e64c7 | Ishanbhatia98/codechef | may_challenge_2021_div2/_ISS.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
int n = 4e6 + 5;
int phi[n], ans[n];
for (int i = 0; i < n; i++)
{
phi[i] = i;
ans[i] = 0;
}
for (int p = 2; p < n; p++)
{
if (phi[p] == p)
{
... | ALGO | 0.999545 | 3.721003 |
f8d6b3ed-fa8d-41bd-b9a6-b21e57dbc5e6 | DaryusOctavian/CP | other/memes/meme009/typetest.cpp | #include <bits/stdc++.h>
using namespace ::std;
#define LSOne(S) (S & (-S))
int N;
double dist[20][20], memo[1 << 16];
double dp(int mask) {
double &ans = memo[mask];
if (ans > -0.5)
return ans;
if (mask == 0)
return ans = 0;
ans = 1e9;
int two_pow_p1 = LSOne(mask);
int p1 = __builtin_ctz(two_pow... | ALGO | 0.999612 | 3.988369 |
4585fad9-e71c-41e1-8c52-d829ad10359f | davidyslu/LeetCode | LC-888/LC-888.cpp | #include <string>
#include <vector>
#include <set>
using namespace std;
class Solution {
public:
/**
* Concepts: Solve Equation
* Suppose SA is the number of total candy Alice has
* SB is the number of total candy Bob has
* x is the number of candy Alice gives to Bob
* ... | ALGO | 0.999994 | 6.038742 |
2973605d-310a-423f-a0d7-2218216e6c58 | AshutoshKumar0206/LeetCode | 435-Non-overlapping-Intervals.cpp | class Solution {
//Tabulation and Binary Search
private:
int findNextMin(int i, int n, vector<vector<int>>&intervals){
int l = i, r = n;
while(l+1<r){
int m = l+(r-l)/2;
if(intervals[m][0] < intervals[i][1]){
l = m;
}
else{
... | ALGO | 0.999922 | 6.079596 |
f2a21785-adbd-4caa-9d3a-65bb8f94c336 | ShingoHosoda/console-app-cpp | app/letter/processing/isContainNumber.cpp | /*********************************
* 数字が含まれているとは
*********************************/
#include <iostream>
#include <cassert>
using char8 = char; // UTF-8の文字型
/// @brief UTF-8の文字を文字コードに変換する。
/// @param character UTF-8の文字。
/// @return UTF-8の文字コードを返します。
[[nodiscard]]
constexpr int convertCharToCharCode(const char8 charact... | ALGO | 0.965795 | 5.516997 |
39fb9e2e-9154-4773-b6c7-80ee0812fbdd | Monal-Patel/amrsolver | lib/boost/libs/geometry/doc/index/src/examples/rtree/iterative_query.cpp | //[rtree_iterative_query
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/geometries/box.hpp>
#include <boost/geometry/index/rtree.hpp>
// just for output
#include <iostream>
namespace bg = boost::geometry;
namespace bgi = boost::geometry::index;
int main()
{
... | ALGO | 0.999912 | 6.273703 |
ff5f52b4-bdea-4609-8c9e-a9bfa72440d1 | alexandraback/datacollection | solutions_5686275109552128_1/C++/Aliaksei/B.cpp | #include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <fstream>
#include <cmath>
#include <fstream>
using namespace std;
int main()
{
freopen("in", "r", stdin);
freopen("out", "w", stdout);
int T;
cin >> T;
for(int tk = 0; tk < T; ++tk)
{
int n;
cin >> n;
vector<int> v(n);
f... | ALGO | 0.999861 | 3.56051 |
5d02a7fe-71f2-4d12-a02f-137921888ffc | vishal-g17/DSA | C++ DSA/DP/Longest_AP_with_given_difference.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define vi vector<int>
#define vll vector<long long int>
//rec
int solve(int index, int diff, int A[]){
//backward check
if(index < 0){
return 0;
}
int ans =0;
for(int j = index-1; j>= 0; j--){
if(A[index] - A... | ALGO | 0.999945 | 4.252616 |
e4324701-fddd-493e-822a-3422ea7a0351 | subhoweb/JAVA-C-QS-PRATICE | Perfect Number.cpp | #include<stdio.h>
int main(){
int i,n=15,sum=0;
for(i=1;i<n;i++)
{
if(n%i==0)
{
sum = sum + i;
}
}
if(sum==n)
{
printf("Number is a Perfect");
}
else
{
printf("Number is not a Perfect");
}
return 0;
}
| ALGO | 0.999545 | 3.866899 |
f71b8aef-1740-42b1-97f6-77598131546d | saalim24/cp | B_Deja_Vu.cpp | #include <bits/stdc++.h>
using namespace std;
#define line '\n'
#define all(a) a.begin(), a.end()
#define get(_24) \
int _24; \
cin >> _24
#define gett(_08, _09) \
int _08, _09; \
cin >> _08 >> _09
#define gettt(_10, _11, _12) \
int _10, _11, _12; \
cin >> _10 >> _11 >> _12
using... | ALGO | 0.999706 | 3.623796 |
68ad6ccf-3b28-49ba-9d90-32d2fcc8bc34 | Khushboo-Baheti/coding-problems | identicaltree.cpp | #include <stdio.h>
#include <stdlib.h>
/* A binary tree node has data, pointer to left child
and a pointer to right child */
struct node
{
int data;
struct node* left;
struct node* right;
};
/* Helper function that allocates a new node with the
given data and NULL left and right pointers. */
struc... | ALGO | 0.997443 | 5.25294 |
62a085c9-8ae6-42bb-a4c2-630d7e5a3123 | Nolara/CP | Blatt7/Aufgabe2.cpp | #include <iostream>
#include <Eigen/Dense>
#include <math.h>
#include <fstream>
#include <vector>
#include "profiler.h"
using namespace std;
using namespace Eigen;
//Funktion zur Kraft
//c wird zum Zählen der Funktionsaufrufe verwendet
VectorXd f(VectorXd x, VectorXd v, double a, int &c) {
c +=1;
return -x-a*v;
}
... | ALGO | 0.999811 | 4.57176 |
d66fa140-52a1-4082-97a7-4f1d75b0c986 | raincross7/code-similarity | codes/train_code/problem070/problem070_250.cpp | /**
* created: 07.07.2020 14:35:26
**/
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// using bint = boost::multiprecision::cpp_int;
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s);... | ALGO | 0.997408 | 4.506358 |
904bf4a8-e6af-4393-a2ec-6470670d6789 | integralcoderr/programs | 7pointer.cpp/2workingofpointer.cpp | #include<iostream>
using namespace std;
int main()
{
int *pc,c;
c=5;
cout<<"address of c(&c)"<<&c<<endl;
cout<<"value of c (c):"<<c<<endl<<endl;
pc=&c;//pointer pc holds the memory address of variable c
cout<<"address that pointer pc holds(pc):"<<pc<<endl;
cout<<"content of the address point... | ALGO | 0.968902 | 3.310402 |
519d209f-c0b3-4b4e-a072-6820effe220c | Sunnyjha007/LeetCode---Daily-Challenge | March/Day_23_Number of Operations to Make Network Connected.cpp | class Solution {
private:
void bfs(vector<int> adj[],vector<bool>& visited,int sv){
queue<int> pn;
pn.push(sv);
while(!pn.empty()){
int front = pn.front();pn.pop();
for(auto i:adj[front]){
if(!visited[i]){
visited[i] = 1;
... | ALGO | 0.999951 | 5.787233 |
0ef60b95-0a60-4442-b289-56dc09b56b84 | cnsuhao/cppcode | C++Primer/6/stl-arr-fcns.cpp | #include <iostream>
using std::endl; using std::cout;
// prints a null-terminated array of characters
void print(const char *cp)
{
if (cp) // if cp is not a null pointer
while (*cp) // so long as the character it points to is not a null character
cout << *cp++; // print the character and advance the p... | TOOL | 0.871443 | 4.346204 |
1dd4a0a8-04ad-46c8-8200-6ce1113d10ad | tmorajk/dsa | cpp/ArrayNesting.cpp | #include <iostream>
#include <unordered_set>
#include <vector>
using namespace std;
int arrayNesting(vector<int>& nums) {
unordered_set<int> set;
int n = nums.size();
int next_index = 0;
set.insert(nums[next_index]);
next_index = nums[next_index];
while(next_index < n && set.find(nums[next_ind... | ALGO | 0.999852 | 5.4616 |
a9a485f1-31ff-4516-a7e2-05fae39875b3 | bobowang2333/FSE19 | LLVM/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp | #include "InstCombine.h"
#include "llvm/Analysis/ConstantFolding.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/PatternMatch.h"
using namespace llvm;
using namespace PatternMatch;
#define DEBUG_TYPE "instcombine"
Instruction *InstCombiner::commonShiftTransforms(... | TOOL | 0.984355 | 4.586883 |
3b87fa9f-4917-4b83-9d94-9c5fa4883b8f | ahmedhosssam/competitive-programming | UVA/UVA-408.cpp | #include <iostream>
#include <iomanip>
#include <string>
#include <cstring>
#include <algorithm>
#include <vector>
#include <stack>
#include <cmath>
using namespace std;
#define int long long
using namespace std;
int32_t main() {
int step=0 , mod=0,c=1,num=0;
while(cin>>step>>mod){
c=1;
while(... | ALGO | 0.998277 | 3.415235 |
1a64431a-84e1-4767-a5e9-1fe84807b78f | md-qubais/DSA_solved_questions | leetcode_word_pattern.cpp | class Solution{
public:
bool wordPattern(string pattern, string s){
unordered_map<string,char> mapping1;
unordered_map<char,string> mapping2;
vector<string> strings;
s+=" ";
string temp="";
for(int i=0;i<s.length();i++){
if(s[i]==' '){
strings.push_back(temp);
temp=... | ALGO | 0.99973 | 5.9798 |
c5d20c29-c259-4613-aea8-77b1a4c83124 | jash13desai/leetcode | 951-1000/961-970/967. Numbers With Same Consecutive Differences.cpp | class Solution {
public:
int digits(int x) {
int count = 0;
while(x){
count++;
x = x/10;
}
return count;
}
void findNumbers(int curr, int n ,int k, vector<int> &a){
if(digits(curr) == n){
a.push_back(curr);
return;
}
... | ALGO | 0.999819 | 6.553378 |
5da4f221-36d2-4f5b-8c24-f2950da74b0d | Allusernameswerenotavailable/Chapter4---Polynomial | Chapter4/main.cpp | #include <iostream>
#include <string>
#include <algorithm>
#include "input.h"
#include "Polynomial.h"
using namespace std;
int menuOption();
void Polynomials();
int main()
{
do
{
switch (menuOption())
{
case 0: exit(0); break;
//case 1: Quadratic(); break;
//case 2: Pseudo(); break;
case 3: Polynomia... | TOOL | 0.891658 | 3.083973 |
a149913e-f0d5-493c-bda5-faf32c202595 | Ducktape10/Minesweeper-CPP | src/RevealNulls.cpp | #include "GetNearFields.h"
#include "MatrixObject.h"
using namespace std;
void revealNulls(int x, int y, matrixObject **matrix, int width, int height) {
matrix[x][y].isVisible = true;
int **nearFields = getNearFields(x, y, width, height);
for (int i = 0; i < getLengthOfFieldPointer(x, y, width, height); ++i) {
... | ALGO | 0.97237 | 4.616925 |
40feee1b-8915-45d8-9a76-579ef0235e47 | ARNOB663/LeetCode-Solutions | Hasing/character_hasing.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
//'a' =>97
//'z' =>122
string s;
cin>>s;
//pre calculation
//only for small letters
int hash[26] = {0};
for(int i=0;i<s.size();i++)
{
hash[s[i] - 'a']++;
}
int q;
cin>> q;
//query ... | ALGO | 0.999603 | 4.159853 |
a7293552-a6ce-4228-b3c5-594d2be00cee | kundan816/DSA1 | IntegerToRoman.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
string intToRoman(int num) {
vector<int> val{1000 , 900 , 500 , 400 , 100 , 90 , 50 , 40 , 10 , 9 , 5 , 4 ,1};
vector<string> sym{"M" , "CM" , "D" , "CD" , "C" , "XC","L" , "XL" , "X" , "IX" , "V" , "IV" , "I"};
strin... | ALGO | 0.999548 | 5.821446 |
6fc21f1c-461a-4b71-9d97-7b9d11d0dc19 | LaBlazer/skoolshit | Algoritmy11-26/Algoritmy11-26/Source.cpp | #ifndef __PROGTEST__
#define pause system("pause");
#else
#define pause;
#endif
#include <iostream>
#include <ctime>
#include <random>
//template <size_t size>
//void bubble_sort(int(&arr)[size]) {
// bool cont_flag = true;
// for (int i = 0; i < (size - 1) && cont_flag == true; i++) {
// if (arr[j] > arr[j + 1])... | ALGO | 0.993756 | 4.807892 |
41f8adfb-6637-4ef9-a9f6-20537083cf28 | prince2520/Data-Structure-and-Algorithm | Number Theory Basics/prime_number_sieve.cpp | #include <iostream>
using namespace std;
void prime_sieve(int p[1000]){
// first mark all odd number's prime
for(int i = 3; i <= 1000; i += 2){
p[i] = 1;
}
for(int i = 3; i <= 1000; i += 2){
if(p[i] == 1){
for(int j = i*i; j<=1000; j = j + i){
p[j] = 0;
}
}
}
// special case
p[2] = 1;
p[1] ... | ALGO | 0.999918 | 3.934791 |
34d8bce8-466e-4966-8093-6904b8a5afa1 | agath0/Programming | elementary/17.cpp | #include <iostream>
using namespace std;
int main()
{
int n,rev=0,rem;
cout<<"\nEnter a number : ";
cin>>n;
cout<<"\nReversed Number: ";
while(n!=0)
{
rem=n%10;
rev=rev*10+rem;
n/=10;
}
cout<<rev<<endl;
return 0;
}
| ALGO | 0.99931 | 3.881876 |
faecbf1b-3f89-4aa2-804a-611c3c420852 | mailatkaushal/Leetcode-Solutions | Heap/heap.cpp | #include <bits/stdc++.h>
using namespace std;
class Heap {
public:
vector<int> A;
void insert(int val) {
A.push_back(val);
int i=A.size()-1;
while (i>0) {
int par=(i-1)/2;
if (A[i]>A[par]) {
swap(A[i],A[par]);
i=par;
}
... | ALGO | 0.999522 | 4.329851 |
fdc5bda6-4f90-43d1-9ad3-679e6ded9ac8 | ashutosh-singh83/DSA | Some other questions/radixsort.cpp | #include<iostream>
#include<vector>
using namespace std;
void countsort(vector<int> &v,int pos){
int n=v.size();
//freq array
vector<int> freq(10,0);
for(int i=0;i<n;i++){
freq[(v[i]/pos)%10]++;
}
//calc cumulative frequency
for(int i=1;i<10;i++){
freq[i]+=freq[i-1];
... | ALGO | 0.99989 | 5.379193 |
614ab03e-4b13-41d0-9fb9-2b33fb846a49 | rko0211/codeforces-question-solve | left_right.cpp | #include <bits/stdc++.h>
using namespace std;
void solve()
{
int n;
cin >> n;
string s;
cin >> s;
int ans = 0;
int mid = n / 2 + n % 2;
int zero = 0;
for (int i = 0; i < n; i++)
{
if (s[i] == '0')
{
zero++;
if (zero == 0)
{
if (abs(mid - (i)) < abs(mid - ans))
... | ALGO | 0.999934 | 4.893897 |
c8eeaae3-674e-43da-a308-4f7c177509ef | haozha111/algo | 234.cpp | #include "leetcode.h"
using namespace std;
class Solution {
public:
bool isPalindrome(ListNode* head) {
return isPalindrome1(head);
}
bool isPalindrome1(ListNode* head) {
ListNode dummy(0), *slow = &dummy, *fast = &dummy;
dummy.next = head;
while (fast and fast->next) {
fast = fast->next-... | ALGO | 0.999889 | 5.80661 |
83a4fa58-4b6d-4ed8-bb13-e8d1390c0b92 | AsmiAd/Number-Checker | 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.998757 | 6.771107 |
555bd764-56d3-4b6f-b00b-e314439f1382 | ahmadbingulzar/Basic-C--Practice | Data structure-20220627T122727Z-001/Data structure/Array ADT/program10.cpp | // Fast method to find missing element in an array
#include <iostream>
using namespace std;
struct Array
{
int A[10];
int size;
int length;
};
void missing(Array *arr1)
{
int length = arr1->length;
Array *Hash_array = new Array[17];
for (int i = 0; i < 17; i++)
{
int j = arr1->A[i];... | ALGO | 0.984533 | 4.708971 |
3c39684b-fa18-49f9-aeda-26e7d832750e | rahuljat1349/DSA-CPP | 51.SudokuSolver.cpp | #include <iostream>
#include <vector>
using namespace std;
bool isSafe(vector<vector<char>> &board, int row, int col, char dig)
{
for (int i = 0; i < 9; i++)
{
if (board[i][col] == dig)
{
return false;
}
}
for (int i = 0; i < 9; i++)
{
if (board[row][i] ... | ALGO | 0.999845 | 6.460204 |
1ee19a19-f688-45e1-8d0a-00905e5b1e10 | fmesena/Matroid_Intersection | oracles/LeftMatching.cpp | #include "LeftMatching.h"
LeftMatching::LeftMatching(int N_, vector<Edge> edges_):Oracle() {
N = N_;
edges = edges_;
left = vector<int>(N_,0);
}
bool LeftMatching::Free(int b) {
ORACLE_CALLS++;
FREE_CALLS++;
return left[edges[b].u]==0;
}
bool LeftMatching::Exchangeable(int a, int b) {
ORACL... | ALGO | 0.999715 | 3.869599 |
dd75806c-10cd-4ff7-9358-894e6209f7f6 | sultancodess/leetcode- | C++/reordered-power-of-2.cpp | // Time: O((logn)^2) = O(1) due to n is a 32-bit number
// Space: O(logn) = O(1)
class Solution {
public:
bool reorderedPowerOf2(int N) {
vector<int> count = counter(N);
for (int i = 0; i < 31; ++i) {
if (count == counter(1 << i)) {
return true;
}
}
... | ALGO | 0.999661 | 6.41387 |
47c61e26-d2e3-4a9c-932e-921b5ac64878 | MAJIN123/clion | BinaryInsertSort/main.cpp | #include <iostream>
//稳定排序,O(nlogn)
using namespace std;
void BinaryInsertSort(int a[],int len){
for(int i=1;i<len;++i){
int low=0,high=i-1,temp;
temp=a[i];
while(low<=high){
int middle=(low+high)/2;
if(temp<=a[middle]){
high=middle-1;
}
... | ALGO | 0.999973 | 4.769724 |
0d54ddff-4497-4d78-8d70-6e3b4b92696b | rohanblueboybaijal/SLAM_Book | ch7/pose_estimation_2d2d.cpp | #include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/calib3d/calib3d.hpp>
void findFeatureMatches(const cv::Mat &img_1, const cv::Mat &img_2, std::vector<cv::KeyPoint> &keypoints_1, std::vector<cv::KeyPoint> &keypoint... | ALGO | 0.984938 | 6.035048 |
9b185135-bcba-4401-b44f-403bad530108 | durgaprasad-sahoo/my-dsa-track | Stack-and-queues/next-greater-element(non-circular-array).cpp | class Solution {
public:
vector<int> nextGreaterElement(vector<int>& nums1, vector<int>& nums2) {
int n = nums1.size();
int m = nums2.size();
unordered_map<int, int>mp;
stack<int>st;
for(int i=m-1; i>=0; i--){
if(st.empty()){ // if stack is empty, means there's n... | ALGO | 0.999964 | 5.665826 |
90e40b4d-eb5d-4f40-a928-618cb3316a1c | Jordaninacap02/Supermarketapp | 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.998799 | 6.776823 |
7813dcf9-a659-48d9-b70f-3d099070dbd2 | ishandutta2007/codeforces | halyavin/normal/671/B.cpp | #ifdef __GNUC__
#pragma GCC target("sse4,avx")
#endif
#include <immintrin.h>
#include <algorithm>
#include <string>
#include <iostream>
#include <vector>
#include <cstdint>
#include <numeric>
void run(std::istream &in, std::ostream &out) {
int n, k;
in >> n >> k;
std::vector<int64_t> as(n);
for (int i = 0; i <... | ALGO | 0.999964 | 3.975176 |
7a2d0587-5e95-47e0-a889-ae0d5008f711 | 1105Lakshya/DSA-TOPIC-WISE | 10_recursion/REVERSE_STRING.cpp | #include<iostream>
using namespace std;
void reverse(string& str,int i,int j){ //CALL BY REFERENCE NOT CALL BY VALUE
if(i>j)
return ;
swap(str[i],str[j]);
i++;
j--;
reverse(str,i,j);
}
int main(){
string str="deepika baby";
reverse(str,0,str.length()-1);
cout<... | ALGO | 0.999782 | 4.500011 |
f29b73c7-bb45-4331-9cd9-0c6f3853ce8f | devmentality/cpp-ft201-2019 | Task 1/shemyakina_daria.cpp | #include <iostream>
#include <ppltasks.h>
size_t MEMORY_SIZE = pow(2, 10);
template <typename T>
class Linear
{
void* start;
size_t offset;
size_t size;
size_t item_size;
public:
Linear()
{
start = malloc(MEMORY_SIZE);
size = 0;
item_size = sizeof(T);
offset = 0;
}
void push_back(T item)
{
void ... | TEST | 0.95354 | 4.378787 |
cd37e923-e730-41b9-a92c-d8868df65faa | javagovindsharma/leetscode | solution/0800-0899/0809.Expressive Words/Solution.cpp | class Solution {
public:
int expressiveWords(string s, vector<string>& words) {
auto check = [](string& s, string& t) -> int {
int m = s.size(), n = t.size();
if (n > m) return 0;
int i = 0, j = 0;
while (i < m && j < n) {
if (s[i] != t[j]) ret... | ALGO | 0.999927 | 6.133429 |
fe318837-669f-4f56-bc5d-f8deaa23aa30 | ptitSeb/ctp2 | ctp2_code/robotcom/goals/Goal_Chokepoint.cpp | #include "c3.h"
#include "civarchive.h"
#include "IMapPointData.h"
#include "ic3Rand.h"
#include "Agent.h"
#include "ArmyAgent.h"
#include "CityAgent.h"
#include "ic3GameState.h"
#include "aimain.h"
#include "Goal_Chokepoint.h"
#include "ailog.h"
#include "dr_debug.h"
#include "matrix.h"
#include "grassfire.h"
#in... | TOOL | 0.919081 | 4.610736 |
7af96818-455d-4ef4-96dc-8b096a64fc6c | heavenMOJANG/ICPC | .history/AtCoder/abc363/C_20240720201048.cpp | #pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
#define int long long
//using namespace std;
constexpr int inf=0x7fffffff;
int n,k;
string s;
signed main(){
cin.tie(0)->sync_with_stdio(0);
cin>>n>>k>>s;
return 0;
} | ALGO | 0.999702 | 3.609763 |
d39f8bf2-e80a-49d2-a471-6a981f7daec9 | TLacault/LeetCode | 412-fizz-buzz/fizz-buzz.cpp | class Solution {
public:
vector<string> fizzBuzz(int n) {
vector<string> answer(n);
for (int i = 1; i <= n; i++) {
if (i % 3 == 0) answer[i-1].append("Fizz");
if (i % 5 == 0) answer[i-1].append("Buzz");
if (i % 3 != 0 && i % 5 != 0) answer[i-1].append(to_string(i)... | ALGO | 0.999649 | 6.682799 |
b3030c1d-20a0-4ba9-93a5-3daa5901cb65 | iffa28/Quicksort_092 | Quick_sort/Quick_sort.cpp | #include <iostream>
using namespace std;
int arr[20]; //Array of integers to hold values
int cmp_count = 0; // number of comparasion
int mov_count = 0; //number of data movement
int n;
void input() {
while (true)
{
cout << "Masukkan panjang element array: ";
cin >> n;
if (n <= 20)
break;
else
co... | ALGO | 0.999085 | 4.178516 |
d7348284-6e8a-4526-b776-28db211aa374 | ishandutta2007/codeforces | rainair/normal/1019/D.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define db double
#define U unsigned
#define P std::pair<int,int>
#define LL long long
#define pb push_back
#define MP std::make_pair
#define all(x) x.begin(),x.end()
#define CLR(i,a) memset(i,a,sizeof(i))
#define FOR(i,a,b) for(int i = a;i <= b;++i)
#define ... | ALGO | 0.999904 | 3.072837 |
f2c85edc-234c-47f9-aefd-c2b80cad37da | thelazy/ContestCodes | Codeforces/Div2-371/c.cpp | #include <bits/stdc++.h>
#include <unordered_map>
using namespace std;
long long con(long long n){
long long t, mul=1; int temp;
t=0;
while(n>0){
temp = n%10; n = n/10;
if(temp%2==0){
mul = mul*10;
}
else{
t = t + mul;
mul = mul*10;
}
}
return t;
}
int main(){
long long q, n;
char c;
cin>>... | ALGO | 0.999917 | 4.056011 |
38073d6f-d05a-4bac-bcbf-9728b6cabfc7 | lasjg72/CompetetiveProgramming | program/Atcoder/ABC/ABC193/A.cpp | #include <iostream>
#include <algorithm>
#include <tuple>
#include <vector>
#include <string>
#include <queue>
#include <cmath>
#include <set>
#include <map>
#include <cassert>
using namespace std;
using ll = long long;
int main()
{
double a, b;
cin >> a >> b;
double x = b/a;
cout << (1-x)*100 << endl... | ALGO | 0.998287 | 3.688925 |
ceba6d32-fb1a-4ccf-b5ce-2b8aef028866 | maligir/temp | third_party/opencv/opencv/modules/photo/src/hdr_common.cpp | #include "precomp.hpp"
#include "opencv2/photo.hpp"
#include "hdr_common.hpp"
namespace cv
{
void checkImageDimensions(const std::vector<Mat>& images)
{
CV_Assert(!images.empty());
int width = images[0].cols;
int height = images[0].rows;
int type = images[0].type();
for(size_t i = 0; i < images.s... | TOOL | 0.981785 | 5.92583 |
cf4dc049-9a34-4474-8175-ce84519a7b1b | Arpit8789/Leetcode | 2308-divide-array-into-equal-pairs/2308-divide-array-into-equal-pairs.cpp | class Solution {
public:
bool divideArray(vector<int>& nums) {
unordered_map<int, int> freq;
for (int num : nums) {
freq[num]++;
}
for (auto& entry : freq) {
if (entry.second % 2 != 0) {
return false;
}
}
return tru... | ALGO | 0.999508 | 5.738337 |
d3b6bcd0-b770-4282-b14b-787c36de7674 | MatSciTools/HFCalc | boost_1_79_0/libs/compute/perf/perf_stl_rotate_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... | ALGO | 0.973757 | 5.557684 |
ec187ed0-4940-41b9-8d13-58b8a46ed6ec | himanshuraj-10/Recursion_Practice | charactercount.cpp | #include<iostream>
using namespace std;
int main()
{
char n;
string s;
cout<<"Enter the string : ";
getline(cin,s);
int count=0;
cout<<"Enter the character you want to search : ";
cin>>n;
for(int i=0;i<s.length();i++)
{
if(s[i]==n)
count++;
}
cout<<"No.of occ... | ALGO | 0.999643 | 4.083485 |
052696da-7b1e-43c0-8449-e05a09b93fc4 | quinnjo554/ForkAndPipe | src/Source/main.cpp | #include "Process.h"
#include "utils.h"
#include <chrono>
#include <cstddef>
#include <fstream>
#include <iostream>
#include <string>
#include <sys/wait.h>
#include <unistd.h>
bool isNewLine(char ch) { return ch == '\n' || ch == '\r'; }
int main() {
int total_result = 0;
int num_processes;
std::cout << "Enter t... | TOOL | 0.948115 | 4.480944 |
da937882-08eb-46c8-92d6-6b46f5c4ab00 | mental1104/cpp-primer | src/ch10/ex10_32.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <numeric>
#include "Sales_item.h"
int main()
{
std::istream_iterator<Sales_item> in_iter(std::cin), in_eof;
std::vector<Sales_item> vec;
while (in_iter != in_eof) vec.push_back(*in_iter++);
sort(vec.begin(), vec.en... | ALGO | 0.996833 | 5.890972 |
0a2b11f4-f0bc-4e7c-a76e-39efd89b93c6 | sumit58591/Leetcode-POTD | Leetcode_2094.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> findEvenNumbers(vector<int>& digits) {
vector<int> output;
unordered_map<int, int> mp;
for(int i = 0; i < digits.size(); i++) mp[digits[i]]++;
for(int i = 100; i < 999; i++) {
if(i % 2 != 0) continue;
unordered_map<int, int> temp... | ALGO | 0.999889 | 5.206073 |
1db3e6da-4304-4375-a193-6ece1cbe31c7 | sarvex/leetcode-assembly | solution/2100-2199/2194.Cells in a Range on an Excel Sheet/Solution.cpp | class Solution {
public:
vector<string> cellsInRange(string s) {
vector<string> ans;
for (char i = s[0]; i <= s[3]; ++i)
for (char j = s[1]; j <= s[4]; ++j)
ans.push_back({i, j});
return ans;
}
}; | ALGO | 0.99857 | 5.201117 |
ed9169ee-a7a1-4d16-ab17-8b0d25691ba2 | adambenali/Competitive-Programming | MCPC 2017/I.cpp | #include <bits/stdc++.h>
using namespace std;
double f_slow(int m){
double sm = 0;
unordered_set<int> D;
for (int i = 1; i < floor(pow(m, 0.5)) + 1; i++) {
D.insert(i);
D.insert((int) m / i);
}
for (auto p : D)
sm += p * (m / p - m / (p + 1));
return sm;
}
double f_fa... | ALGO | 0.999447 | 4.549044 |
64c7bdba-d655-4ff1-9e82-0dd00edf8150 | sabide/cpp | 01-C++_sans_les_classes/Projet/sol/main.cpp | #include <iostream>
#include <fstream> // Pour écrire dans des fichiers
#include <cmath>
// Paramètres du modèle de Lotka-Volterra
const double alpha = 1.0;
const double beta = 0.1;
const double gamma = 1.5;
const double delta = 0.075;
// Fonction pour la méthode d'Euler explicite
void euler_explicit(double h, int n... | ALGO | 0.999976 | 5.662559 |
cfbdd4c9-d4cc-477a-8f4c-c8ef9ce2a42b | arun1993/FPGA-Wireless-communication-blocks | CORDIC & Phase detector/phasedetector_optimized2/phasedetector.cpp | /*
Filename: phasedetector.cpp
Phase detector
INPUT:
I: signal for I sample
Q: signal for Q sample
OUTPUT:
R: Radius
Theta: Angle
*/
#include "phasedetector.h"
void phasedetector (
data_t I,
data_t Q,
data_t *R,
data_t *theta
){
#pragma HLS pipeline II=1
data_t X, Y;
data_t r, theta_t;
/... | ALGO | 0.997793 | 4.470133 |
523a9de0-9b01-4d3b-aca1-a42185d0c424 | yzzupgo/MFTCG | Data/abc206_a/Eto_420/wa/23572044.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
bool flag = false;
int main() {
int N;
cin >> N;
if(N * 1.08 < 206) {
cout << "Yay!" << endl;
} else if(N * 1.08 == 206) {
cout << "so-so" << endl;
} else {
cout << ":(" << endl;
}
}
| ALGO | 0.994937 | 3.680673 |
47918d8a-5fb7-4a3b-a53e-6eed579ef15b | AA-Hamza/RayTracing | main.cpp | #include "rtweekend.h"
#include "color.h"
#include "hittable_list.h"
#include "sphere.h"
#include "camera.h"
#include "material.h"
#include "ctpl_stl.h"
#include <vector>
#include <future>
#include <iostream>
color ray_color(const ray& r, const hittable& world, int depth) {
hit_record rec;
if (depth <= 0)
... | ALGO | 0.978323 | 5.035724 |
11ec0d44-2243-47dd-8510-f916e6efe5ff | JackLee2111/data-structure-algorithm1 | code/calculator/small projects/cal_arithmetic_int.cpp | #include <iostream>
#include <algorithm>
#include <string>
#include <stack>
using namespace std;
//后缀表达式求值(ver int)
long long cal_arithmetic(string str)
{
int len = str.length(), pos = 0;
stack<long long> sta;
char ch;
while (pos < len)
{
if (str[pos] >= '0' && str[pos] <= '9')
{
... | ALGO | 0.996318 | 3.725567 |
5ba5ecce-8d47-4fe1-9e53-13ddb99ca5a7 | KshshVrma/GFG_solutions | Difficulty: Easy/BFS of graph/bfs-of-graph.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
// Function to return Breadth First Traversal of given graph.
void bfs(vector<vector<int>>&adj, vector<int>&vis, int i, vector<int>&ans){
vis[i]=1;
queue<int>q;
... | ALGO | 0.999849 | 6.74447 |
2ea18894-8fea-49da-9776-94be29326145 | AbdelrhmanHisham/LeetCode | C++/557. Reverse Words in a String III/ReverseWordsinaStringIII.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
class Solution
{
public:
string reverseWords(string s)
{
string str = s;
int i = 0;
vector<int> vec;
while (s[i] != '\0')
{
if (s[i] == ' ')
{
vec.push_bac... | ALGO | 0.999928 | 5.064756 |
af2c3719-ed4c-47e9-ac7e-290230646054 | savagecarol/c- | virtual1/three.cpp | #include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
ll t;
cin>>t;
while(t--)
{
ll n;
cin>>n;
ll m;
cin>>m;
ll k=abs(n-m);
if(k==0)
{
cout<<0<<endl;
continue;
}
if(k>10)
... | ALGO | 0.999493 | 3.536533 |
9c50d2d3-f0a5-4e76-9917-f57a27b5bf1d | ttsoftware/hi | lib/dlib-19.13/dlib/test/global_optimization.cpp | #include <dlib/global_optimization.h>
#include <dlib/statistics.h>
#include <sstream>
#include <string>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <dlib/rand.h>
#include "tester.h"
namespace
{
using namespace test;
using namespace dlib;
using namespace std;
logger dlog("test.gl... | TEST | 0.884303 | 4.097484 |
5973de6d-d88b-4a8b-b141-8547ef760221 | sahilduhan/Placement_Prepration | graphs/replaceOwithX.cpp |
#include<bits/stdc++.h>
using namespace std;
class Solution{
public:
void dfs(vector<vector<char>>& mat, int n, int m, int i, int j){
if (i < 0 || j < 0 || i >= n || j >= m || mat[i][j] != 'O') return;
mat[i][j] = '*';
dfs(mat, n, m, i + 1, j);
dfs(mat, n, m, i, j + 1);
dfs... | ALGO | 0.99982 | 4.414987 |
93bb7554-3367-4e80-867e-14155dfef0bf | hyojin46/chapter10 | chapter10/예제10-12.cpp | //#include <iostream> //10-12
//#include <string>
//#include <map>
//using namespace std;
//
//int main() {
// map<string, string>dic;
//
// dic.insert(make_pair("love", ""));
// dic.insert(make_pair("apple", ""));
// dic["cherry"] = "ü";
//
// cout << " ܾ " << dic.size() << endl;
//
// string eng;
// while (true) {
/... | TOOL | 0.97077 | 3.688675 |
58f24bb1-6bb9-434b-b29a-faee823bf8a5 | BrainWen1/for-algorithm | 2.20 BFS.cpp | //P1443 马的遍历
#include <iostream>
#include <queue>
#include <iomanip>
#include <cstring>
const int N = 400 + 10;
int n, m, x, y;
int a[N][N];
//马的矩阵移动方向向量
int dx[] = { 2, 2, 1, 1,-1,-1,-2,-2 };
int dy[] = { 1,-1, 2,-2, 2,-2, 1,-1 };
void bfs()
{
std::queue<std::pair<int, int>> que;
que.push({x, y});
a[x][... | ALGO | 0.999738 | 4.058178 |
a3f81143-ddc5-4d47-aba8-ceed653cc975 | Annie78724/Leetcode | Distance of nearest cell having 1 - GFG/distance-of-nearest-cell-having-1.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find distance of nearest 1 in the grid for each cell.
vector<vector<int>>nearest(vector<vector<int>>grid)
{
// Code here
int n=grid.size(),m=grid[0].size();
vecto... | ALGO | 0.999955 | 6.206226 |
a7670011-94ce-4326-a6e2-d204604b99e6 | sanyamdtu/competitive_programming | codeforces/practice/dp/665C.cpp | #include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mod 1000000007
#define INF 1e18
typedef long long ll;
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
string s,ans;
cin>>s;
int n=s.length();
int a=0;
int c=1;
for(int i=0;i<n;i++){
if(i!=0&&s[i]=='a'+a%26){
c++... | ALGO | 0.99999 | 3.30055 |
d6b60060-7849-4411-9e5b-388990d66b35 | Amar6de2/GeeksForGeeks | Medium/Count Inversions/count-inversions.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
long long int inv=0;
// arr[]: Input Array
// N : Size of the Array arr[]
// Function to count inversions in the array.
void merge(long long arr[],int low,int mid,int high)//WE HAVE ... | ALGO | 0.999767 | 6.16057 |
5f5e6766-2b03-4bf0-b18c-6db52a7872e7 | fire855/android_frameworks_native-ferrari | opengl/libagl/vertex.cpp | #include <stdio.h>
#include <stdlib.h>
#include "context.h"
#include "fp.h"
#include "vertex.h"
#include "state.h"
#include "matrix.h"
namespace android {
// ----------------------------------------------------------------------------
void ogles_init_vertex(ogles_context_t* c)
{
c->cull.enable = GL_FALSE;
c-... | TOOL | 0.856784 | 6.111854 |
47a6c553-e8aa-4c6c-b04f-9f0378740cbd | koomiy/vnoid | src/stabilizer.cpp | #include "stabilizer.h"
#include "robot.h"
#include "rollpitchyaw.h"
#include "footstep.h"
namespace cnoid{
namespace vnoid{
Stabilizer::Stabilizer(){
min_contact_force = 1.0;
force_ctrl_damping = 0.0;
force_ctrl_gain = 0.0;
force_ctrl_limit = 0.0;
moment_ctrl_damping = 0.0... | ALGO | 0.998089 | 5.873516 |
4e5d07cf-e849-47de-816f-3860d964e988 | Log-in-off/leetcode | 138_copy_list_with_random_pointer/main.cpp | #include <iostream>
#include <cassert>
#include <vector>
#include <unordered_map>
/**
* https://leetcode.com/problems/copy-list-with-random-pointer/description/
* Definition for a Node.
*/
class Node {
public:
int val;
Node* next;
Node* random;
Node(int _val) {
val = _val;
next ... | ALGO | 0.935798 | 5.381142 |
6f98d4cb-5d42-4072-bc55-11f74d9cf425 | nono19972020/atcoder | code_fes/code_fes_2014_easy/c.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
using namespace std;
struct edge{long long to, cost;};
typedef pair<long long,long long> P;
struct graph{
long long V;
vector<vector<edge> > G;
vector<long long> d;
graph(long long n){
init(n);
}
void init(long long n){
V... | ALGO | 0.999978 | 4.036183 |
67b3280b-ab29-4f63-a262-e31eb96f5706 | ishandutta2007/codeforces | quang/normal/1254/B2.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1000010;
#define int long long
const long long INF = 1e18;
int n;
int a[N];
int b[N];
long long eval(vector<pair<int, int>> &u, long long k) {
long long curSum = 0;
int pos = 0;
for (int i = 0; i < u.size(); i++) {
curSum += u[i].first;... | ALGO | 0.999936 | 3.924829 |
c7b585bf-02a1-4ab8-b689-1bfdc467a0de | outrageousaddy76000/LeetCode-GeeksforGeeks | 1035-cousins-in-binary-tree/1035-cousins-in-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.999991 | 5.618309 |
90c6b4fb-c278-4297-90bc-f724100c3f95 | begatim/HPC_Project | Disjoint/eigen/lapack/svd.cpp | #include "lapack_common.h"
#include <Eigen/SVD>
// computes the singular values/vectors a general M-by-N matrix A using divide-and-conquer
EIGEN_LAPACK_FUNC(gesdd,(char *jobz, int *m, int* n, Scalar* a, int *lda, RealScalar *s, Scalar *u, int *ldu, Scalar *vt, int *ldvt, Scalar* /*work*/, int* lwork,
... | ALGO | 0.999495 | 5.512504 |
2325d5fb-e3c7-4fcc-a25d-35a07c8a7820 | yyytir777/Codes | C++/Baekjoon/1939.cpp | // 1939 cpp
#include <bits/stdc++.h>
#define MAX 10001
#define MAX_WEIGHT 1000000000
using namespace std;
typedef pair<int, int> Pair;
int n, m, s, e;
int max_weight = 0;
vector<Pair> graph[MAX];
queue<int> q;
bool visited[MAX] = {0,};
void input() {
cin >> n >> m;
int a, b, c;
for(int i = 0; i < m; i++) {
... | ALGO | 0.999974 | 4.164546 |
adae8100-59a2-4a7f-af5a-434a4424e357 | igor-pavkov/honours-2024 | Code Examples/DiverseVul Filtered/Secure/e41fd72acc7a06ce5a6a7d28154db1ffe8ba37a8-43.cpp | static int fixBoundingBox(Rtree *pRtree, RtreeNode *pNode){
RtreeNode *pParent = pNode->pParent;
int rc = SQLITE_OK;
if( pParent ){
int ii;
int nCell = NCELL(pNode);
RtreeCell box; /* Bounding box for pNode */
nodeGetCell(pRtree, pNode, 0, &box);
for(ii=1; ii<nCell... | ALGO | 0.998036 | 6.487319 |
d4149639-21e5-4e48-be77-d67af246463d | akash-1514/Contest_Prob_Techniques | Partitions with Given Difference - GFG/partitions-with-given-difference.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int mod = 1e9 + 7;
vector<vector<int>>dp;
int helper(vector<int>&arr, int idx, int k) {
if(idx >= arr.size()) {
return k == 0;
}
if(dp[idx][k] != -1) ret... | ALGO | 0.999918 | 6.544736 |
0c3de380-3903-4f1c-850f-d0162f822707 | trieuit2/NMPTG | Contra/Game_Collision.cpp | #include "Game_Collision.h"
#include "Game_ObjectBase.h"
#include "ScreenManager.h"
#include "debug.h"
Game_Collision* Game_Collision::__instance = NULL;
Game_Collision* Game_Collision::GetInstance()
{
if (__instance == NULL) __instance = new Game_Collision();
return __instance;
}
/*
SweptAABB
*/
void Game_Colli... | ALGO | 0.984629 | 4.878104 |
25c4f64d-a429-40bb-8018-51c7292c72ac | cho104/CP-practice | complete_search/bovine_genomics.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
freopen("cownomics.in", "r", stdin);
freopen("cownomics.out", "w", stdout);
int n, m;
cin >> n >> m;
vector<vector<char>> mat(0);
for (int n2 = 0; n2 < n * 2; n2++) {
strin... | ALGO | 0.999902 | 3.734504 |
466a393c-0ac3-4a79-b004-05941f8bd7d2 | AnumoyMurmu/pr0blem.solving.gfg.dsa | Tree/SizeOfBinaryTree.cpp | /*
Size of Binary Tree
Difficulty: BasicAccuracy: 82.91%Submissions: 57K+Points: 1
Given a binary tree of size n, you have to count the number of nodes in it. For example, the count of nodes in the tree below is 4.
1
/ \
10 39
/
5
Example 1:
Input:
1 2 3
Output:
3
Explanation:
Given Tree ... | ALGO | 0.99993 | 6.612675 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.