uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
35d4cc68-77a9-458b-9d54-03198ad6bfb5 | Nekdash/middle_l | itc_odd_even_separator_lst.cpp | #include "middle_list.h"
void itc_odd_even_separator_lst(const vector <int> &lst, vector <int> &lst1, vector <int> &lst2)
{
if(lst.size() > 0){
for(long long i =0; i < lst.size(); i++){
if(lst[i] % 2 == 0){
lst1.push_back(lst[i]);
}else{
lst2.push_back(lst[i]);
... | ALGO | 0.997044 | 4.879524 |
b1f4b79a-00e4-4f0e-b13d-5cac6740e502 | Hariom-Nagar211/Data-Structures-and-Algorithms | 65_Graph/7_MinMultiplicatinToReachEnd.cpp | #include <bits/stdc++.h>
using namespace std;
int MinMultiplication(vector<int> &arr, int start, int end)
{
{
int n = arr.size();
queue<pair<int, int>> q;
vector<int> dist(100000, INT_MAX);
dist[start] = 0;
q.push({start, 0});
while (!q.empty())
{
int node = q.fro... | ALGO | 0.999913 | 4.040664 |
f15000f6-bd0f-41e0-8624-f075e8fd1eb9 | andersfagerli/NTNU | TDT4102 - Procedural and Object-Oriented Programming/Templates/FLTK-template/FLTK-template/main.cpp | // Lec2Ex1c.cpp, an improvement of Lec2Ex1c.cpp
#include "Graph.h"
#include "Simple_window.h"
using namespace Graph_lib;
int max(vector<int> v) {
// assumes at least 1 element in v
int max = v[0];
for (unsigned int i = 1; i < v.size(); i++) {
if (v[i] > max) max = v[i];
}
return max;
}
int... | ALGO | 0.995127 | 4.949509 |
48ec8e4f-061b-451b-8fdd-754d4f1ca5c4 | theS3b/TM-1.0 | TM 1.0/linkedChessEngine/TM_chess_engine-master/chess_engine/playingModes.cpp | #include "playingModes.h"
#include <iostream>
#include "board.h"
#include "ai.h"
using namespace std;
bool playingAgainstAi(SocketConnexion & conn)
{
// Special variables
char bad_move[] = BADMOVE;
char lost[] = LOST;
char win[] = WIN;
const short depth = DEPTH;
cout << "[+] Creating board." << endl;
Board b ... | TOOL | 0.909935 | 4.800175 |
fa896742-54b6-4162-8adf-801b27a626be | levanliu/leetcode | src/leetcode/easy/array/moveZeros.cpp | #include<iostream>
using namespace std;
class Solution
{
public:
void moveZeros(vector<int>& nums){
if(nums.size()<=1) return;
int index = 0;
for(int i=0;i<nums.size();i++){
if(nums[i] != 0)
nums[index++] = nums[i];
}
while(index<nums.size())
... | ALGO | 0.999578 | 4.947133 |
5d0b16fd-ad9e-430a-aca0-1d4bf73fadf6 | hzratali/DSA-Problems | Medium/Check if frequencies can be equal/check-if-frequencies-can-be-equal.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
bool sameFreq(string s)
{
// code here
int arr[26] = {0};
for(auto i:s) arr[i-'a']++;
int cntx = 0, cnty = 0;
int x = -1, y = -1;
... | ALGO | 0.999883 | 5.386081 |
2e464179-562d-476e-94de-c4937616cb47 | billchenchina/cppcodes | OpenJudge/7904.cpp | #include<iostream>
#include<cstdio>
using namespace std;
int main() {
int apple[10],hght,sum=0;
for(int i=0; i<10; i++) {
cin>>apple[i];
apple[i]=apple[i]-30;
}
cin>>hght;
for(int i=0;i<10;i++){
sum+=apple[i]<=hght?1:0;
}
cout<<sum;
return 0;
} | ALGO | 0.99962 | 3.177202 |
2fd2d7a5-3adb-4a10-84d2-b24561e4ae1e | TuZZiX/ROS_IDE_inc | boost_1_59_0/libs/graph/example/modify_graph.cpp | #include <boost/config.hpp>
#include <iostream>
#include <string>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/graph_utility.hpp>
using namespace boost;
// Predicate Function for use in remove if
template <class NamePropertyMap>
struct name_equals_predicate
{
name_equals_predicate(const std::str... | TOOL | 0.92172 | 7.153704 |
65c69fe8-680c-42e1-b766-b66e5e6c546d | kritikarag/DSA-Prep | Dynamic Programming/Practice/dice_combination.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
vector<int>dp(n+1,0);
dp[0] = 1;
int mod = 1e9+7;
for(int i=1;i<=n;i++){
for(int j=1;j<=6;j++){
if(i-j>=0){
dp[i]= (dp[i] + dp[i-j])%mod;
}
}
}
cout<<dp[n]<<... | ALGO | 0.999991 | 4.78064 |
2da73075-e547-4767-bf42-c4541ccdccc3 | augustoca21/DSA | Number Theory/sieve_of_eratosthenes.cpp | #include<bits/stdc++.h>
using namespace std;
/*
Sieve of Eratosthenes
*/
signed main() {
int N = 20;
vector<bool> is_prime(N + 1, true);
is_prime[0] = is_prime[1] = false;
for (int i = 2; i * i <= N; i++) {
if (is_prime[i]) {
cout << i << endl;
for (int j = i * i; j <... | ALGO | 0.999462 | 4.072199 |
14d861c1-9f51-4f2f-b987-7a8a8e343ba7 | ojel0001/Flutter-App-Project | 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 |
29599ace-9c13-41cf-8543-badd965b76cd | plborgprograms/plborgprograms-LeetCode-Problems | crackingTheCodingInterview/permutationInString.cpp | //https://leetcode.com/problems/permutation-in-string/
class Solution {
public:
typedef unordered_map<char, int> letterCounts;
bool checkInclusion(string s1, string s2) {
letterCounts smaller = totals(s1);
letterCounts larger = totals(s2);
for(letterCounts::iterator it = smaller.begin(... | ALGO | 0.999887 | 6.388268 |
f81efec4-bc03-44ce-91fc-f799050cb703 | wenbowen123/icra20-hand-object-pose | src/perception/include/igl/qslim_optimal_collapse_edge_callbacks.cpp | IGL_INLINE void igl::qslim_optimal_collapse_edge_callbacks(
Eigen::MatrixXi & E,
std::vector<std::tuple<Eigen::MatrixXd,Eigen::RowVectorXd,double> > &
quadrics,
int & v1,
int & v2,
std::function<void(
const int e,
const Eigen::MatrixXd &,
const Eigen::MatrixXi &,
const Eigen::MatrixXi &,
... | ALGO | 0.996609 | 5.949907 |
16ca7082-5049-4fbf-838f-8f472d3c31d5 | xXStormXx2000/Game | Engine/spring.cpp | #include "spring.h"
float spring(float vel, float pos, float tpos, float sptif, float demp) {
return -(tpos - pos) * sptif + vel * demp;
}
| ALGO | 0.999406 | 4.661049 |
0f4d11a9-c40f-42f2-a247-583055465396 | sarvex/leetcode-cobol | solution/2300-2399/2305.Fair Distribution of Cookies/Solution.cpp | class Solution {
public:
int distributeCookies(vector<int>& cookies, int k) {
sort(cookies.rbegin(), cookies.rend());
int cnt[k];
memset(cnt, 0, sizeof cnt);
int n = cookies.size();
int ans = 1 << 30;
function<void(int)> dfs = [&](int i) {
if (i >= n) {
... | ALGO | 0.999976 | 5.169191 |
0ce5d554-49cd-47e0-bdd5-a6c016b1b0b3 | morsalin80/Codeforces-and-atcoder | codeforces/766/A.cpp | #include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define ms(x) memset(x,0,sizeof(x))
#define IOS ios::sync_with_stdio(false);
using namespace std;
int main()
{
IOS
string a,b;
while(cin>>a>>b)
{
if(a==b) cout << "-1\n";
else {
cout << max(a.... | ALGO | 0.99926 | 3.38485 |
24223d47-b20c-4b86-aa4a-1b4769d21c9f | ishandutta2007/codeforces | bench0310/normal/1409/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll solve(ll a,ll b,ll x,ll y,ll n)
{
ll z=min(a-x,n);
a-=z;
n-=z;
b-=min(b-y,n);
return a*b;
}
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
while(t--)
{
ll a,b,x,y,n;
... | ALGO | 0.999845 | 4.51493 |
da9f4049-028a-491d-b725-7f7106212c59 | zensakkour/ICPC_1 | Codeforces/CF Rounds/Neowise Labs Contest 1 (Codeforces Round 1018, Div. 1 + Div. 2)/base.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define all(v) v.begin(), v.end()
#define sz(v) ((int)(v).size())
#define pii pair<int, int>
#define vi vector<int>
#define vpii vector<pii>
#define F first
#define S second
#define endl '\n'
const int MOD = 1e9 + 7;
const int IN... | ALGO | 0.998085 | 3.519214 |
8f32212e-c725-4dd0-94a5-bd112152aec9 | manikanta2901/ubuntu | .history/practice/cpp/codeforces/KthLargestNumber_20210409222409.cpp |
#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int n, q, a[N], cnt;
int main(){
scanf("%d%d",&n,&q);
for(int i = 1; i <= n; ++i)
{
scanf("%d",a+i);
cnt += a[i];
}
while(q--){
int opt, x;
scanf("%d%d",&opt,&x);
if(opt == 1)
{
if(a[x]) cnt--;
else cnt++;
a[x] = 1 — a... | ALGO | 0.999794 | 3.885935 |
45ce065d-30c5-49f2-b70c-913425b1c345 | Kunalgarg108/Cpp_Codes | HeapImpement.cpp | #include<bits/stdc++.h>
using namespace std;
void Heapify(vector<int>& arr,int i,int n){
int l=2*i+1;
int r=2*i+2;
int larg=i;
if(l<n && arr[larg]<arr[l]){
larg=l;
}
if(r<n && arr[larg]<arr[r]){
larg=r;
}
if(larg!=i){
swap(arr[larg],arr[i]);
Heapify(arr,la... | ALGO | 0.999862 | 4.206131 |
94ba035d-5cbc-41b6-b2e9-3a1f83b678da | akif-ullal/DSA-SUPREME-3.0 | 01. ARRAY/linear search.cpp | #include<iostream>
using namespace std;
bool linearsearch(int arr[],int n,int key)
{
for(int i=0; i<n;i++)
{
if(arr[i]==key)
{
return 1;
}
}
return false;
}
int main()
{
int arr[]={1,3,4,5,6};
int size=5;
int ans=linearsearch(arr,5,10);
cout<<a... | ALGO | 0.999716 | 3.857309 |
61bc313c-c728-4348-a565-0b5b6d07d916 | kosirobwada/AtCoderSubmit | submissions/abc057/d.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int n, a, b, batas1, batas2;
long double ans = 0;
LL arr[100], kombin[55][55] = {}, totalcara = 0;
bool cmp(LL a, LL b) { return (a > b); }
void tukar(LL &a, LL &b) {
LL temp = a;
a = b;
b = temp;
}
LL fpb(LL a, LL b) {
if (b == 0)
return a... | ALGO | 0.999805 | 3.69742 |
cbceed11-dfea-426e-8871-b17a49158f8a | arlechann/atcoder | AtCoder/ABC207/C.cpp | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <t... | ALGO | 0.999845 | 4.121675 |
481fd804-d385-4ee5-ac49-d5266f98d439 | GrigoryBartosh/hse06_pp_cl | lab_2/main.cpp | #define __CL_ENABLE_EXCEPTIONS
#include <CL/cl.h>
#include "cl.hpp"
#include <vector>
#include <fstream>
#include <iostream>
#include <iterator>
#include <iomanip>
size_t const BLOCK_SIZE = 256;
float* read(int n, int size) {
float* a = new float[size];
for (int i = 0; i < size; i++) {
a[i] = 0;
... | ALGO | 0.998562 | 4.588617 |
8c1a0e99-9ae3-41e8-9dca-2efcc08073d4 | ahmad-siavashi/Handy-Algorithms | C++/merge_sort.cpp | // In his exalted name
// Algorithm: Merge Sort
// Author: Ahmad Siavashi (<EMAIL>)
// Date: 11/2/2014
#include <vector>
#include <iostream>
#include <cmath>
#include <random>
#include <ctime>
using namespace std;
int n;
void merge(vector<int>&, int,int,int);
void print(vector<int>& A){
for(int i = 0 ; i < A.size... | ALGO | 0.999412 | 4.731241 |
816ca976-7524-4381-8742-62924fe5efcd | EnriqueRamirezS/Data-Structures-and-Algorithms-in-C- | 9.BST implementation/main.cpp |
/*
* Implement the find() method for the BST which returns the value if the key is
present, empty string otherwise.
* Your implemntation can be either iterative or recursive.
*/
#include <iostream>
#include <string>
class Node
{
private:
int key;
std::string val;
Node* left;
Node* right;
friend class BinarySearchTree... | ALGO | 0.999914 | 6.237358 |
6c76336b-be9e-4d74-a302-84d2b611d5ea | alifalhasan/CP-code-vault | Codeforces/Codeforces Round/Codeforces Round 776 (Div. 3)/E - Rescheduling the Exam/148944362.cpp | #include<bits/stdc++.h>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
template<typename temp>using ordered_set = tree<temp, null_type, less_equal<temp>, rb_tree_tag,tree_order_statistics_node_update>;
//order_of_key(k) : Number of items str... | ALGO | 0.999836 | 4.347782 |
5733bf76-f396-4ec4-be8a-8708e63b2d8d | diff-arch/AdventOfCode2021 | Day 04 - Giant Squid/Part 2/src/main.cpp | //
// main.cpp
// ADVENT OF CODE 2021: Day 4 - Giant Squid (Part 2)
//
// Created by diff-arch on 04/12/2021.
//
// Goal: Figure out which board will won last. Once it wons, what would its final score be?
//
// Compile: g++ -std=c++11 -o bin/a.out src/*.cpp
// Run: ./bin/a.out
//
#include <iostream>
#in... | ALGO | 0.969718 | 6.347959 |
a0a4c509-9ebd-4f46-9f57-619391d7fe6d | Hardik-Gehlot/DSA | String/LongestPalindromeInString.cpp | // https://practice.geeksforgeeks.org/problems/longest-palindrome-in-a-string3411/1
// Problem:
// Given a string S, find the longest palindromic substring in S. Substring of string S: S[ i . . . . j ] where 0 ≤ i ≤ j < len(S). Palindrome string: A string that reads the same backward. More formally, S is a palindrome i... | ALGO | 0.999751 | 5.355025 |
90752be4-27c4-4dac-82d1-3d865479a17d | Harry-Chen/OOP-Cash | plot/processor/processor.cpp | /**
* @file processor.cpp
* @author 牛辰昊
* @date 2017.05
* @brief Implementation file of class Processor
*/
#include "processor.h"
bool Processor::Process(int i)
{
if(i == bills_.size()) return false;
int indexX = dates_.indexOf(GetDate(i));
int indexY = fieldnames_.indexOf(GetFieldname(i));
... | DATA | 0.96402 | 4.349002 |
c230e2c1-7f96-4d2f-bbd3-3aeb84d807d1 | chuericky/PHYS598_Computation_in_Astrophysics | Ordinary_Differential_Eqs/q2-stiff.cpp | // Q.2. Stiff ODE integrator
#include <iostream>
#include <math.h>
#include <iomanip>
#include <cmath>
#include "nr.h"
using namespace std;
void derivs(const DP x, Vec_I_DP &y, Vec_O_DP &dydx);
int kmax, kount; // defining declarations
DP dxsav;
Vec_DP *xp_p;
Mat_DP *yp_p;
int main() {
const int NP = 3;
... | ALGO | 0.999908 | 5.031225 |
064ccc7e-2a57-4d01-8fab-ec7af12c3532 | nahid515023/problams-solve-online-platform | A_Tricky_Template.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
void solve()
{
int n;
cin >> n;
string a, b, c;
cin >> a >> b >> c;
for (int i = 0; i < n; i++)
{
if ((a[i] != b[i] && a[i] != c[i] && b[i] != c[i]) || (a[i] == b[i] && (a[i] != c[i])))
{
cout << "YE... | ALGO | 0.999921 | 4.623799 |
0d89fd61-c1a5-4106-adcd-4871d956eb7f | kanadkapil/CPP_Combined_Repo | DSA CA 1.cpp | #include <iostream>
using namespace std;
int main(){
int n,i,j;
cout<<"Enter the size of the array"<<endl;
cin>>n;
string k[n];
for(i=0;i<n;i++){
cin>>k[i];
}
int freq[n],check=-1;
for(i=0;i<n;i++){
int count = 1;
for(j=i+1;j<n;j++){
if (k[i]==k[j]){
count ++;
freq[j]=check;
}
}
if (freq[i]... | ALGO | 0.999961 | 3.340347 |
be481eb7-58ca-4c07-b578-f6bf42ca9a6c | ishandutta2007/codeforces | s2speed/normal/1370/F1.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.999925 | 3.927479 |
30d505d6-b558-439b-8d1a-457ff72a061c | aronton/tSDRG_toolkit | tSDRG/tSDRG_tools/tSDRG_tools1.cpp | #include "tSDRG_tools.h"
/// return random number by distribution
double Distribution_Random_Variable(int model, double var, double Jdis)
{
double value;
switch (model)
{
case 0:
{
/// non-disorder, all values are one.
value = 1;
break;
}
... | ALGO | 0.999232 | 3.742364 |
6d5d8c09-dd1e-4710-8790-58b403724548 | Herren/RGEpp | examples/nsm_example.cpp | #include <iostream>
#include <iomanip>
#include <string>
#include "nsm.h"
#include "ckm.h"
#include "pmns.h"
// ckm matrix in the convention of the PDG
yukawa<3,3> ckm(double th12, double th13, double th23, double phi){
yukawa<3,3> res;
std::complex<double> iphi(0.,phi);
res << cos(th12)*cos(th13), sin(th12)*cos... | ALGO | 0.99648 | 4.95372 |
a264c630-f97e-4f2e-9a7a-b0f80d3ca64c | aanishbangre/DSA | 09 Recursion/sorted_array.cpp | #include<iostream>
using namespace std;
bool isSorted(int arr[],int n){
//base case
if(n==1 or n==0){
return true;
}
//rec case
if(arr[0]<arr[1] and isSorted(arr+1,n-1)){
return true;
}
return false;
}
bool isSortedTwo(int arr[],int i,int n){
if(i==n-1){
return true;
}
if(arr[i]<arr[i+1] and isSortedT... | ALGO | 0.999987 | 4.943161 |
159d7cd0-2311-45be-8d2c-d674efd1d3d6 | alexandraback/datacollection | solutions_2751486_0/C++/Jereneal/problemA.cpp | #include <iostream>
using namespace std;
int main(int argc, const char **argv)
{
FILE *fp,*inp;
int n,T,i,j,nOfname;
int countCon,countAll;
int result;
char arr[1000]={0};
fp=fopen(argv[1],"w");
inp=fopen(argv[2],"r");
fscanf(inp,"%d",&T);
for(i=1;i<=T;i++){
fscanf(inp,"%s",&arr[1]);
fscanf(inp,"%d",&... | ALGO | 0.998011 | 3.518102 |
d4c5641e-1f51-4c9b-b7ce-7ab0cd94bad4 | andriantimeswift/pokeemerald-genetics | tools/preproc/asm_file.cpp | #include <cstdio>
#include <cstdarg>
#include <stdexcept>
#include "preproc.h"
#include "asm_file.h"
#include "char_util.h"
#include "utf8.h"
#include "string_parser.h"
#include "../../gflib/characters.h"
#include "io.h"
AsmFile::AsmFile(std::string filename, bool isStdin, bool doEnum) : m_filename(filename)
{
m_b... | TOOL | 0.895698 | 6.483174 |
436c1ab0-d531-4c86-9d9f-f3005d7df95e | mirinta/leet_code | tree/binary_search_tree/0530_minimum_absolute_difference_in_BST.cpp | #include <vector>
/**
* 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),... | ALGO | 0.999959 | 7.053925 |
d1359012-3a8e-4fff-ab75-b26f792a9f16 | Polzovat123/homework_IVT | 04.10.2019|rekursia/main.cpp | #include <iostream>
#include <string>
using namespace std;
int n,len;
int used[100];
string words[100];
string f[100];
void check(){
string answer="";
for(int p=0;p<len;p++){
answer=answer+" "+f[p];
if(p>=2)cout<<answer<<endl;
}
}
void R(int x){
int i;
if(len==x){check();return;}... | ALGO | 0.999287 | 3.44027 |
5370af20-aa8f-424f-acdc-eb5759d1b89b | Constant1n3/rookieCode | temp.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll unsigned long long
#define pb push_back
#define mk make_pair
#define REP(i,a,b) for(int i=a; i<=b; i++)
#define mod 1000000007
int main()
{
ll n,k;
cin >> n >> k;
vector<int> v(n);
REP(i,0,n-1)
cin >> v[i];
//internal inversion cou... | ALGO | 0.999893 | 3.565362 |
692455f2-d7ee-48f4-ad27-7190ccb0f8ed | ca2/app | acme/prototype/string/sz/ansi_impl.cpp | // Refactored by camilo on 2022-11-04 05:43 <3ThomasBorregaardSorensen!!
#include "framework.h"
#include <string.h>
#include <stdio.h>
// CLASS_DECL_ACME constexpr character_count character_count_to_byte_length(const_ansichar_trigger, character_count nCharLength) { return (::memsize)((nCharLength) * sizeof(::ansi... | TOOL | 0.865998 | 4.891798 |
df431689-a60f-47d6-a3df-27f96425d2e6 | Durzo7/tfm | TSP/src/Parsers/parser.cpp | #include <fstream>
#include <sstream>
#include "parser.hpp"
matrix load(std::string filepath) {
std::ifstream file_stream(filepath);
std::string line; std::getline(file_stream,line);
std::istringstream line_stream(line);
unsigned short n; line_stream >> n;
matrix M(n);
for (unsigned short i =... | TOOL | 0.872381 | 4.116542 |
7fec14a1-ab52-4b3d-9e13-f584539d5b9e | threalwinky/cp_library | Codeforces/nhpoj/P000.cpp | /**
* author: winky
* created: 2023-05-24 18:59:29
**/
// Obey my waifu
//⢸⣿⣿⣿⣿⠃⠄⢀⣴⡾⠃⠄⠄⠄⠄⠄⠈⠺⠟⠛⠛⠛⠛⠻⢿⣿⣿⣿⣿⣶⣤⡀⠄
//⢸⣿⣿⣿⡟⢀⣴⣿⡿⠁⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⣸⣿⣿⣿⣿⣿⣿⣿⣷
//⢸⣿⣿⠟⣴⣿⡿⡟⡼⢹⣷⢲⡶⣖⣾⣶⢄⠄⠄⠄⠄⠄⢀⣼⣿⢿⣿⣿⣿⣿⣿⣿⣿
//⢸⣿⢫⣾⣿⡟⣾⡸⢠⡿⢳⡿⠍⣼⣿⢏⣿⣷⢄⡀⠄⢠⣾⢻⣿⣸⣿⣿⣿⣿⣿⣿⣿
//⡿⣡⣿⣿⡟⡼⡁⠁⣰⠂⡾⠉⢨⣿⠃⣿⡿⠍⣾⣟⢤⣿⢇⣿⢇⣿⣿⢿⣿⣿⣿⣿⣿
//⣱⣿⣿⡟⡐⣰⣧⡷⣿⣴⣧⣤⣼⣯⢸⡿⠁⣰⠟⢀⣼⠏⣲⠏⢸⣿⡟⣿⣿⣿⣿⣿⣿
//⣿⣿⡟⠁⠄⠟⣁⠄⢡⣿⣿⣿⣿⣿⣿⣦⣼⢟⢀⡼⠃⡹⠃... | ALGO | 0.987431 | 3.992174 |
2d7b462c-3f31-4e69-8724-17efd8aeefb9 | zwvista/PSL | PuzzlesS/Puzzles/SlantedMaze.cpp | #include "stdafx.h"
#include "astar_solver.h"
#include "bfs_move_gen.h"
#include "solve_puzzle.h"
/*
iOS Game: 100 Logic Games/Puzzle Set 6/Slanted Maze
Summary
Maze of Slants!
Description
1. Fill the board with diagonal lines (Slants), following the hints at
the intersections.
2. Ever... | ALGO | 0.999488 | 6.88869 |
40b1aa22-3c94-4a96-9b16-046fa4dde335 | Kingsman44/aps-portfolio.github.io | codes/SkipList.cpp | /*
* C++ Program to Implement Skip List
*/
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <cstring>
#define MAX_LEVEL 6
const float P = 0.5;
using namespace std;
/*
* Skip Node Declaration
*/
struct snode
{
int value;
snode **forw;
snode(int level, int &value)
{
forw = new... | ALGO | 0.999681 | 4.804924 |
6a361c43-a5e5-4bce-a186-3c2e7d6275ea | vaibhavchaubey/DSA-Practice | 160-intersection-of-two-linked-lists/160-intersection-of-two-linked-lists.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) {
ListNode* d1 = headA;
ListNode* d2 = headB;
... | ALGO | 0.99988 | 5.570544 |
d05734fa-704b-488f-b8a3-5bf32e4daadd | stomo0511/Tune_SSRFB | MultCallFlushLRU.cpp | #include <iostream>
#include <cstdlib>
#include <omp.h>
#include <plasma_core_blas.h>
// Generate random number matrix
void Gen_rand_mat(const int m, const int n, double *A)
{
srand(20210604);
#pragma omp parallel for
for (int i=0; i<m*n; i++)
A[i] = 1.0 - 2.0*(double)rand() / RAND_MAX;
}
#define MAT_SIZE 16384... | ALGO | 0.998412 | 4.596868 |
e9dbe4e8-fc66-4995-b3ad-1ad26a32e6e7 | erickarambulo/C-Projects | cpp_projects/chapter_6/BasicArrayOperation.cpp | /*
Chapter 6: Basic Array Operations
Name: Erick Arambulo
Date 17th June 2025
Purpose: The purpose for this project is to prompt user to input their
five numbers into vector/array and then display their vector/array, add
them altogether, and find the average. */
#include <iostream>
#include <vector>
#include <iomanip>... | TOOL | 0.976903 | 5.503674 |
6ac24bc6-74c2-4fc5-b4ce-d3bf39daeb4b | SaiVenkatDhulipudi/CP-Journey | Matrix/Diagonal Difference.cpp | https://www.hackerrank.com/challenges/diagonal-difference/problem
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,l=0,r=0;
cin>>n;
vector<vector<int>> v( n , vector<int> (n));
for(int i = 0; i < n; i++)
{
for(int j = 0; j < n; j++)
{
cin>>v[i][j] ;
... | ALGO | 0.999995 | 4.21589 |
5ff19838-fa4e-4e82-8be2-a4740d782a77 | hu18yuanwai/leetcode | 60. Permutation Sequence.cpp | //由于回溯法不满足字典序,所以下面做有问题
class Solution {
public:
void backTrack(string &ret,int &count,string& cur,int N){
if(N>=cur.size()){
count--;
if(count==0)
ret=cur;
return;
}
else{
for(int i=N;i<cur.size();i++){
swap(cur[i],cur[N]);
backTrack(ret,count,cur,N+1);
swap(cur[i],cur[N]);
}
}
}... | ALGO | 0.999969 | 6.091993 |
452b88bd-719a-4a25-93ae-fe10b810e1f3 | egg53231323/essentia_vs | essentia/algorithms/spectral/flux.cpp | #include "flux.h"
#include "essentiamath.h"
using namespace std;
using namespace essentia;
using namespace standard;
const char* Flux::name = "Flux";
const char* Flux::category = "Spectral";
const char* Flux::description = DOC("This algorithm computes the spectral flux of a spectrum. Flux is defined as the L2-norm [1... | TOOL | 0.988599 | 6.087389 |
2477c620-478f-4641-a8b9-6f97a4b8351d | Idkwnisu/RTGP | include/bullet/BulletCollision/Gimpact/gim_contact.cpp | #include "gim_contact.h"
#define MAX_COINCIDENT 8
void gim_contact_array::merge_contacts(
const gim_contact_array & contacts, bool normal_contact_average)
{
clear();
if(contacts.size()==1)
{
push_back(contacts.back());
return;
}
gim_array<GIM_RSORT_TOKEN> keycontacts(contacts.size());
keycontacts.resize(... | ALGO | 0.997935 | 4.558418 |
ae54a4fc-af33-4772-8828-c5bdd9164238 | devraj2018/Programming_Pathshala | Greedy/10)-Minimum_Jumps_Required_To_sit_all_Together.cpp | int Solution::seats(string A) {
int n=A.length();
int mod=1e7+3;
vector<int>pos; // To store position of 'X'
int count=0;
for(int i=0;i<n;i++)
{
if(A[i]=='x')
{ pos.push_back(i-count); // (i-count) bcz it will give from mid how many position to be shifted
... | ALGO | 0.999928 | 5.386446 |
2bb9d48a-e5f0-44e8-9666-d8a1a5ac7e58 | Whu-wxy/CS-Notes | 笔试/网易互娱/main.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int solution(int M, int N, int X, int Y, int P)
{
int origin = 100000;
int diffP = P - origin;
if(M*X >= diffP) //ǰM
{
int d = diffP / X;
if(diffP % X == 0) return... | ALGO | 0.996799 | 3.685911 |
b56ff9e7-6b8e-479a-9bcf-1d31757fcbc8 | hexu1985/cpp_book_code | cpp.func.handbook/ch06/6-2-1.cpp | #include <list>
#include <iostream>
using namespace std;
int print(list <int> c) //ڴӡһ
{
list <int>::const_iterator cp;
for(cp=c.begin();cp!=c.end();cp++) //cpcĿʼӡcpӦֵ
cout<<*cp<<" ";
return 0;
}
int main( )
{
list <int> ctr1, ctr2;
list <int>::const_iterator cp;
int i;
for(i=0... | TOOL | 0.893848 | 3.243541 |
d0000dcd-9a1e-46bc-826f-da85f4410271 | shivansh345678/DSA | algo/stackANDqueue/quearr.cpp | #include <iostream>
using namespace std;
template <class T = int>
class queue
{
int size = 0;
int rear = 0;
int front = 0;
T *p;
public:
queue(int a)
{
size = a + 1;
p = new T[size];
// if using malloc then
// p=(T *)malloc(size*sizeof(T));
}
~queue()
... | ALGO | 0.999811 | 3.837093 |
fdcbf201-1ed0-491f-961a-c1adc25410d4 | lement3864/IUDUD | dong/CodeTree/240620_금채굴하기/240620_금채굴하기.cpp | #include <iostream>
#include <algorithm>
using namespace std;
const int MAX_N = 20;
int mineArea[MAX_N][MAX_N];
int GetCost(int K)
{
return K * K + (K + 1) * (K + 1);
}
// ǥ k Ű鼭 gold ŽѴ.
int GetNumOfGold(int y, int x, int N, int M)
{
int maxGold = 0;
for (int k = 0; k <= N; ++k) {
int goldCnt = 0;
// ... | ALGO | 0.999884 | 4.212274 |
7fbf0781-2269-4fa9-8729-6e2af5997555 | mainul3195/codes | Codeforces/round 988/G_Natlan_Exploring.cpp | #include <bits/stdc++.h>
using namespace std;
#define mod 998244353
vector<long long> vec(2000006, 0);
vector<int> spf(2000006, 1);
void find_spf()
{
for (int i = 2; i <= 2000000; i += 2)
spf[i] = 2;
for (int i = 3; i * i <= 2000000; i += 2)
if (spf[i] == 1)
for (int j = i * i; j <= ... | ALGO | 0.99999 | 4.77191 |
e213dd8b-04cf-4d41-a084-645406557fa4 | RedCod/Android10_framework | base/core/jni/com_android_internal_os_Zygote.cpp | /*
* Disable optimization of this file if we are compiling with the address
* sanitizer. This is a mitigation for b/122921367 and can be removed once the
* bug is fixed.
*/
#if __has_feature(address_sanitizer)
#pragma clang optimize off
#endif
#define LOG_TAG "Zygote"
#define ATRACE_TAG ATRACE_TAG_DALVIK
#includ... | TOOL | 0.889424 | 5.992308 |
db3dd27f-0fed-4b95-88bf-ee31b2850de0 | C4NU/OpenCV-Practice | OpenCV/2023.05.18/TransformEstimation.cpp | //
// TransformEstimation.cpp
// OpenCV
//
// Created by 전효재 on 2023/06/08.
//
#include <opencv2/opencv.hpp>
#include "MatrixInverse.h"
IplImage* src;
IplImage* dst;
CvPoint P[3] = { cvPoint(250,100),
cvPoint(100,350),
cvPoint(400,350) };
CvPoint Q[3] = { cvPoint(250,100),
... | ALGO | 0.99901 | 3.768626 |
a2485c0f-34ca-4b65-be30-eb21a474b80d | JackeyO/OI | src/20CB_H.cpp | #include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long LL;
const int N = 1e3 + 10;
int n;
int a[N];
int b[N];
int main() {
ios :: sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cin >> n;
int s, t, e;
for (int i = 0; i < n; i ++) {
cin >> s >> t >> b[i];
a[i] =... | ALGO | 0.999595 | 3.636295 |
0e8b6daa-fec4-4fb2-b3e8-5c941f354ce6 | icenamor/libacop | src/learner/dae_yahsp/daeyahsp/dae/src/evaluation/cpt.cpp | #include "cpt.h"
void bindDaeCpt( daex::pddlLoad & pddl )
{
bindDaeYahspCpt( pddl, SOLVER_CPT );
}
void daeCptEval::call( daex::Decomposition & decompo )
{
if( ! decompo.invalid() ) {
return;
}
_k = 0;
_u = 0;
_B = 0;
_total_backtracks = 0;
for( unsigned int p=0; p < plans_nb; ++... | ALGO | 0.99974 | 5.466893 |
bc22c484-81c4-43a3-a1e8-906222804f9d | yannisoulefki/LiborMarketModel-BarrierPricing | src/Monte_Carlo.cpp | #include "Monte_Carlo.hpp"
normal Monte_Carlo_Results::nd = normal(0,1);
Monte_Carlo_Results::Monte_Carlo_Results(int n, double sx, double sx2) : n(n), sum_x(sx), sum_x2(sx2) {};
void Monte_Carlo_Results::add(double value) {
sum_x += value;
sum_x2 += value * value;
++n;
}
double Monte_Carlo_Results::me... | ALGO | 0.947126 | 6.012865 |
05549f86-3f1a-473e-943a-0fae0126bed2 | ritikbanger/Hacktoberfest2022-DSA | 38. Crypto/graph colouring using greedy algo.cpp | #include <iostream>
#include <list>
using namespace std;
// A class that represents an undirected graph
class Graph
{
int V; // No. of vertices
list<int> *adj; // A dynamic array of adjacency lists
public:
// Constructor and destructor
Graph(int V) { this->V = V; adj = new list<int>[V]; }
~Graph() { delete [] ad... | ALGO | 0.999812 | 6.037028 |
594ac508-e25d-4aa5-b1de-8d5e7617112b | AmanSharma121202/DSA-Code | AssignmentBinary.cpp | // Q print the sum of first 5 decimal numbers from 1 to 5 in binary format
#include<iostream>
using namespace std;
int main(){
int sum = 0;
for(int i =1; i<=5; i++){
sum = sum+i;
}
int ans=0;
int pw =1;
while(sum>0){
int parity = sum%2;
ans +=pw*parity;
pw*=10;
... | ALGO | 0.999474 | 4.554992 |
37d90b22-d36c-4605-a8f6-6f711e5aa559 | kowshik24/Codeforces | Rewards_484A.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int a1,a2,a3,b1,b2,b3,n;
cin>>a1>>a2>>a3;
cin>>b1>>b2>>b3;
cin>>n;
int total_cup = a1+a2+a3;
int a = total_cup ;
int total_med = b1+b2+b3;
int b = total_med ;
int cup = total_cup / 5;
int med = total_med / 10;
... | ALGO | 0.9999 | 3.053905 |
866f3d69-932e-4934-877b-2a4e23a443d5 | Ash-codes18/Lpu-colab-CPP-DSA-Soln | CSE-205 DSA/Unit-1/Lecture 6/CY/Grading_system_selection_sort.cpp | // You are using GCC
#include <iostream>
using namespace std;
void output(string arr[],int n){
for(int i=0;i<n;i++){
cout<<arr[i]<<" ";
}
cout<<endl;
}
void sort(string arr[], int n){
for(int i=0;i<n-1;i++){
int min=i;
for(int j=i+1;j<n;j++){
if(arr[j]<arr[min]... | ALGO | 0.99993 | 5.26539 |
3885ab48-a835-4c09-8cba-a8431fcc01ee | HarshGupta02/Data-Structure-And-Algorithm | CodeChef/a.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
static const int MOD = (int)1e9+7;
int go(vector<int> &a, vector<int> &b) {
int n = a.size(), m = b.size();
int l1 = 0, r1 = n - 1, l2 = 0, r2 = m - 1;
i... | ALGO | 0.999991 | 4.704274 |
142e7b86-b20a-43a7-b2e5-2ecb7669351e | shradha07082001/DSA-Practice- | CF:4A.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
if(n==2)
cout<<"NO";
else{
if(n%2==0)
cout<<"YES";
else
cout<<"NO";
}
}
| ALGO | 0.999856 | 3.534849 |
f895caa1-388c-4b23-a634-96421815f12e | verdastelo/Programado-Principoj-kaj-Praktikado | ch6/revision/cal1.cpp | // cal1.cpp
// An elementary calculator.
// verdastelo
// 2016-10-22
#include "std_lib_facilities.h"
int main()
try {
cout << "Expression: ";
int lval = 0;
int rval;
char op;
cin >> lval;
if (!cin) error ("No first operand.");
while (cin >> op) {
cin >> rval;
if (!cin) error ("No second operand... | TOOL | 0.937351 | 4.733027 |
5521fa1d-1ea2-408b-ab0f-9f37df90e5ad | Mwako/deps | boost/libs/spirit/example/qi/compiler_tutorial/calc2.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// A Calculator example demonstrating the grammar and semantic actions
// using plain functions. The parser prints code suitable for a stack
// based virtual machine.
//
// [ JDG May 10, 2002 ] spirit1
// [ JDG March 4, 2007 ... | TOOL | 0.969757 | 7.565277 |
1f89ee20-cd84-4861-a7a4-68b217f30cbd | GauravJha-Git/CPP | gfg/HEAP/97.cpp | /*
Problem: Merge K Sorted Linked Lists
You are given an array of `k` sorted linked lists. Your task is to merge all these lists into one single sorted linked list and return the head of the merged list.
Example:
Input:
arr[] = [1 -> 2 -> 3, 4 -> 5, 5 -> 6, 7 -> 8]
Output:
1 -> 2 -> 3 -> 4 -> 5 -> 5 -> 6 -> 7 -> 8
... | ALGO | 0.99998 | 6.416869 |
6a6e522c-edf7-4ff7-ba21-3c811d0745cf | htbkoo/cplusplus | src/onlinePlatform/leetcode/leetcoding_challenge/2022/dec2022/week4/longest_subsequence_with_limited_sum.cpp | #include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <limits>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <iterator>
#include <sstream>
#include <iostream> // includes cin to read from stdin and cout to write to stdout
using namespace std; // since cin and cout a... | ALGO | 0.999911 | 6.067548 |
3149fdce-154f-40df-93a4-966f40e9adfa | snehil21/LeetCode | Queue Reversal - GFG/queue-reversal.cpp | //{ Driver Code Starts
//Initial Template for C++
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//function Template for C++
//Function to reverse the queue.
class Solution
{
public:
queue<int> rev(queue<int> q)
{
int sz=q.size();
vector<int>v;
for(int i=0;i<sz... | ALGO | 0.999699 | 5.779203 |
9b608d8b-7328-4fbe-a13a-514985ea1d96 | durgeshkk/Codeforces-Contests | Practice/1500/B_Eastern_Exhibition.cpp | #include<bits/stdc++.h>
#include<iomanip>
#include <deque>
#include <bitset>
#include <cstdint>
//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_updat... | ALGO | 0.999916 | 4.135896 |
768b4d1a-f924-492a-b74a-5eb07b9557ca | mlevim/lammps-nequip-test | src/EXTRA-MOLECULE/angle_cosine_shift_exp.cpp | // clang-format off
/* ----------------------------------------------------------------------
Contributing author: Carsten Svaneborg, <EMAIL>
------------------------------------------------------------------------- */
#include "angle_cosine_shift_exp.h"
#include <cmath>
#include "atom.h"
#include "neighbor.h"
#i... | ALGO | 0.988756 | 6.006872 |
88ca3c9b-a1fb-453d-8c00-ec1c087aba20 | Himanshu07-debug/POTD | Leetcode/May/17_may.cpp | #include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define endl '\n'
const long long MOD = 1e9 + 7;
const long long INF = LLONG_MAX >> 1;
const long long NINF = LLONG_MIN;
struct node{
int data;
node* le... | ALGO | 0.999749 | 4.238874 |
65d43f61-6a06-4235-8084-3386b49467d0 | Forrest-Z/AiwSys | projects/adas/algorithm/core/util/numpy_util.cpp | #include "numpy_util.h"
#include "display_util.h"
// std
#include <iostream>
#include <map>
#include <set>
using namespace std;
#include <opencv2/imgproc.hpp> // cvtColor
#include <opencv2/highgui.hpp> // imdecode imshow
using namespace cv;
#ifdef USE_EIGEN
#include <Eigen/Dense>
using namespace Eigen;
#endif // US... | TOOL | 0.971956 | 5.638025 |
2a757db6-bd7e-4055-bd5a-9372e57ce3ee | Simon-0801/CodeHome | 专题练习/基础DP/HDU1024.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
typedef long long ll;
const int maxn = 1000000 + 5;
const int INF = 0x3f3f3f3f;
int num[maxn];
int dp[maxn],pre[maxn];
int main() {
int m,n;
while(~scanf("%d%d",&m,&n)){
for(int i=1;i<=n... | ALGO | 0.999946 | 3.383039 |
61a355fc-38f8-49a9-9c5b-5cc4bf61793a | DongWooE/CodingTest | PG/[PG]배달.cpp | #include <iostream>
#include <vector>
#include <queue>
#define INT_MAX 100000000
using namespace std;
int solution(int N, vector<vector<int> > road, int K) {
int answer = 0;
vector<vector<pair<int,int>>>E(N);
vector<int>d(N, INT_MAX);
priority_queue<pair<int,int>> Q;
for(auto r : road) {... | ALGO | 0.999617 | 5.059567 |
d3c5078d-7cb6-4032-9c13-b2541134cfd3 | rajuahmed118124r/Codeforces | 431_A_Black_Square.cpp | ///BISMILLAHIR RAHMANIR RAHIM
///============================
/*
Problem name : A. Black Square
Problem link : https://codeforces.com/contest/431/problem/A
Platform : Codeforces
Author : Md.... | ALGO | 0.999689 | 4.204789 |
4da257f0-a9a9-4070-97ec-a22b1696a394 | Bhawna751/LeetCode-Solutions | 2710-minimum-operations-to-reduce-an-integer-to-0/2710-minimum-operations-to-reduce-an-integer-to-0.cpp | class Solution {
public:
int minOperations(int n) {
int x= 1, y=1;
if(n<=0)return 0;
if(n==1)return 1;
while(x*2 < n) x = x*2;// 64 /
y = x*2 - n;//64 - 39 = 25
x = n-x;//39-25 = 6
int l = minOperations(x);//6
int r = minOperations(y);//25
r... | ALGO | 0.999924 | 6.078361 |
f02915bd-8bd9-4296-a4be-003dcef97919 | dev-morsalin-islam/Leetcode | search_in_BST.cpp | //program for search in a BST
//problem link : https://leetcode.com/problems/search-in-a-binary-search-tree/
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) ... | ALGO | 0.999995 | 5.118374 |
5d6abbac-c399-40f8-9bd5-c1757dbc2376 | Sanketchicku/Codechef | July Challenge/CEQUAL.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
long long int n,input,i,flag=0;
vector< long long int> v;
cin>>n;
for(i=0;i<n;i++)
{
cin>>input;
v.push_back(input);
}
sort(v.begin(),v.end());
for(i=0;i<n-1;i++)
{... | ALGO | 0.999941 | 3.718427 |
92435a22-f551-446b-aa36-216f2855642e | wocantudou/Opencv4.9.0 | modules/imgproc/src/deriv.cpp | #include "precomp.hpp"
#include "opencl_kernels_imgproc.hpp"
#include "opencv2/core/openvx/ovx_defs.hpp"
#include "filter.hpp"
/****************************************************************************************\
Sobel & Scharr Derivative Filters
\************************************... | ALGO | 0.993383 | 5.274301 |
d8826318-7e71-42e4-b259-b296209132c1 | XYang-EcoHydroWQ/EcH2O-iso_largescale | Tracking/MixingV_snow.cpp | /*
* MixingV_snow.cpp
*
* Created on: Jun 21, 2017
* Author: Sylvain Kuppel
*/
#include "Basin.h"
void Tracking::MixingV_snow(Atmosphere &atm, Basin &bsn, Control &ctrl,
double &h, double &dh, int r, int c) //time step
{
double h_eff; // Effective SWE used for mixing
double snow_in = bsn.getF... | ALGO | 0.998412 | 6.018954 |
4b515ce9-238a-416d-8717-be37727ec277 | chandranshh/LeetCodePR | 38-count-and-say/count-and-say.cpp | class Solution {
public:
string rle(const string& str) {
string result;
int count = 1;
for (int i = 0; i < str.length(); ++i) {
if (i + 1 < str.length() && str[i] == str[i + 1]) {
count++;
} else {
result += to_string(count) + str[i];
... | ALGO | 0.999992 | 7.299611 |
36641e3c-80d5-4663-81be-86003c99626c | Bennett-Wendorf/NCNA2021_Code | NCNA_2021/lonerook/submissions/wrong_answer/onlyCheckT.cpp | // "no" when T is attacked by a non-removable knight.
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <sstream>
#i... | ALGO | 0.999577 | 3.947556 |
4f65b47a-d88d-4ab2-b5b8-9067402ae5d5 | paulmcquad/cpp23 | 1-Statements/primenumfor.cpp | #include <iostream>
#include <print>
#include <cmath>
int main() {
// Int Braced Initialization - C++11
int n{0};
bool is_prime = true; // Boolean Flag
// Get a number n from the keyboard.
std::print("Enter a number: ");
std::cin >> n;
// Test for prime by checking for divisibility
... | ALGO | 0.983118 | 5.135781 |
26165194-16da-4138-8dc5-4d4c942b6448 | sstuqtd/vocal | thridparty/boost/libs/compute/example/time_copy.cpp | //[time_copy_example
#include <vector>
#include <cstdlib>
#include <iostream>
#include <boost/compute/event.hpp>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/copy.hpp>
#include <boost/compute/async/future.hpp>
#include <boost/compute/container/vector.hpp>
namespace compute = boost::compute;
... | ALGO | 0.991396 | 5.027043 |
437cd93f-da4b-4f20-a5d6-972898942ace | ashuksingh11/Leetcode | DFS/Q212.cpp | //https://leetcode.com/problems/word-search-ii/description/
//212. Word Search II
class Solution {
public:
// declare a structure for TrieNode
struct TrieNode
{
bool is_end;
string word;
TrieNode* child[26];
TrieNode()
{
is_end = false;
... | ALGO | 0.999927 | 6.268084 |
cd799668-1d7a-4806-b58d-53ee580645d1 | ManishBarage/DSA | Patterns/pattern_9.cpp | #include <iostream>
using namespace std;
// 1
// 2 1
// 3 2 1
// 4 3 2 1
int main()
{
int n;
cout << "Enter row : ";
cin >> n;
int row = 1;
while (row <= n)
{
int col = 1;
int val = row;
while (col <= row)
{
cout << " " << row - col + 1;
... | ALGO | 0.99975 | 4.100481 |
53d24044-717c-48be-86cf-4ac218a23c1c | ayushkaushal1522/codeforces_quest | pointsonaplane.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
long long int t;
cin>>t;
while(t--){
long long int n;
cin>>n;
long long int ans = (long long)sqrt(n-1);
cout<<ans<<endl;
}
} | ALGO | 0.999899 | 4.333601 |
2dfd009e-4316-4fa5-b8a9-56e180f2cc5f | aksenoff/leetcode-challenge-2020 | 19-search-in-rotated-sorted-array.cpp | // https://leetcode.com/problems/search-in-rotated-sorted-array/
int find_pivot(vector<int>& nums, int a, int b)
{
if (b - a == 1) return nums[a] < nums[b] ? a : b;
int mid = a + (b - a) / 2;
if (nums[a] < nums[mid] && nums[mid] > nums[b])
return find_pivot(nums, mid, b);
else if (nums[a] > num... | ALGO | 0.999991 | 6.527545 |
5cd494ae-7760-41a6-8c21-77be87dc914a | SHIVAM1422000/Java_CP | comparator.cpp | #include <bits/stdc++.h>
using namespace std;
bool cmp(int a,int b){
if(a<b) return true;
return false;
}
int main(){
vector<int> v;
int n;
cin>>n;
for(int i=0;i<n;i++){
int temp;
cin>>temp;
v.push_back(temp);
}
sort(v.begin(),v.end(),[](int a,int b){if(a<b) return true; re... | ALGO | 0.999903 | 3.977413 |
3283869f-60f2-41ad-8259-c4cf2ba5f6a8 | sidharthNair/ray-tracer | third-party/glm/test/gtx/gtx_fast_trigonometry.cpp | #include <glm/ext/scalar_ulp.hpp>
#define GLM_ENABLE_EXPERIMENTAL
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/fast_trigonometry.hpp>
#include <glm/gtx/integer.hpp>
#include <glm/gtx/common.hpp>
#include <glm/gtc/constants.hpp>
#include <glm/gtc/vec1.hpp>
#include <glm/trigonometric.hpp>
#include <cmath>
#i... | TEST | 0.941292 | 6.277224 |
41946ff0-0c8a-4aaf-a969-7aa95f92f2b3 | mohamedahemd99/currency-converter-app | 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 |
f889f017-1774-41a5-bb99-f900cc88d8a7 | Sounne/UE_4.25_Totem | Engine/Source/ThirdParty/PhysX3/APEX_1.4/shared/general/HACD/src/dgAABBPolygonSoup.cpp | /****************************************************************************
*
* File Name : Bitmap.C
* Visual C++ 4.0 base by Julio Jerez
*
****************************************************************************/
#include "dgHeap.h"
#include "dgStack.h"
#include "dgList.h"
#include "dgMatrix.h"
#include "dgPo... | ALGO | 0.999778 | 5.020588 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.