uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
903bee14-5ed1-40cf-ae18-b480cbe3c7d4 | binji/love-nacl | src/libraries/Box2D/Collision/b2Collision.cpp | #include <Box2D/Collision/b2Collision.h>
#include <Box2D/Collision/b2Distance.h>
void b2WorldManifold::Initialize(const b2Manifold* manifold,
const b2Transform& xfA, float32 radiusA,
const b2Transform& xfB, float32 radiusB)
{
if (manifold->pointCount == 0)
{
return;
}
switch (manifold->type)
{
... | ALGO | 0.999415 | 7.776567 |
51d93958-8eac-4f22-824e-e8b6f6f7d9c7 | viniciusbrunheroto/EstudosDaUnesp | Introdução à Computação II/algoritmos teste/Teste- enum.cpp | #include<stdio.h>
#include<conio.h>
#include<locale.h>
enum Pagamento{dinheiro= 'd', cheque= 'c', vale_refeicao= 'v',cartao= 'k'};
int main()
{
setlocale(LC_ALL,"Portuguese");
enum Pagamento pag;
printf("Qual a forma de pagamento?\n");
scanf(" %c",&pag);
switch(pag)
{
case dinheiro:
{
printf("O ... | ALGO | 0.891183 | 3.209325 |
f6296bcd-1b01-472c-846b-f63fd59a6af7 | vdae2304/Contest-archive | CodeForces/Round 498 - Div. 3/1006A - Adjacent Replacements.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0); cin.tie();
long long n;
cin >> n;
long long v[n];
for (long long i = 0; i < n; i++)
cin >> v[i];
for (long long a = 1, b = 1; b != INT_MAX; a = b) {
for (long long i = 0; i < n; i++)
... | ALGO | 0.999992 | 4.000053 |
d2dec845-b75f-408d-924d-15259b947db7 | javadHeidary/Ecommerce_project_apple_shope | 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 |
d84970f2-3a15-40d4-82df-352ba16f060f | prakharr5/ACMBMU_Hacktoberfest | linear search1.cpp | #include <iostream>
using namespace std;
int main() {
int i,l,s=0,n,p,m;
cout<<"no of integer";
cin>>n;
int a[20]={137,41593,89};
for(i=0;i<n;i++)
{
l=a[i]%10;
m=(a[i]/10)%10;
p=l*m;
s+=p;
}
cout<<"sum of product of last two digits:"<<s;
}
| ALGO | 0.999776 | 4.176522 |
09664017-e96a-4f13-9a8d-239311ef8296 | ishandutta2007/codeforces | keywet06/normal/1575/F.cpp | #include <bits/stdc++.h>
using int64 = long long;
const int64 P = 1000000007;
const int N = 100000 + 1;
int64 Pow(int64 a, int64 r) {
int64 res = 1;
for (; r; r >>= 1, a = a * a % P) {
if (r & 1) res = res * a % P;
}
return res;
}
int64 g[N], f[N], F[N], G[N], S[N];
int64 C(int64 n, int64 m... | ALGO | 0.9999 | 4.06981 |
7642e658-c653-4fbf-ad58-eb1b03894967 | realharryhero/newllvmproject | libc/src/math/generic/nextupf16.cpp | #include "src/math/nextupf16.h"
#include "src/__support/FPUtil/ManipulationFunctions.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(float16, nextupf16, (float16 x)) {
return fputil::nextupdown</*IsDown=*/false>(x);
}
} // namespace L... | ALGO | 0.97948 | 5.597589 |
b65359d7-54c6-4eb1-868c-e033554b9745 | dotnet/runtime | src/tests/Interop/PInvoke/Generics/GenericsNative.VectorU.cpp | #include <stdio.h>
#include <stdint.h>
#include <xplatform.h>
#include <platformdefines.h>
typedef struct {
uint32_t e00;
uint32_t e01;
uint32_t e02;
uint32_t e03;
} VectorU128;
typedef struct {
uint32_t e00;
uint32_t e01;
uint32_t e02;
uint32_t e03;
uint32_t e04;
uint32_t e05;... | TOOL | 0.940098 | 5.342156 |
8effe831-d41e-46dd-95a8-a79433c14646 | ermine27/competitive-programming | src/atcoder/abc/252/252-c.cpp | #include <bits/stdc++.h>
using namespace std;
#define reps(i,s,n) for(int i = (int)(s); i < (int)(n); ++i)
#define rep(i,n) reps(i,0,n)
using vi = vector<int>;
using vvi = vector<vi>;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) {... | ALGO | 0.998798 | 3.842618 |
3b73d72f-1296-4337-8aa8-1a848292587e | cheshirekow/openbookfs | src/backend/Backend.cpp | /**
* @file src/backend/Backend.cpp
*
* @date Apr 9, 2013
* @author Josh Bialkowski (<EMAIL>)
* @brief
*/
#include <ctime>
#include <iostream>
#include <fstream>
#include <boost/filesystem.hpp>
#include <crypto++/files.h>
#include <crypto++/rsa.h>
#include <crypto++/osrng.h>
#include <soci/soci.h>
#in... | WEB | 0.899292 | 4.129506 |
1c721b4d-a567-4080-b3dc-51e5c085cfe9 | thr33amigoz/341project5 | driver3.cpp | #include <iostream>
#include "hash.h"
#include "donut.h"
// Prototype for 16 bit cyclic hash function; implementation is after
// main().
unsigned cyclic_hash16(string key);
unsigned myHash(string key);
int main() {
// Create a vector of donuts... | ALGO | 0.995489 | 4.324806 |
c15bd03f-9e5b-45b0-b785-c28c96ab9306 | SonuRajput1010/DSA_GFG | Easy/The Nth Fibonnaci/the-nth-fibonnaci.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
int fib(int n){
//code here
if(n==0) return 0;
if(n==1) return 1;
if(n==2) return 1;
int a=1,b=1,c;
for(int i=3;i<=n;i++){
c=(a+b)%10;
... | ALGO | 0.999825 | 6.019967 |
f91ee29b-aa45-4f69-a3d2-cf8cfcd802fd | ishandutta2007/codeforces | huah/normal/1535/E.cpp | #include<bits/stdc++.h>
typedef unsigned long long ull;
typedef long long ll;
#define inf 0x3f3f3f3f3f3f3f3fll
#define rep(i,l,r) for(int i=l;i<=r;i++)
#define nep(i,r,l) for(int i=r;i>=l;i--)
void sc(int &x){scanf("%d",&x);}
void sc(int &x,int &y){scanf("%d%d",&x,&y);}
void sc(int &x,int &y,int &z){scanf("%d%d%d",&x,&... | ALGO | 0.999825 | 3.845123 |
28e3abdf-83f8-4ef7-9ec6-703512e87a64 | CaioCity/Competitive_Programming_Questions | AtCoder/Contest351/C.cpp | // https://atcoder.jp/contests/abc351/tasks/abc351_c
// Merge the balls
#include <iostream>
#include <math.h>
#include <vector>
std::vector <int> V;
void operation (int i);
int main(){
int N;
double A;
std::cin>>N;
for(int i=0; i<N; i++){
std::cin>>A;
V.push_back(A);
operation(V.size()-1);
}
... | ALGO | 0.999105 | 4.172181 |
69fd6c37-eae7-47e7-a3a2-957051d2eab3 | hutslib/Advanced-Computer-Graphics | Naive_Laplacian_Deformation/MeshViewer/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_norm.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
using namespace Eigen;
int main()
{
VectorXf v(2);
MatrixXf m(2,2), n(2,2);
v << -1,
2;
m << 1,-2,
-3,4;
cout << "v.squaredNorm() = " << v.squaredNorm() << endl;
cout << "v.norm() = " << v.norm() << endl;
cout << "v.lpN... | ALGO | 0.997519 | 4.034037 |
c4d316f7-d0ea-40ce-b966-e12268488bb9 | yccyenchicheng/SDFusion | preprocess/isosurface/tbb/tbb2018_20180822oss/examples/parallel_reduce/convex_hull/convex_hull_bench.cpp | /*
This file contains a few implementations, so it may look overly complicated.
The most efficient implementation is also separated into convex_hull_sample.cpp
*/
#include "convex_hull.h"
typedef util::point<double> point_t;
#ifndef USETBB
#define USETBB 1
#endif
#ifndef USECONCVEC
#define USECON... | ALGO | 0.999944 | 5.224557 |
9f989f86-15f5-4f89-ba0c-b4d951f99b6d | qiaozishun4/CSP2024_BJ | BJ-Senior/answers/BJ-S00537/arena/arena.cpp | //HMZ于东方升起,如利剑般驱散黑暗,撒遍光明,化解迷茫,指引道路,构筑世界之真理!
#include <bits/stdc++.h>
using namespace std;
void write(__int128 x) {
if (x < 10) {
putchar(x ^ 48);
return;
}
write(x / 10);
putchar(x % 10 ^ 48);
}
char d[21][1000005];
int A[100005], c[100005], a[100005];
long long ans[100005];
int ABC[4];
int cnt[21];
bool p[1000... | ALGO | 0.999961 | 3.999225 |
abee2341-de6d-4721-896e-c9f91d035145 | octoplus/algorithms | 排序/quicksort.cpp | #include <bits/stdc++.h>
using namespace std;
int partion(int a[], int low, int high)
{
int i = low - 1;
int k = a[high];
/*
i从虚无中来
i所到之地,即为k征服之地
霸业已成,i与k毗邻
*/
for (int j = low; j < high; j++)
{
if (a[j] <= k)
{
i++;
if (i != j)
... | ALGO | 0.999967 | 3.93819 |
d715f27a-9867-4ea4-81dd-918c2b5abfaa | knotsid/contribute-exe | C++/DP-patterns/Bitmask-DP/partition-to-k-equal-sum-subsets.cpp | class Solution
{
bool flag;
int group, n;
void solve(vector<int> &A, int idx, int curr, int mask)
{
// all elements are taken
if (mask == (1 << n) - 1)
{
flag = true;
return;
}
// if curr groupsize == required groupsize, create new group
... | ALGO | 0.999982 | 5.256339 |
f2ce45fb-1205-4a33-a63a-dcc4bd4fe5ee | AtknDemirel/Sabanci-CS204 | HW3/activity_bst (HW).cpp | //
// main.cpp
// atakan.demirel_Demirel_Atakan_3
//
// Created by Atakan Demirel on 7.11.2022.
//
#include <iostream>
#include "activity_bst.h"
using namespace std;
//given func
string fill_with_zeros(int num_zeros, const string& input){
unsigned long zeros_to_add = num_zeros - input.length();
if (zeros_to_add < ... | ALGO | 0.98607 | 4.629799 |
3a59823f-a248-4659-b2d4-eaae8073b07e | brkpplr/school_bhcc | 2021_01Spring_CSC284_Advanced_C++/Class Code/ClassNotes/Final Source Code/c01_code/09_InitializerLists/InitializerLists.cpp | #include <iostream>
#include <initializer_list>
using namespace std;
int makeSum(initializer_list<int> lst)
{
int total = 0;
for (int value : lst) {
total += value;
}
return total;
}
int main()
{
int a = makeSum({ 1,2,3 });
int b = makeSum({ 10,20,30,40,50,60 });
cout << a << endl;
cout << b << endl;
c... | ALGO | 0.856678 | 5.094754 |
a4e04dae-fb90-4643-ad2a-838d4372668b | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_9920_17.cpp | #include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
int a[411100], cnt[411100];
int sum[411100];
int idx[411100];
int freq_cnt[411100];
int main() {
int n;
cin >> n;
memset(cnt, 0, sizeof(cnt));
for (int i = 1; i <= n; ++i) {
cin >> a[i];
cnt[a[i]]++;
}
int max_idx = max_e... | ALGO | 0.999974 | 4.415283 |
aef48bc7-912f-4068-9f52-b185cd9411de | biancama/hackerRank_CPlus | algorithms/warmup/sockMerchant/Solution.cpp | //
// Created by Massimo Biancalani on 2019-02-18.
//
#include <vector>
#include <map>
using namespace std;
int sockMerchant(int n, vector<int> ar) {
map<int, unsigned int> counterMap;
unsigned int result = 0;
for (auto const& element : ar) {
if (counterMap.count(element) > 0) {
counter... | ALGO | 0.999826 | 6.11519 |
532184af-e1c0-4a6d-8210-69e8c9fa29f1 | 200221192/DAA_ASSIGNMENT | week11/w11_question1.cpp | #include<iostream>
#define size 30
using namespace std;
int MatrixChainOrder(int p[], int i, int j)
{
if (i == j)
return 0;
int k;
int min = INT_MAX;
int count;
for (k = i; k < j; k++)
{
count = MatrixChainOrder(p, i, k) + MatrixChainOrder(p, k + 1, j) + p[i - 1] * p[k] * p[j];
if (count < min)
min = c... | ALGO | 0.999989 | 3.668837 |
3a57b8c2-75c5-4ad1-b474-4d8008b6ae6c | antusaha970/My-source-code-DSA | loveBabbar/uglynum.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int uglynum(int n){
int c2(0),c3(0),c5(0);
vector<int>dp(n+1);
dp[0] = 1;
for(int i = 1; i<=n; i++){
dp[i] = min({2*dp[c2],3*dp[c3],5*dp[c5]});
if(2*dp[c2]==dp[i])
c2++;
if(3*dp[c3]==dp[i]... | ALGO | 0.999865 | 4.022719 |
03ec37fb-eb92-40b7-bb52-757a3262c4fc | ngdp-trinity/wowemu | dep/g3dlite/source/stringutils.cpp | /**
\file stringutils.cpp
\maintainer Morgan McGuire, http://graphics.cs.williams.edu
\created 2000-09-09
\edited 2011-08-20
*/
#include "G3D/platform.h"
#include "G3D/stringutils.h"
#include "G3D/BinaryInput.h"
#include <algorithm>
#ifdef G3D_WINDOWS
extern "C" {
// Define functions for ffmpeg since w... | TOOL | 0.956527 | 6.40893 |
ebb9bdc2-5c22-4f51-a6e0-1d5165950323 | r0r0k/BOJ | 정렬/10814/10814.cpp | #include <iostream>
#include <algorithm>
using namespace std;
class MemberInfo
{
public:
int age;
string name;
int time; // age가 같을 때 가입 시간을 기준으로 정렬해야 하기 때문
MemberInfo() {}
MemberInfo(int age, string name, int time)
{
this->age = age;
this->name = name;
this->time = tim... | ALGO | 0.999889 | 5.141974 |
4854db9c-5711-40f9-bc3e-e6ab5dd57bd6 | ku-dml/SDsystem | OGDF/src/ogdf/lib/abacus/history.cpp | #include <ogdf/lib/abacus/history.h>
#include <iomanip>
using std::setw;
namespace abacus {
std::ostream& operator<<(std::ostream& out, const History &rhs)
{
int64_t min; //!< total minutes
int64_t rmin; //!< total minutes modulo 60
int64_t rsec; //!< total seconds modulo 60
const double e... | ALGO | 0.933315 | 6.890802 |
0a5a7bdf-6fd5-43af-92fc-4128c1570e33 | Madhu-Biradakota/Mutation-Testing-using-DeepState | Final_SM_2/StringManipulator.mutant.161.cpp | #include "StringManipulator.h"
#include <algorithm>
#include <cctype>
#include <sstream>
#include <iterator>
#include <map>
#include <stdexcept>
#include <locale>
#include <regex>
#include <numeric>
std::string StringManipulator::reverse(const std::string& str) {
std::string reversed = str;
std::reverse(revers... | TOOL | 0.886659 | 6.449962 |
ab95c491-229c-4f34-915b-246f3b5e9df1 | kiko-serra/PROG_FEUP | 05/P05/ex4.cpp | #include <iostream>
using namespace std;
#include <iostream>
using namespace std;
//! Complex number
struct complex {
int real; // Real part
int img; // Imaginary part
};
//! Print array of complex numbers.
void print(const complex z[], int n) {
cout << "[ ";
for (int i = 0; i < n; i++) {
if (z[i].r... | ALGO | 0.997954 | 4.12548 |
06d645ef-8179-4f7e-be81-bfcb65119cbb | sarba2003/Supreme-DSA-Daywise-Solve | Pattern Printing/Day 2/numericHalfPyramid.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cout << "Enter the Number" << endl;
cin >> n;
for (int row = 0; row < n; row++)
{
for (int col = 0; col < row + 1; col++)
{
cout << col + 1 << " ";
}
cout << endl;
}
} | ALGO | 0.990632 | 4.008502 |
5a468fc9-64de-42b2-b398-738f00369b90 | rsk0315/codefolio | utility/zip.cpp | #include <cstdio>
#include <vector>
#include <tuple>
#include <utility>
template <class... Containers>
class zipped_containers {
static constexpr auto is = std::make_index_sequence<sizeof...(Containers)>{};
using value_type = std::tuple<typename Containers::value_type...>;
using reference = std::tuple<typename C... | ALGO | 0.940618 | 4.705841 |
b45e4690-f2c5-4bc4-8e1f-08b77d6d44a2 | william1lai/UVa-OJ-Problems | 10008.cpp | #include <iostream>
#include <algorithm>
#include <cctype>
#include <string>
using namespace std;
struct letterCounter
{
char letter;
int count;
};
void swap(letterCounter* arr, int f, int s)
{
letterCounter temp = arr[f];
arr[f] = arr[s];
arr[s] = temp;
}
void insertionSort(letterCounter* arr)
{
int n = 26;
... | ALGO | 0.999718 | 4.431538 |
87f93a79-26a8-4aa5-a075-b7dac85ab178 | Stefanstud/leetcode-env | data/leetcode_solutions/solutions/0407. Trapping Rain Water II/0407.cpp | struct T {
int i;
int j;
int h; // heightMap[i][j] or the height after filling water
T(int i, int j, int h) : i(i), j(j), h(h) {}
};
class Solution {
public:
int trapRainWater(vector<vector<int>>& heightMap) {
const int m = heightMap.size();
const int n = heightMap[0].size();
const vector<int> ... | ALGO | 0.999968 | 7.058556 |
4497fd27-9a5a-4395-b1df-903af0184a07 | BlissfulDystopian/my-study-recap | Data Structure/StackArrayOnC.cpp | #include <stdio.h>
/*
Bagaimana ini bekerja?
- By default top bervalue -1 (artinya stack masih kosong)
- Push() bekerja memasukkan value dari index terakhir ke index pertama
- Pop() bekerja sebaliknya
- display() bekerja dari index top hingga menemukan nilai NULL ('\0')
*/
void push(char element, char *stack, in... | ALGO | 0.989507 | 4.454082 |
20e5cd34-769a-46b2-a3fe-5e3de3353700 | ishandutta2007/codeforces | timmyfeng/normal/1695/D1.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ar array
const int mxN=2e5;
int n;
set<int> adj[mxN];
void solve() {
cin >> n;
if (n==1) {
cout << "0\n";
return;
}
for (int i=0; i<n; ++i)
adj[i].clear();
for (int i=1; i<n; ++i) {
int u, v;
cin >> u >> v, --u, --v;
adj[u].i... | ALGO | 0.999574 | 4.980684 |
38e7f0b4-0a2c-4fb7-82f0-5dadfac64870 | Vincenwwx/hpcGPU | include/OpenCL/Program.cpp | #include "Program.hpp"
#include <Core/Error.hpp>
#include <OpenCL/GetError.hpp>
#include <boost/algorithm/string.hpp>
#include <sstream>
#include <fstream>
namespace OpenCL {
static std::string logsToString (const std::vector<std::string>& logs) {
std::stringstream str;
for (size_t i = 0; i < logs.size (... | TOOL | 0.897086 | 6.735435 |
b098775a-7e18-4194-8858-7a94f8d8029b | KhanShaheb34/Solved-OJ-Problems | Codeforces/CF764A_Taymyr is calling you.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int n, m, z;
cin>>n>>m>>z;
int big = max(n,m);
int small = min(n,m);
int lcd;
if(big%small) {
for(int i=big;;i+=big)
if(i%small==0){
lcd = i;
break;
}
}
else lcd = b... | ALGO | 0.999814 | 3.41721 |
e51d94fd-93d8-41a1-a54f-b004b5b21b7b | praymeta/Code-Up-Algorithm | PRG0_CreateArrays6.cpp | #include <string>
#include <vector>
using namespace std;
vector<int> solution(vector<int> arr) {
vector<int> answer;
for(int i = 0; i < arr.size(); i++) {
if(answer.size() == 0)
answer.push_back(arr[i]);
else if(answer.back() == arr[i])
answer.pop_back();
else
... | ALGO | 0.99996 | 5.52967 |
b3b84f7d-980d-4ba0-a7a5-1bb3c72a2184 | akshiita07/DAA-Assignments | 2/Ass2 Q1.cpp | /*
1. Activity Selection problem
*/
#include<iostream>
using namespace std;
void activity_selector(int s[],int f[],int n){
int k=0;
cout<<"Activities selection order: \n "<<k<<" ";
//traverse from second activity to nth one (index from 0 so start from 1)
for(int m=1;m<n;m++){
//check if start time of new job>... | ALGO | 0.999941 | 4.616798 |
cfa5f4ec-f00a-4a99-9794-5a59aac4de54 | chltkdgns1/Algorithm_first | 영역 구하기.cpp | #include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
int map[100][100];
bool check[100][100];
int data_arr[10000];
int index;
int n, m, k;
int dx[4] = { 0,0,1,-1 };
int dy[4] = { 1,-1,0,0 };
void bfs(int xpos, int ypos) {
queue <pair<int, int>> q;
q.push({ xpos,ypos });
check[ypos][xpos] = ... | ALGO | 0.999879 | 3.274258 |
1c4872d3-35f7-4e78-9693-6badf3ce84fa | SkyLoaderr/xray-short-story | SDK/sources/MagicSoftware/FreeMagic/Source/Distance3D/MgcDist3DLinRct.cpp | #include "MgcDist3DLinLin.h"
#include "MgcDist3DVecRct.h"
#include "MgcDist3DLinRct.h"
using namespace Mgc;
static const Real gs_fTolerance = 1e-05f;
//----------------------------------------------------------------------------
Real Mgc::SqrDistance (const Line3& rkLine, const Rectangle3& rkRct,
Real* pfLinP, Re... | ALGO | 0.998922 | 3.910678 |
d670d616-c1ae-4f23-9f16-7949d476b328 | Evervolv/android_hardware_qcom_gps | msm8994/utils/loc_misc_utils.cpp | #include <stdio.h>
#include <string.h>
#include <log_util.h>
#include <loc_misc_utils.h>
#include <ctype.h>
#define LOG_NDDEBUG 0
#define LOG_TAG "LocSvc_misc_utils"
int loc_util_split_string(char *raw_string, char **split_strings_ptr,
int max_num_substrings, char delimiter)
{
int raw_st... | TOOL | 0.975849 | 5.380703 |
348d8778-9445-46fa-933c-c521573ad4a1 | pingfansong/CDLSR | CDLSR_NIR/SPAMS/decomp/mex/mexRidgeRegression.cpp | /*!
* \file
* toolbox Linalg
*
* by Julien Mairal
* <EMAIL>
*
* File mexConjGrad.h
* \brief mex-file, function mexConjGrad.h
* Usage: x = mexRidgeRegression(b,A,x0,param);
* Usage: x = mexRidgeRegression(b,delta,A,x0,param); */
#include <mex.h>
#... | ALGO | 0.998024 | 6.012985 |
27afacaf-8fc9-4086-ac2d-d71b88e9a1f7 | eddyseed/LanguageStock | C++/Dry_Run_Exercises/12.1.cpp | #include <iostream>
#define ARR_LIMIT 5
template <class T>
void fun(T arg1, int arg2){
std::cout << "Fun 1: " << arg1 << " " << arg2 << std::endl;
}
template <class T1, class T2>
void fun(T1 arg1,T2 arg2){
std::cout << "Fun 2: " << arg1 << " " << arg2 << std::endl;
}
int main(){
fun(25,25.0);
} | TOOL | 0.932847 | 4.672488 |
3bc32f69-0e74-45f9-bc72-b5fe34191621 | ishandutta2007/codeforces | coderanshu/normal/1100/C.cpp | #include<bits/stdc++.h>
using namespace std ;
#define M 1000000007
#define MM 998244353
#define ll long long
#define pb push_back
#define mem0(a) memset(a,0,sizeof(a))
#define mem1(a) memset(a,-1,sizeof(a))
#define memf(a) memset(a,false,sizeof(a))
#define all(v) v.begin(),v.end()
#define F first
#define S second
#d... | ALGO | 0.999476 | 4.183944 |
4bc79350-9697-468d-ae6d-bec3615b201c | Cookiefan/ZigZag | Zigzag/Augest/Aug 14/C.cpp | // #pragma comment(linker, "/STACK:102400000,102400000")
#include <bits/stdc++.h>
#define maxn 200020
#define maxm 200020
using namespace std;
struct edge
{
int s, t, next;
}e[maxm];
int tot;
int fir[maxn];
int vis[maxm], val[maxn], cost[maxm], dg[maxn];
int f[maxm], g[maxm], ans[maxn];
int n, o, step;
inline void d... | ALGO | 0.99984 | 3.741282 |
0735f1ea-373a-4587-92a5-3358e1df34d7 | GaisaiYuno/OI-Record-exe-deleted | Grade 10-12/2018 autumn/NOIP/NOIP2018提高组Day2程序包/answers/GD-0165/defense/defense.cpp | #include<cstdio>
#include<cstring>
#define fo(i,x,y) for(int i=x;i<=y;i++)
#define min(a,b) ((a)<(b)) ? (a):(b)
#define ll long long
using namespace std;
const int N=1e5+5;
const ll Inf=1e13+7;
int d[N<<2][4],c[N],n,m,x,y,p[N],mm,x1,x2,b1,b2;
ll f[N][4];
char s[5];
void ins(int x,int y){
d[++mm][1]=x; d[mm][2]=y; d[mm... | ALGO | 0.999876 | 3.724529 |
28cabd85-25bc-4d15-b719-233f2ffe2a96 | ishandutta2007/codeforces | kostaskostil/normal/1305/F.cpp | #include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
using namespace std;
#define int long long
int binpow(int a, int b, int m)
{
int res=1;
while (b)
{
if (b&1) res*=a, res%=m;
a*=a, a%=m;
b>>=1;
}
return res;
}
const int nmax=2e5+100;
int ... | ALGO | 0.99995 | 3.441163 |
ba1a5dd3-040d-420f-833b-662afb644f61 | trianglecirclexyz/hackdavis2022 | eatis/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.998365 | 6.797273 |
7dd0b291-be95-4a56-ab46-12ee8dcbc572 | almulalic/Algoritmi-I-Strukture-Podataka-2020 | Sorting-Algorithms/Z1/main.cpp | #include <iostream>
#include <fstream>
#include <time.h>
#include <stdlib.h>
#include <stdexcept>
using namespace std;
//region Sorting algoritmi
template <typename T>
void swap(T &a, T &b) {
T temp(a);
a = b;
b = temp;
}
template <typename T>
void bubble_sort(T* niz,int vel) {
for(int i=0;i<vel;++... | ALGO | 0.998313 | 4.982177 |
9b47c3b0-0221-4719-9ea3-aaa1114820db | Ishantchaturvedi/DsaCpp | circularii.cpp | #include<iostream>
using namespace std;
class node{
public:
int data;
node* next;
node(int val){
data=val;
next=NULL;
}
};
void insertAtHead(node* &head, int val){
node* n=new node(val);
if(head==NULL){
n->next=n;
head=n;
return;
}
node*... | ALGO | 0.999868 | 4.031997 |
4668af42-527e-41db-a17b-e9ca3383e5d2 | raincross7/code-similarity | codes/train_code/problem117/problem117_464.cpp | // AOJ ITP1_2_B
#include<cstdio>
int main()
{
int a, b, c;
scanf( "%d%d%d", &a, &b, &c );
puts( a < b && b < c ? "Yes" : "No" );
return 0;
} | ALGO | 0.999978 | 3.853257 |
77671a4d-d385-4870-b0d2-9b3c49af1399 | Daibingh/MyAlgoLearning | 算法与数据结构/cpp_leetcode/268 缺失数字/main.cpp | #include "bits/stdc++.h"
using namespace std;
/*
给定一个包含 0, 1, 2, ..., n 中 n 个数的序列,找出 0 .. n 中没有出现在序列中的那个数。
-----------------------------------
- 0 ^ n = n 与零异或是它本身
- n ^ n = 0 相同的数异或得零
*/
// 异或运算
class Solution2 {
public:
int missingNumber(vector<int>& nums) {
int res = nums.size();
for (int i=0;i... | ALGO | 0.999668 | 4.799595 |
cbfc6221-05d6-42a5-b30d-e9f033e7e159 | Apress/learn-cocos2d-game-dev-w-ios-5 | CH04_code/DoodleDrop01/libs/Box2d/Dynamics/Joints/b2PrismaticJoint.cpp | #include <Box2D/Dynamics/Joints/b2PrismaticJoint.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2TimeStep.h>
// Linear constraint (point-to-line)
// d = p2 - p1 = x2 + r2 - x1 - r1
// C = dot(perp, d)
// Cdot = dot(d, cross(w1, perp)) + dot(perp, v2 + cross(w2, r2) - v1 - cross(w1, r1))
// = -dot... | ALGO | 0.999263 | 7.646193 |
eda16ac2-47ed-4869-a74f-b29efad75f9e | Kgotta-contribute/Leetcode | Strivers - Check If Array is Sorted and Rotated/s.cpp | class Solution {
public:
bool check(vector<int>& nums)
{
int n = nums.size();
int count = 0;
for (int i = 0; i < n; i++) // 3 4 5 1 2
{
// formula when we rotate an array A then it results into array B
if (nums[i] > nums[(i + 1) % n]) // A[i] = B[ (... | ALGO | 0.999863 | 4.256673 |
34a83030-d19e-44eb-ae98-a93ae89b174a | yadiqian/Codeforces | 96A.cpp | /*
Yadi Qian
*/
#include <bits/stdc++.h>
using namespace std;
const double pi=acos(-1.0);
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<PII> VII;
typedef vector<VI> VVI;
typedef map<int,int> MPII;
typedef set<int> SETI;
typedef multiset<int> MSETI;
typedef long int i... | ALGO | 0.99998 | 3.928706 |
13beca42-58cc-4af1-9b2f-b41303e8e7b4 | ishandutta2007/codeforces | chemthan/normal/513/E2.cpp | #include <bits/stdc++.h>
using namespace std;
#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); i--)
#define FORall(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define sz(a) int((a).size())
... | ALGO | 0.999981 | 3.710481 |
4379bcb1-7bbf-488a-82e0-f40a74e0b7a9 | Kovidsai/My_CP_Learning | Contests/CodeForces/169 (Rated for Div. 2)/B. Game with Doors.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using lld = long double;
// #define int ll
#define MOD 1000000007
#define MOD1 998244353
#define INF 1e18
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define ff first
#define ss second
#define PI 3.1415... | ALGO | 0.992379 | 3.372564 |
26014a97-8240-43b8-9290-6b5496b86fd3 | cran/anomaly | src/tukey.cpp | #include <math.h>
#include <stdlib.h>
#include <list>
#include "tukey.h"
void tukey_object::add_an_x_and_x_squared(double x, double x_squared)
{
number_of_observations++;
mean_of_x_squared += (x_squared-mean_of_x_squared)/number_of_observations;
mean_of_x += (x-mean_of_x)/number_of_observations;
min_co... | ALGO | 0.993142 | 4.97526 |
e57d8e37-c3f6-433b-83f8-5dbeb25fe472 | 735756516/SpeedGear | GearInject/mhook-lib/mhook.cpp | #include <windows.h>
#include <tlhelp32.h>
#include <stdio.h>
#include "mhook.h"
#include "../disasm-lib/disasm.h"
//=========================================================================
#ifndef cntof
#define cntof(a) (sizeof(a)/sizeof(a[0]))
#endif
//==============================================================... | TOOL | 0.925575 | 4.15832 |
984f2575-2c13-43f9-9005-4d9977de5a2e | roshnimishraa/Leetcoding | 0230-kth-smallest-element-in-a-bst/0230-kth-smallest-element-in-a-bst.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.79279 |
5ad38b65-e111-4ac6-ab53-fa1e7baff13b | marmalade/toe | airplay/modules/box2d/trunk/Box2D/Box2D/Collision/b2Distance.cpp | #include <Box2D/Collision/b2Distance.h>
#include <Box2D/Collision/Shapes/b2CircleShape.h>
#include <Box2D/Collision/Shapes/b2EdgeShape.h>
#include <Box2D/Collision/Shapes/b2LoopShape.h>
#include <Box2D/Collision/Shapes/b2PolygonShape.h>
// GJK using Voronoi regions (Christer Ericson) and Barycentric coordinates.
int32... | ALGO | 0.999954 | 3.680516 |
b6788875-0828-4865-bf4a-87f283935658 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_9834_21.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int k;
cin >> k;
char ch[4][22];
for (int i = 1; i < 22; i++) ch[2][i] = '.';
ch[2][0] = '#';
for (int i = 0; i < 4; i++) {
if (i == 2) continue;
for (int j = 0; j < 22; j++) {
if (j & 1)
ch[i][j] = '.';
else
ch[i... | ALGO | 0.999615 | 3.085989 |
7be99bb4-f4cf-4f46-9639-6c634c91664d | ishandutta2007/codeforces | evilbuggy/normal/223/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const int maxn = 2005;
ll k, ncr[maxn], a[maxn], s[maxn];
ll modPow(ll a, ll b){
ll ans = 1;
while(b){
if(b&1)(ans *= a) %= mod;
(a *= a) %= mod;
b >>= 1;
}
return ans;
}
ll compute(ll n, ll r){
if(n < r)retur... | ALGO | 0.999944 | 3.406844 |
9ea0580e-5a6f-4b06-8646-a314660794f6 | Mohammad-Imran01/Data-structures-and-Algorithms | DSA Udemy/06. Matrices/03MatricesIII.cpp | #include <iostream>
using namespace std;
class element {
public:
int i, j, val;
};
class sparse {
private:
element *ele;
int m, n, nums;
public:
sparse (int i, int j, int all_ele) {
m = i+1;
n = j+1;
nums = all_ele;
ele = new element[nums];
}
~sparse() { delete[... | ALGO | 0.90958 | 3.436621 |
05d8c25c-f032-43a0-b9ae-02a0caeb684c | ishandutta2007/codeforces | heart_blue/normal/332/B.cpp | #include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bi... | ALGO | 0.999976 | 3.613988 |
657e6cde-d331-4823-ad21-d41f1f233e00 | anialsonus/madlib | src/modules/stats/clustered_variance_coxph.cpp |
/* ----------------------------------------------------------------------
Clustered Variance estimator for CoxPH model
---------------------------------------------------------------------- */
#include <dbconnector/dbconnector.hpp>
#include <modules/shared/HandleTraits.hpp>
#include <modules/prob/boost.hpp>
#i... | ALGO | 0.999472 | 6.181821 |
d5b87a7a-b3e9-4b7a-a8c3-39a49896c288 | minblock/focalcoin | src/crypto/chacha20.cpp | // Based on the public domain implementation 'merged' by D. J. Bernstein
// See https://cr.yp.to/chacha.html.
#include <crypto/common.h>
#include <crypto/chacha20.h>
#include <string.h>
constexpr static inline uint32_t rotl32(uint32_t v, int c) { return (v << c) | (v >> (32 - c)); }
#define QUARTERROUND(a,b,c,d) \
... | ALGO | 0.999332 | 6.864372 |
88063be9-5531-406e-8452-6d52ded935d0 | hajimeIppo-cmd/cp-codes | Baekjoon OJ/01000-01999/1175.cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
const int dy[] = { 1, 0, -1, 0 };
const int dx[] = { 0, 1, 0, -1 };
int n, m;
int sy, sx, ey1 = -1, ex1, ey2, ex2;
vector<string> a;
int dist[55][55][4][4];
void bfs() {
for (int i = 0; i < 55; i++) {
for (int j = 0; j < 55; j++) {
... | ALGO | 0.999912 | 4.529457 |
b2f5d55f-e3a6-4d29-a8a2-e5ae8a7d045e | gerald-yang/iotivity-demo | iotivity-1.0.1/extlibs/boost/boost_1_58_0/libs/msm/doc/PDF/examples/TestInternal.cpp | #include <iostream>
#include "boost/mpl/vector/vector30.hpp"
// back-end
#include <boost/msm/back/state_machine.hpp>
//front-end
#include <boost/msm/front/state_machine_def.hpp>
#include <boost/msm/front/functor_row.hpp>
#include <boost/msm/front/internal_row.hpp>
namespace msm = boost::msm;
namespace mpl = boost::mp... | TOOL | 0.907876 | 6.231935 |
844c3d4b-78d8-4a86-a0e5-3b2f7b2b08d5 | P79N6A/Codes-1 | hackerRank/Algorithms/Strings/CamelCase.cpp | #include<algorithm>
#include<bitset>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<iomanip>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<string>
#define ll long long
#define pr(x) cout << #x << " = " << (x) << " ; ";
#define prl... | ALGO | 0.999717 | 4.109565 |
332ab263-4c0a-46bf-830f-8b0a60697c20 | iamtanong/2110104_comprog | grader/06_Vector/06_Vector_24.cpp | #include<bits/stdc++.h>
using namespace std;
vector<tuple<double, string, double>> vec;
bool cmp(tuple<double, string, double> a, tuple<double, string, double> b) {
return get<0>(a) > get<0>(b);
}
int main() {
while(1) {
string s; cin >> s;
if(s == "END") break;
double price; cin >>... | ALGO | 0.998662 | 4.090774 |
30a3e725-4774-49cc-a527-ae80e2508f64 | flagflag/FlagGG | 3rd/bgfx/bgfx/3rdparty/spirv-tools/source/opt/strength_reduction_pass.cpp | #include "source/opt/strength_reduction_pass.h"
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <memory>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include "source/opt/def_use_manager.h"
#include "source/opt/ir_context.h"
#include "source/opt/log.h"
#inc... | ALGO | 0.897225 | 7.780653 |
ef344e60-f653-4b62-a8ca-e2fd6fd141ed | Md-Merazul-Islam/DSA-Shortcut | BST/convert_array_to_BST.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node *left;
Node *right;
Node(int val)
{
this->val = val;
this->left = NULL;
this->right = NULL;
}
};
Node *convert(int a[], int n, int l, int r)
{
if(l>r) return NULL;
int mid = (l + r) ... | ALGO | 0.999986 | 4.712777 |
4f423948-ff2c-43f1-87d8-29e37ba265c3 | txgcwm/code_study | cplusplus/boost/boost_1_63_0/libs/accumulators/example/main.cpp | #include <iostream>
#include <algorithm>
#include <boost/ref.hpp>
#include <boost/bind.hpp>
#include <boost/array.hpp>
#include <boost/foreach.hpp>
#include <boost/accumulators/accumulators.hpp>
#include <boost/accumulators/statistics.hpp>
using namespace boost;
using namespace boost::accumulators;
// Helper that use... | ALGO | 0.973301 | 7.107633 |
bd0d8298-0817-4b7f-91ef-3ae17fa54b28 | liuxueyang/cpp | codeforces/contest/1003_div4/2065d_1.cpp | #include <algorithm>
#include <array>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#inclu... | ALGO | 0.999904 | 4.277383 |
b5284d40-365a-48e6-b9d7-d9e8cde3ae99 | Ashdixit382/-6companies30days-RevisewithArsh | 1401. Circle and Rectangle Overlapping.cpp | class Solution {
public:
bool checkOverlap(int r, int h, int k, int x1, int y1, int x2, int y2) {
// O(n^2) time complexity
// for(int x=x1;x<=x2;x++){
// for(int y=y1;y<=y2;y++){
// if(((x-h)*(x-h) + (y-k)*(y-k)) <= r*r){
// return true;
// ... | ALGO | 0.999744 | 4.592498 |
cba83d37-0b97-420c-81a0-f4fcff6e523d | anoobzg/qi | src/blender/src/extern/bullet2/src/BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp | #include "btBoxBoxCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
#include "BulletCollision/CollisionShapes/btBoxShape.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "btBoxBoxDetector.h"
#include "BulletCollision/CollisionDispatch/btCollisionObjec... | ALGO | 0.999412 | 6.599949 |
755640b9-46cc-46e0-b722-d5eb19b09470 | Philoodelf/Tic-Tac-Toe | 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 |
f1909dd6-11b1-476e-9391-5a523379c83b | BBCG/ramr | src/rcpp_fit_beta.cpp | #include <vector>
#include <Rcpp.h>
#include "ramr.h"
// [[Rcpp::plugins(cpp20)]]
// [[Rcpp::plugins(openmp)]]
// Function estimates parameters of (optionally, weighted) beta distribution
// and stores them in the vector of coefficients as
// {[5] alpha (p), [6] beta (q), [7] log(std::beta)}
//
// TODO:
// [ ] nume... | ALGO | 0.973225 | 6.000726 |
04b690c1-d788-47c6-b6f3-33777dbe924c | CTranLam/DSA_PTIT | B23DCCN480/bai2.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
int t; cin >> t;
while(t--){
int n; cin >> n;
queue<string> q;
vector<string> v;
q.push("6");
q.push("8");
while(!q.empty()){
string s=q.front();
q.pop();
... | ALGO | 0.996696 | 4.076411 |
49fde78b-bf46-4277-a56b-6acc29632bae | DywangIT/PTIT-Programing | PTIT-DSA/NHIP CHUNG KHOAN.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define faster() \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
const int MAXN = 1e6 + 5;
const int MOD = 1e9 + 7;
int n;
vector<int> v;
void input()
{
cin >> n;
v.r... | ALGO | 0.999956 | 5.085732 |
27b33b81-c3ac-4c9c-b7ad-4dcbb1ed1277 | Cy30mk3v/NMLT | Lab03/Ex_2.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
int n;
do {
printf("Nhap chieu cao tuong: ");
scanf("%i", &n);
} while (n < 1 || n>20);
for (int i = 0; i < n; i++)
{
int j = 0;
for (j; j < n - i -1; j++) //Ngược lại: for(int j=h-i-1;j>0;j--)
{
printf(" ");
}
for (j; j < n+1; j++)/... | ALGO | 0.998884 | 3.070155 |
8606178b-7bb4-426e-a131-7fa09523533a | Kawser-nerd/CLCDSA | Source Codes/AtCoder/abc030/C/1129366.cpp | #include <algorithm>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tupl... | ALGO | 0.999952 | 3.397187 |
fe09e78e-d1dd-465a-be00-78652382fbec | TayabAmir/LeetCode_Problems | 2375-minimum-obstacle-removal-to-reach-corner/2375-minimum-obstacle-removal-to-reach-corner.cpp | class Solution {
public:
int minimumObstacles(vector<vector<int>>& grid) {
int n = grid.size(), m = grid[0].size();
priority_queue<pair<int, pair<int, int>>,
vector<pair<int, pair<int, int>>>,
greater<pair<int, pair<int, int>>>>
pq;
p... | ALGO | 0.999978 | 6.048316 |
30de5d54-9727-4fcd-93bf-0046007c471d | ValeriiKoniushenko/VaKon2D | dependencies/boost_1_80_0/libs/msm/doc/PDF/examples/ParsingDigits.cpp | #define FUSION_MAX_VECTOR_SIZE 20
#include <boost/msm/back/state_machine.hpp>
#include "char_event_dispatcher.hpp"
#include <boost/msm/front/state_machine_def.hpp>
#include <boost/msm/front/functor_row.hpp>
#include <boost/timer.hpp>
namespace msm = boost::msm;
namespace mpl = boost::mpl;
using namespace msm::front;
... | ALGO | 0.854388 | 4.750244 |
bf2fc8b6-744b-40fa-bbe0-6d3d64e515ca | drwalton/ray-tracing-lab-iii | 3rdParty/eigen-3.4.0/doc/examples/class_Block.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
template<typename Derived>
Eigen::Block<Derived>
topLeftCorner(MatrixBase<Derived>& m, int rows, int cols)
{
return Eigen::Block<Derived>(m.derived(), 0, 0, rows, cols);
}
template<typename Derived>
const Eigen::Block<const Derive... | TOOL | 0.928128 | 5.901438 |
20d2d7ec-f977-4f32-9757-de4e95935ba2 | abhinavprkash/geeksforgeeks | implementations/appleandorange.cpp | #include <bits/stdc++.h>
#include<stdio.h>
using namespace std;
static bool between(int s, int t, int x)
{
return x >= s && x <= t;
}
int main(int argc, char const *argv[])
{
int s, t;
cin>>s>>t;
int a;
cin>>a;
int o;
cin>>o;
int n, m;
cin>>m>>n;
int temp;
int apple_count =0... | ALGO | 0.999645 | 3.549417 |
42a6dd07-79b9-4a8d-8654-a92db240b77b | patelshubham/cppbeginner | sumofarraywithintercetion.cpp | // problem statement
// suppose you have given two arrays
// A={1,4,7,9,10}
// B={2,4,6,7}
//output would be 1+4+7+9+10
//if none of them are common just make the largest sum
//Input: ar1[] = {2, 3, 7, 10, 12, 15, 30, 34}
// ar2[] = {1, 5, 7, 8, 10, 15, 16, 19}
// Output: 122
// 1,3,5
//2,2,5
// Explanation: ... | ALGO | 0.999836 | 4.8337 |
8fa02431-d03d-4c28-9090-5f81865fd393 | bobby4fischer/CP-31-solutions- | 1600-LEVEL/13.cpp | #include<bits/stdc++.h>
#define god_speed ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);
using namespace std;
#define ll long long
ll gcd(ll a, ll b){if (b == 0)return a;return gcd(b, a % b);} ll lcm(ll a, ll b){return ((a/gcd(a,b))*b);}
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin()... | ALGO | 0.999572 | 4.436184 |
a35a55ca-08e0-41b7-9730-71df76724547 | AkashSingh3031/Striver-SDE-Sheet-Challenge | 13]. Day-13 (Stack and Queue)/CodeStudio/3]. Implement Stack using Queue.cpp | #include<bits/stdc++.h>
class Stack {
queue<int>q;
int siz;
public:
Stack() {
siz=-1;
}
int getSize() {
return q.size();
}
bool isEmpty() {
return (q.empty());
}
void push(int element) {
siz++;
q.push(element);
for(int i=0;i<siz;i++)
... | ALGO | 0.998977 | 4.484956 |
99b271f5-db9c-4efb-a8ac-f7fdd0b982bf | kushal-156/web-page | queue_using_array.cpp | #include<iostream>
#include<vector>
using namespace std;
class Menu{
protected:
int n,elem,i;
vector<int> vec;
public:
void menu(){
cout<<endl<<"Choose an option "<<endl;
cout<<"1. Add an element. "<<endl;
cout<<"2. Remove an element. "<<endl;
... | TOOL | 0.86162 | 3.893955 |
4ecf2f79-9a33-480b-a8fe-acf3ba05069c | llu008/CS471-Course-Project | CS471PROJECT/CPUSCHED/sjf.cpp | #include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#define ARRAY_SIZE 500 // Number of processes to simulate
using namespace std;
// Structure of each process
struct Process {
int arrival; // Arrival time of the process
int burst; // Burst time of the process
int completion; //... | ALGO | 0.999938 | 5.405474 |
0e580eab-c286-4364-bfe7-712efdf73f03 | ZapRender/NascarApp | 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 |
e3eeb85b-b395-4539-b1a5-078bc0a427e5 | ishandutta2007/codeforces | primenumber/normal/332/A.cpp | #include <iostream>
#include <vector>
#include <array>
#include <list>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <string>
#include <algorithm>
#include <numeric>
#include <utility>
#include <cstdlib>
#include <ctime>
#define rep(i,n) for(... | ALGO | 0.999968 | 3.404685 |
e73ea161-a956-479f-a511-7c7e02d27dca | Suraj-Dhankad2025/DSA-Problems-Leetcode | 337-house-robber-iii/house-robber-iii.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.999965 | 6.060217 |
dcff0fb1-e7a1-42de-a490-9701c286ab57 | zhun0922/CppCodingTest_BarkingDog | BarkingDogCpp/BarkingDogCpp/0x02/b15552.cpp | #include <iostream>
using namespace std;
int n;
int a, b;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a >> b;
cout << a + b << '\n';
}
return 0;
} | ALGO | 0.999931 | 4.855081 |
a6e69254-7aed-47ee-9325-e44ac2837cba | rmit-computing-technologies/redbackbots-coderelease | Src/robot/src/motion/generator/WalkCycle.cpp | #include <cmath>
#include <iostream>
#include "motion/generator/WalkCycle.hpp"
const float WalkCycle::movFrac = .4;
WalkCycle::WalkCycle() {
this->useForwardL = 0;
this->useForwardR = 0;
this->useLeft = 0;
this->useTurn = 0;
this->T = 0.5;
this->t = 0;
this->leftPhase = false;
}
WalkCycle::Wal... | ALGO | 0.991295 | 4.298162 |
ffd8683e-13a5-4915-9070-8da7c1638591 | lucasbrunialti/nmtf-coclustering | eigen-eigen-b30b87236a1b/lapack/lu.cpp | #include "common.h"
#include <Eigen/LU>
// computes an LU factorization of a general M-by-N matrix A using partial pivoting with row interchanges
EIGEN_LAPACK_FUNC(getrf,(int *m, int *n, RealScalar *pa, int *lda, int *ipiv, int *info))
{
*info = 0;
if(*m<0) *info = -1;
else if(*n<0) ... | ALGO | 0.997857 | 5.816968 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.