uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
72cf2d23-c62a-4605-ab6d-bc8ff81d225f | LinikerThiers/lista_de_tarefas_gerenciamento_de_estado | 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 |
3ab1e252-0a63-4138-be40-5b92be897fad | Adithya192224035/OSprogramming | DinnerPhilosophyProblem.cpp | #include<stdio.h>
#include<stdlib.h>
#include<pthread.h>
#include<semaphore.h>
#include<unistd.h>
sem_t room;
sem_t chopstick[5];
void * philosopher(void *);
void eat(int);
int main()
{
int i,a[5];
pthread_t tid[5];
sem_init(&room,0,4);
for(i=0;i<5;i++)
sem_init(&chopstick[i],0,1);
for(i=0;i<5;i++)
{
a[i]=i;
... | ALGO | 0.999339 | 3.416062 |
f25068d8-c1b8-4e36-9b52-273df1c7d1f1 | mitchty/ellcc-mirror | llvm/tools/clang/lib/Tooling/JSONCompilationDatabase.cpp | #include "clang/Tooling/JSONCompilationDatabase.h"
#include "clang/Tooling/CompilationDatabase.h"
#include "clang/Tooling/CompilationDatabasePluginRegistry.h"
#include "clang/Tooling/Tooling.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/Path.h"
#include <system_error>
namespace clang {
namespace tooling ... | TOOL | 0.989524 | 7.840125 |
49e30b64-478b-4c5c-a64a-2b9153c2f51e | 4xvgal/learning_storage | lecture23-1/forLecture/ch7/ch7-2-2.cpp | //ch7-2-2.cpp
//세 개의 == 연산자를 프렌드 함수로 작성하라.
#include<iostream>
#include<string>
using namespace std;
class Book {
string title;
int price, pages;
public:
Book(string title="",int price =0, int pages =0) { //매개변수 중복
this-> title = title; this -> price = price; this -> pages = pages;
}
void show(){
cout << title... | ALGO | 0.942702 | 4.489192 |
b18440b3-b4e9-4656-a8bf-ecb7f23f9e71 | jurvis/np-dsa | Prac 08/main.cpp | #include <iostream>
#include "BST.h"
#include <string>
using namespace std;
void displayMenu();
int main(int argc, const char * argv[]) {
BST bst;
ItemType target;
int dataArray[10] = { 55, 28, 87, 32, 90, 16, 45, 79, 66, 30 };
for (int i=0; i<10; i++)
{
bst.insert(dataArray[i]);... | ALGO | 0.995028 | 4.592805 |
08a177c5-0c70-4e78-9abb-359d8243a1c8 | rajesh-s/gpgpu-sim_distribution_CSL | src/intersim2/allocators/islip.cpp | // $Id: islip.cpp 5188 2012-08-30 00:31:31Z dub $
#include "booksim.hpp"
#include <iostream>
#include "islip.hpp"
#include "random_utils.hpp"
//#define DEBUG_ISLIP
iSLIP_Sparse::iSLIP_Sparse( Module *parent, const string& name,
int inputs, int outputs, int iters ) :
SparseAllocator( parent, name, inputs, o... | ALGO | 0.916393 | 4.806187 |
55d9bf54-ba92-45b2-ae53-9539a1e85fd5 | WhiteCells/code | algo/lc/8_greedy/1-455-assign-cookies.cpp | #include "D:/distake/Coding/head_file.h"
/*
* @Author: WhiteCells
* @Date: 2023-05-16 19:21:18
* @Last Modified by: WhiteCells
* @Last Modified time: 2023-05-16 19:21:18
* @Description: 445-分饼干
* https://leetcode.cn/problems/assign-cookies/
*/
class Solution {
public:
int findContentChildren(vector<int>& g,... | ALGO | 0.999938 | 5.962259 |
75e062a8-e8a2-48d3-b19a-036664fe8e54 | GTcoder27/Course_Subjects | Operating System/Bankers.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int A=3,B=17,C=16,D=12;
int given[] ={3,17,16,12};
string processes[] = {"p0","p1","p2","p3","p4"};
int allocation[][4]={
{0,1,1,0},
{1,2,3,1},
{1,3,6,5},
{0,6,3,2},
{0,0,1,4}
};
int max[][4] ={
... | ALGO | 0.999935 | 3.572215 |
e971b423-21d7-4f1f-94a2-4368218b494e | hotstreams/limitless-engine | src/limitless/util/frustum.cpp | #include <limitless/util/frustum.hpp>
#include <limitless/renderer/shader_type.hpp>
using namespace Limitless;
template<Frustum::Planes i, Frustum::Planes j>
struct ij2k { enum { k = (int)i * (9 - (int)i) / 2 + (int)j - 1 }; };
template <Frustum::Planes a, Frustum::Planes b, Frustum::Planes c>
glm::vec3 Frustum::int... | TOOL | 0.963465 | 6.533904 |
2ce29c72-eb69-4118-8343-bf355366051a | nayem030/Cp | week-4/day-11/B.dictonary.cpp | #include<bits/stdc++.h>
using namespace std;
map<string,int>mp;
void solve()
{
string s(2,'.');
int id=0;
for(char ch='a';ch<='z';ch++)
{
for(char _ch='a';_ch<='z';_ch++)
{
if(ch==_ch)
{
continue;
}
s[0]=ch;
s[1]... | ALGO | 0.999244 | 4.293548 |
f3fbc2ad-764e-43ab-8f2e-94dac4ea1beb | rajatenzyme/LeetCode_Solutions | 706-design-hashmap/706-design-hashmap.cpp | class MyHashMap {
public:
vector<int> m;
MyHashMap() {
int sz = 1e6+1;
m.resize(sz);
fill(m.begin(), m.end(), -1);
}
void put(int key, int value) {
m[key] = value;
}
int get(int key) {
return m[key];
}
void remove(i... | ALGO | 0.999154 | 6.28632 |
2080f5da-0544-464f-baab-28a38fe2912c | vinidma/A4--C | exercicio2_A4.cpp | /*. Desenvolva um programa que recebe o nmero de cadastro (inteiro) de trs clientes de
uma loja e o valor (em reais) que cada um desses clientes pagou por sua compra. O
programa dever informar:
a. o valor total pago pelos trs clientes;
b. o valor da compra mdia efetuada;
c. o nmero de cadastro dos clientes que efetuara... | DATA | 0.984684 | 3.367204 |
45f5f01c-3162-46a4-bf46-738ff6945245 | karan-2906/CNS-CODES | Exp4/cryptolib/dh2.cpp | // dh2.cpp - originally written and placed in the public domain by Wei Dai
#include "pch.h"
#include "cryptlib.h"
#include "misc.h"
#include "dh2.h"
NAMESPACE_BEGIN(CryptoPP)
#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
struct NullCryptoParameters : public CryptoParameters
{
void AssignFrom(... | ALGO | 0.973873 | 6.774203 |
19c84219-793d-442c-ae03-ab03e2d6fb2d | mangoleaves/RobustCage | src/ThirdPartyLib/IndirectPredicates/numerics.cpp | ///////////////////////////////////////////////////////////////////////////////////////////////////////
//
// To compile on MSVC: use /fp:strict
// On GNU GCC: use -frounding-math
//
///////////////////////////////////////////////////////////////////////////////////////////////////////
#include "numerics.h"
void expa... | ALGO | 0.992768 | 4.559138 |
95c127b8-7df9-44b8-a858-56e7fb46b1f8 | RulLu16/baekjoon_problems | 4949.cpp | #include <stdio.h>
#include <stack>
using namespace std;
int main(){
stack <char> bracket;
int found=0;
int only=0;
char temp;
while(scanf("%1c",&temp)!=NULL){
if(temp=='.'){
if(only==0){
break;
}
getchar();
if(bracket.empty() && found==0){
printf("yes\n");
}
else{
printf("no\n"... | ALGO | 0.999788 | 3.740105 |
2e87f4ad-c78f-4e84-a5a7-81d3eee91f41 | krishna9809/DSA-with-cpp | Day033/Questions/3rd.cpp | // 680. Valid Palindrome II
class Solution
{
public:
bool checkpalindrome(string s, int i, int j)
{
while (i <= j)
{
if (s[i] != s[j])
{
return false;
}
else
{
i++;
j--;
}
... | ALGO | 0.999987 | 5.848893 |
497b444b-105f-4606-bfdb-f2b6c31214f2 | hanshikaCodes/AlgorithmPrograms | findrank.cpp | #include<iostream>
#include<cstdlib>
using namespace std;
int randompivot(int *arr,int i,int j)
{
srand ( time(NULL) );
int p=rand()%(j-i+1);
return (i+p);
}
int partition(int *arr,int i,int j,int p)
{
int l=i;
int r=j;
while(l<r)
{
while(arr[l]<=arr[p]&&l<p)
l++;
while(arr[r]>=arr[p]&&r>p)
r--... | ALGO | 0.999982 | 3.557961 |
9f87bdab-72ec-48f4-8df5-e2af80dc5f32 | kibeom-kim/Problem-Solving | leetcode/Algorithm/#566-easy.cpp | /*
* 566. Reshape the Matrix
* https://leetcode.com/problems/reshape-the-matrix/
*/
class Solution {
public:
vector<vector<int>> matrixReshape(vector<vector<int>>& nums, int r, int c) {
int m = nums.size(), n = nums[0].size();
if (m * n != r * c) {
return nums;
}
v... | ALGO | 0.999756 | 6.509908 |
8f215ec7-5f2d-400a-aa82-198ceb54d946 | sarahcrowle/crystalspace | libs/csutil/win32/callstack-dbghelp.cpp | #include "cssysdef.h"
#include "csutil/csstring.h"
#include "csutil/csuctransform.h"
#include "csutil/dirtyaccessarray.h"
#include "csutil/measuretime.h"
#include "csutil/sysfunc.h"
#include "csutil/util.h"
#include "callstack-dbghelp.h"
#include "csutil/win32/callstack.h"
#include "csutil/win32/wintools.h"
#define WI... | TOOL | 0.916974 | 5.705326 |
3ea4b909-e7ed-4519-b7e7-a4ec77a6ed6e | Marko-Sanchez/Game9 | src/utility/ResourceManager.cpp | #include "utility/ResourceManager.h"
#include <stb/stb_image.h>
#include <iostream>
#include <fstream>
#include <filesystem>
#include <string_view>
#include <system_error>
/*
* Parses and compiles vertex and fragment shader files. If shader path already exist,
* create a new shader and attach the already created ... | TOOL | 0.865191 | 6.827286 |
873d7a44-081c-48c2-99e8-a0018370e551 | Gharbawy1/IEEE_CS_Ambassoder_2024 | Rookies_Tasks/Task1/C. Clock Conversion.cpp | #include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<set>
#include<vector>
#include<map>
#include<cmath>
using namespace std;
#define AHMED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define sp ' ';
#define ll long long
const long long oo = 1e18;
const int N1 = 1e3;
//problem link : http... | ALGO | 0.99729 | 4.948579 |
7f79cb37-e8c1-471f-a322-004663920ff5 | sherifammar/ecommeria | delivery/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.998486 | 6.785645 |
74307bb9-0260-4708-8c52-eb8c364cafa1 | anirudhgupta03/Leetcode-DSA-sheet-by-Fraz | Arrays/88. Merge Sorted Array.cpp | class Solution {
public:
void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) {
int ind1 = 0, ind2 = 0;
vector<int> res;
while(ind1 < m && ind2 < n){
if(nums1[ind1] < nums2[ind2]){
res.push_back(nums1[ind1]);
... | ALGO | 0.999957 | 5.337779 |
8a153daa-4515-4177-a4a2-71907ed9ac21 | JoshiYogi2006/CPP | loopsInCPP/numSum.cpp | #include<iostream>
using namespace std;
int main(){
//Sum of 1 to num(input given by user);
int num,sum=0,i=1;
cout<<"enter an nymber";
cin>>num;
// for(int i=1;i<=num;i++){
// sum +=i;
// }
while(i<=num){
sum+=i;
i++;
}
cout<<sum;
return 0;
}
// | ALGO | 0.999431 | 3.532802 |
06f8d1bf-0aff-45e3-9d2f-fe01906684fe | mingchengzack/Curve-Line-Drawing-System | bspline_c.cpp | #include "bspline_c.h"
#include <iostream>
using namespace std;
bspline_c::bspline_c(int k): k(k), n_points(0)
{
}
// using deBoor algorithm to compute the point given u
glm::vec2 bspline_c::deBoor(float u)
{
//initializes the deBoor matrix
glm::vec2** matrix = new glm::vec2*[n_points];
for (int i = 0; i < n_poin... | ALGO | 0.999791 | 4.87376 |
fe6eff1f-8dbe-448e-bb7b-4605ca7a8602 | AbhisekhNayek/Ninjas-SDE-Sheet | Count Ways To Reach The N-th Stairs.cpp | #include <bits/stdc++.h>
int m = 1e9 + 7;
int countDistinctWays(int nStairs) {
if(nStairs == 0){
return 1;
}
if(nStairs == 1){
return 1;
}
int prev1 = 1;
int prev2 = 1;
for(int i = 2; i <= nStairs; i++){
int curr = (prev1 + prev2) % m;
prev2 = prev1;
... | ALGO | 0.999961 | 5.069288 |
846adfab-c09c-4e5a-980d-b586533ba972 | leonardoAnjos16/Competitive-Programming | UVa/perfect_choir.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX = 1e4 + 5;
int main() {
int N;
while (scanf("%d", &N) != EOF) {
int A[MAX], sum = 0;
for (int i = 0; i < N; i++) {
scanf("%d", &A[i]);
sum += A[i];
}
if (sum % N) printf("-1\n");
else ... | ALGO | 0.999852 | 3.297446 |
7bc7fbe6-238d-48db-825e-a5567d89f3d0 | Matthew-t-robinson/Pool-Table-Real-Time-Simulation | RTSPool/Game.cpp | #include "Game.h"
#include <SFML\Graphics.hpp>
#include <iostream>
#include <math.h>
#include <vector>
#include "Circles.h"
#include "Walls.h"
void Game::run()
{
float radius = 20.f;
//this creates the window
sf::RenderWindow window(sf::VideoMode(1080, 720), "RTS");
window.setFramerateLimit(60);
sf... | ALGO | 0.957262 | 3.307043 |
38183afe-c889-4d61-9c58-2a357f29181b | ishandutta2007/codeforces | jtnydv25/normal/1553/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int, int>
#define all(c) ((c).begin()), ((c).end())
#define sz(x) ((int)(x).size())
#ifdef LOCAL
#include <print.h>
#else
#define trace(...)
#define endl '\n'
#endif
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL); // ... | ALGO | 0.99999 | 5.289932 |
abb417d0-23cc-4c9c-af71-52ead45d9f6e | kraldan/cplusminus-frontend | tests/valid_inputs/for_stmt.cpp |
int main() {
int res = 0;
for(int i = 1; i <= 4; i++)
res += i;
return res;
}
| ALGO | 0.998039 | 3.050187 |
0d86c741-13cb-4bb4-b1c9-ba5f1a5c4ba6 | k0src/COSC-2436 | Test 2/Stack/Problems/InfixToPostfix.cpp | #include <iostream>
#include <stack>
bool isOperator(char c) {
return (c == '+' || c == '-' || c == '*' || c == '/' || c== '$');
}
bool isOperand(char c) {
return ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
}
bool hasHigherPrecedence(char c1, char c2) {
int rank1, rank2;
... | ALGO | 0.99939 | 5.649517 |
3f60cb7f-aa2e-4af5-8af4-72e25e6d05b5 | sameedfareed297/Interactive-Shape-Generator | PF-PROJECT/PF-PROJECT.cpp | #include <iostream>
#include <string>
using namespace std;
// Function prototypes
void drawSquare(int size, char symbol);
void drawRectangle(int width, int height, char symbol);
void drawTriangle(int size, char symbol, bool upper, bool full);
void drawFullPyramid(int size, char symbol);
void drawDiamond(int size, cha... | TOOL | 0.877318 | 5.328699 |
d9828dd2-bbc9-42be-bb7b-30e5984bec52 | ishandutta2007/codeforces | gabrielwu/normal/1228/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define forn(i, n) for(int i=0; i<(n); i++)
#define printVec(v) for(auto e: v){cout << e << " ";} cout << endl;
#define pb push_back
#define MOD 1000000007
#define f first
#define s second
typedef long long ll;
typedef double ld;
typedef long double lld;
typedef pair<int,... | ALGO | 0.999915 | 4.326498 |
bab78bb4-4668-4b6a-8de8-836a8071ce79 | jed-richards/School | BVU/Junior/Fall2022/database_managment_systems/hw_1b/hw_1b.cpp | #include <iostream>
#include <vector>
#include <fstream>
#include <algorithm>
#include <cassert>
using namespace std;
// Make a student class
class Student {
public:
string fName;
string lName;
string year;
float gpa;
// Constructor
Student(string first, string last, string tempYear, float... | TOOL | 0.950491 | 4.938612 |
bc6aa426-d323-4ee2-b24a-21bbbdc150d4 | raghav2805/Codeforces | restore_modulo.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long int
#define pb push_back
#define btoi(s1) stoi(s1, nullptr, 2)
#define itob(x) bitset<32>(x).to_string()
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define vi vector<int>
#define vvi vector<vector<int>>
#define vpii vector<p... | ALGO | 0.999419 | 3.861251 |
0fd9ca0d-d5ba-4285-9ff0-1a7d3408bc77 | weisurya/nd013-MPC-Controller | src/Eigen-3.3/doc/examples/Tutorial_ArrayClass_interop.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
MatrixXf m(2,2);
MatrixXf n(2,2);
MatrixXf result(2,2);
m << 1,2,
3,4;
n << 5,6,
7,8;
result = (m.array() + 4).matrix() * m;
cout << "-- Combination 1: --" << endl << result << endl << e... | ALGO | 0.999445 | 4.531452 |
6d5f1011-d5f3-4bf2-8cd6-163a3177c8df | BryanYehuda/CompetitiveProgramming | Latihan/FPB_KPK.cpp | #include <iostream>
using namespace std;
int main()
{
int m,n,r,b,KPK,FPB,j,k;
cout << "Enter the First Number" << endl;
cin >> j;
m=j;
cout << "Enter the Second Number"<< endl;
cin >> k;
n = k;
if (n>m)
{
b=n;
n=m;
n=b;
}
while (n>0)
{
r = m%n;
m=n;
n=r;
}
FPB = m;
cout << "FPB nya ad... | ALGO | 0.999637 | 3.300639 |
96ef580c-ea1f-4c2d-801f-0f1dbeb60c02 | aaryan182/dsa-prac | S-7Recursion/L-2SubsequencePattern/3_subsets.cpp | // https://leetcode.com/problems/subsets/description/
class Solution {
public:
void backtrack(vector<int>& nums, vector<int>& currentSubset, int index, vector<vector<int>>& result){
result.push_back(currentSubset);
for(int i = index; i<nums.size(); i++){
currentSubset.push_back(nums[i]... | ALGO | 0.999841 | 6.748266 |
505f0150-f30b-4a17-8df9-f5d15412accf | HnpawsPham/CP-PROBLEMS | LeetCode/LONGEST-BINARY-SUBSEQUENCE-LESS-THAN-OR-EQUAL-TO-K.CPP | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define el "\n"
string s;
int k;
double ppow(int a, int b){
if(b == 0) return 1;
double half = ppow(a, b / 2);
if(b & 1) return (double)half * half * a;
return (double)half * half;
}
int main(){
ios::sync_with_stdio(0);
cin.... | ALGO | 0.99986 | 4.836535 |
cf4ad884-7162-4443-9e43-2a1b189075a2 | akadjoker/gmogre3d | OgreMain/src/OgreMatrix3.cpp | #include "OgreStableHeaders.h"
#include "OgreMatrix3.h"
#include "OgreMath.h"
// Adapted from Matrix math by Wild Magic http://www.geometrictools.com/
namespace Ogre
{
const Real Matrix3::EPSILON = 1e-06;
const Matrix3 Matrix3::ZERO(0,0,0,0,0,0,0,0,0);
const Matrix3 Matrix3::IDENTITY(1,0,0,0,1,0,0,0,1);
... | ALGO | 0.995576 | 7.649524 |
583f8f49-bd8d-4211-8b69-7d480c79456b | jeshwanthc/Path-Planning | src/Eigen-3.3/unsupported/doc/examples/MatrixSine.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
MatrixXd A = MatrixXd::Random(3,3);
std::cout << "A = \n" << A << "\n\n";
MatrixXd sinA = A.sin();
std::cout << "sin(A) = \n" << sinA << "\n\n";
MatrixXd cosA = A.cos();
std::cout << "cos(A) = \n" << cos... | ALGO | 0.949603 | 5.878768 |
f0418a98-ec81-4539-89f5-650d4f2426a0 | soundariyav/LeetcodePractice | 344. Reverse String.cpp | class Solution {
public:
void reverseString(vector<char>& s) {
int n =s.size();
int l =0;
int r=n-1;
while(l<r)
{
char t = s[l];
s[l] = s[r];
s[r] = t;
l++;
r--;
}
return;
}
};
| ALGO | 0.999358 | 6.05968 |
f9db2c14-c155-4b04-a066-5e9915abd7ef | gogoalswo/Unreal_Study | UnrealEngine-4.27/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/PBDAxialSpringConstraints.cpp | DECLARE_CYCLE_STAT(TEXT("Chaos PBD Axial Spring Constraint"), STAT_PBD_AxialSpring, STATGROUP_Chaos);
#if INTEL_ISPC && !UE_BUILD_SHIPPING
bool bChaos_AxialSpring_ISPC_Enabled = true;
FAutoConsoleVariableRef CVarChaosAxialSpringISPCEnabled(TEXT("p.Chaos.AxialSpring.ISPC"), bChaos_AxialSpring_ISPC_Enabled, TEXT("Whethe... | ALGO | 0.983106 | 7.58057 |
46a93062-05bc-4f49-b703-d28286200a46 | eopazov/knn-solutions-k2tree | getTimeKNNPQ.cpp | #include <iostream>
#include <chrono>
#include "libs/knnpq.hpp"
#include "libs/kTree.h"
#define N 100
using namespace std;
int main(int argc, char * argv[]){
if(argc < 5){
printf("%s <PATH> <X_1> <Y_1> <K>\n", argv[0]);
return -1;
}
MREP *rep = loadRepresentation(argv[1]);
int x = atoi(argv[2]);
int y = a... | ALGO | 0.991926 | 4.16781 |
589a97ce-e015-46dd-b429-1a67f6d49e84 | mitchellx1/cpsc2376-Person | projects/project01/project01.cpp | #include <iostream>
#include <vector>
#include <conio.h>
#include <cstdlib>
using namespace std;
enum CellState { EMPTY, WALL, PAINTED, PLAYER };
enum GameState { ONGOING, WIN, EXIT };
enum Direction { UP, DOWN, LEFT, RIGHT, NONE };
struct Position {
int row = 0;
int col = 0;
};
// Function Prototypes
void... | TOOL | 0.927563 | 3.762878 |
a3ece296-9de3-4f12-a410-a042db04695f | breardon2011/DLLExtraction | evaluation/poker.cpp | // poker_game.cpp
#include <windows.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string>
extern "C" __declspec(dllexport) void InitGame(int numPlayers);
extern "C" __declspec(dllexport) void DealHands();
extern "C" __declspec(dllexport) void PlayBettingRound();
extern "C" _... | ALGO | 0.991974 | 5.708789 |
c73ace06-2f65-4109-ae08-8e13b3b63e2d | MeMihir/Pente | main/helpers.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
// print 2d vector
void printBoard(vector<vector<int> > board)
{
for (size_t i = 0; i < board.size(); i++)
{
for (size_t j = 0; j < board[i].size(); j++)
{
cout << board[i][j] << " ";
}
cou... | ALGO | 0.971099 | 4.865856 |
e606d8b1-383f-41f5-95d5-a0084a4b72fc | expeditow/Maratona | CSES/Programação Dinâmica/Grid Paths/p.cpp | #include "bits/stdc++.h"
using namespace std;
#define forn(i, n) for (int i = 0; i < n; i++)
using ll = long long;
using f64 = double;
using ii = pair<int, int>;
using ull = unsigned long long;
using vi = vector<int>;
using vii = vector<ii>;
const string ENDL = "\n";
const int MOD = 1e9 + 7;
const int INF = 1e6;
... | ALGO | 0.999973 | 4.32604 |
9c060c5b-f319-4c0d-8ed6-1a5720708fb7 | gopisainath1718/computer_vision | Calibration & Augmented Reality/function.cpp | #include "Header.h"
void writeCSV(std::string file_name, cv::Mat camera_matrix, cv::Vec<float, 5> dist_coef) {
std::ofstream file;
file.open(file_name, std::ofstream::trunc);
file << "camera_matrix, ";
for (int i = 0; i < camera_matrix.rows; i++) {
for (int j = 0; j < camera_matrix.cols; j++) {
if (i == camer... | TOOL | 0.854944 | 3.927391 |
ad9437ad-fcd6-4bbb-bbff-f428138aa978 | StartAt24/leetcode | basic_algorithm/353_gluttonous_snake.cpp | #include <map>
#include <list>
#include <string>
#include <queue>
using namespace std;
class SnakeGame{
public:
SnakeGame(int width, int height, vector<vector<int>>& foodVec) {
m = height;
n = width;
// initialize the position of snake
set.insert(encode(0, 0));
body.push_ba... | ALGO | 0.999951 | 5.737301 |
4aad961f-b14e-48cf-b44d-8d454834258b | pranabrai07/DSA | height.cpp | #include <iostream>
using namespace std;
// Definition for a binary tree node.
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
// Function to find the height of the binary tree.
int findHeight(TreeNode* root) {
// If the tree is e... | ALGO | 0.999972 | 7.537903 |
401cb21e-04ac-4c85-ba4c-4b9c9cc9fe2b | VhahahaV/AlgorithmPactice | code/4_April/04-30/leetcode_54.cpp | //
// Created by VhahahaV on 2024/4/30.
//
#include <iostream>
#include <vector>
#include <utility>
using namespace std;
class Solution {
public:
vector<int> spiralOrder(vector<vector<int>>& matrix) {
int sum = matrix.size() * matrix[0].size();
int i = 0,j = 0;
int flag = 0;
vector... | ALGO | 0.999991 | 6.51106 |
07c61b29-0eaf-4555-adc0-5404bba11ddd | TheEnderPrime/CS491_CS_Skills | baughd_proj1.cpp | glm::vec3
WhatPartOfALivesInBDir( glm::vec3 a, glm::vec3 b )
{
return (a * glm::dot( glm::normalize(a), glm::normalize(b) ));
}
glm::vec3
WhatPartOfALivesPerpToB( glm::vec3 a, glm::vec3 b )
{
return a * glm::length( glm::cross( glm::normalize(a), glm::normalize(b) ) );
}
glm::vec3
UnitSurfaceNormal( glm::vec3 q, gl... | ALGO | 0.971994 | 6.233089 |
26336e66-63bb-427b-81f9-362e0464fc2a | afkyyd/engine | Engine/Source/ThirdParty/nvTextureTools/nvTextureTools-2.0.6/src/src/nvimage/Quantize.cpp | // This code is in the public domain -- <EMAIL>
/*
http://www.visgraf.impa.br/Courses/ip00/proj/Dithering1/floyd_steinberg_dithering.html
http://www.gamedev.net/reference/articles/article341.asp
@@ Look at LPS: http://www.cs.rit.edu/~pga/pics2000/i.html
This is a really nice guide to dithering algorithms:
http://ww... | ALGO | 0.995915 | 6.894057 |
3a8bdd5d-7929-4efb-a4b5-31f9aa0328d7 | nur483/computer-graphics | ext/tbb/examples/parallel_do/parallel_preorder/parallel_preorder.cpp | #include "tbb/parallel_do.h"
#include <vector>
#include <algorithm>
#include "Graph.h"
class Body {
public:
Body() {};
//------------------------------------------------------------------------
// Following signatures are required by parallel_do
//------------------------------------------------------... | ALGO | 0.999633 | 5.855957 |
9d2cd6f1-d325-4be4-946d-688b33e38922 | ishandutta2007/codeforces | pinkrabbit/normal/1177/B.cpp | #include <cstdio>
typedef long long LL;
inline LL check(LL x) {
LL Ans = 0, y = x, c = 1, k = 1;
while (y) {
if (y > 9) Ans += 9 * c * k;
else Ans += (x - c + 1) * k;
y /= 10;
c *= 10, ++k;
}
return Ans;
}
inline int digit(LL x, LL y) {
int dig[40], t = 0;
while (x) dig[++t] = x % 10, x /= 10;
return ... | ALGO | 0.999756 | 4.053942 |
558c5970-1416-4ec1-93e9-67b6092fbb59 | nithashifana/leetcode-submissions | 98.cpp | // Validate BST
// Medium
#include <bits/stdc++.h>
using namespace std;
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) ... | ALGO | 0.99999 | 6.859827 |
a51f32d2-a40a-44ff-a985-42a1fd6e7af1 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_valid_67_10.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t, a, b, c;
cin >> t;
while (t--) {
cin >> a >> b >> c;
int n = abs(a - b);
int check = 2 * n;
if (a > check || b > check || c > check)
cout << -1 << endl;
else if (c <= n)
cout << c + n << endl;
else
cout << ... | ALGO | 0.99997 | 4.229419 |
7e04e8eb-fc83-410f-8399-a8b7ea0afbd1 | 3000ye/ACMCode | LeetCode/143.重排链表.cpp | #include <bits/stdc++.h>
#include <vector>
using namespace std;
/*
* @lc app=leetcode.cn id=143 lang=cpp
*
* [143] 重排链表
*/
// @lc code=start
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : v... | ALGO | 0.999987 | 6.124938 |
2d0151d2-c571-45eb-b199-6fcd0bd37329 | Shah-Shishir/Codeforces-Solutions | 1133B. Preparation for International Women's Day.cpp | /***
Bismillahir Rahmanir Rahim
Read in the name of Allah, who created you!!!
Author : Shah Newaj Rabbi Shishir,
Department of CSE, City University, Bangladesh.
***/
#include <bits/stdc++.h>
using namespace std;
#define ebar_khela_jombe_besh int main (void)
#define ... | ALGO | 0.999955 | 3.301994 |
78be3189-0a8c-4798-82cd-8eb73b569e76 | sheeluofficial/practice | OthersCode/LeetCode-Solutions-master/LeetCode-Solutions-master/C++/minimum-number-of-swaps-to-make-the-string-balanced.cpp | // Time: O(n)
// Space: O(1)
class Solution {
public:
int minSwaps(string s) {
int result = 0, curr = 0;
for (const auto& c : s) {
if (c == ']') {
++curr;
result = max(result, curr);
} else {
--curr;
}
... | ALGO | 0.999842 | 6.221765 |
561dfd8f-c1af-414b-b367-e5e42e6b8119 | Gitakash29/Leetcode_DSA | Linked List Cycle.cpp | class Solution {
public:
bool hasCycle(ListNode* head) {
ListNode* slow = head;
ListNode* fast = head;
while (fast && fast->next) {
slow = slow->next;
fast = fast->next->next;
if (slow == fast)
return true;
}
return false;
}
};
| ALGO | 0.999564 | 5.944019 |
78ad90df-284b-4c66-8ecf-5cf6d4f79c2a | arjunmsh/spicecoin | src/pbkdf2.cpp |
#include <string.h>
#include "pbkdf2.h"
static inline uint32_t
be32dec(const void *pp)
{
const uint8_t *p = (uint8_t const *)pp;
return ((uint32_t)(p[3]) + ((uint32_t)(p[2]) << 8) +
((uint32_t)(p[1]) << 16) + ((uint32_t)(p[0]) << 24));
}
static inline void
be32enc(void *pp, uint32_t x)
{
uint8_... | ALGO | 0.997248 | 6.905365 |
7735f1c9-6050-4ff9-ac1a-044bcf26e712 | Mac16661/DSA | 1460-number-of-substrings-containing-all-three-characters/number-of-substrings-containing-all-three-characters.cpp | class Solution {
public:
int numberOfSubstrings(string s) {
int n = s.length();
int cnt = 0;
vector<int> freq(3, 0);
int left = 0;
for (int right = 0; right < n; ++right) {
freq[s[right] - 'a']++;
while (freq[0] > 0 && freq[1] > 0 && freq[2] > 0) {
... | ALGO | 0.999955 | 6.19233 |
6ea86edc-45fb-4f2a-925d-477ccd8a26ac | anurag-111/allSubmissions | hand-of-straights/Accepted/6-29-2023, 3_57_57 PM/Solution.cpp | // https://leetcode.com/problems/hand-of-straights
class Solution {
public:
bool isNStraightHand(vector<int>& hand, int groupSize) {
map<int , int> countHand;
for(auto card : hand) {
countHand[card]++;
}
sort(hand.begin(), hand.end());
for(int i = 0; i... | ALGO | 0.999991 | 6.236276 |
2422d65a-6824-4e04-8579-18a9bad81ce7 | 7oSkaaa/LeetCode_DailyChallenge_2023 | 01- January/06- Maximum Ice Cream Bars/06- Maximum Ice Cream Bars (Khaled Waleed).cpp | // Author : Khaled Waleed
// File Created on : 06/Jan/2023 on 18:14:12
// The idea is.. we have limited coins and just want to buy the largest number
// so we will buy the cheapest bars !
class Solution {
public:
int maxIceCream(vector<int>& costs, int coins) {
std::sort(costs.begin(), costs.en... | ALGO | 0.999536 | 6.166144 |
7781e997-7574-4e20-adfb-2f2daaa4b7d6 | ishandutta2007/codeforces | halyavin/normal/837/A.cpp | #include <algorithm>
#include <string>
#include <iostream>
#include <vector>
#include <utility>
void run(std::istream &in, std::ostream &out) {
std::string n;
getline(in, n);
std::string test;
getline(in, test);
int answer = 0;
int cur = 0;
for (size_t i = 0; i < test.length(); i++) {
if (test[i] >= 'A' && te... | ALGO | 0.997663 | 4.175381 |
54040ae7-e257-446b-9792-ac57f9a1842a | KmFahimHossain/LeetCode_TopInterview150_SolutionsByMe | Bit Manipulation/Bitwise_AND_of_Numbers_Range.cpp | #include <iostream>
#include <climits>
using namespace std;
// Problem statement - https://leetcode.com/problems/bitwise-and-of-numbers-range/description/
int rangeBitwiseAnd(int left, int right)
{
for (int i = 31; i > 0; i--)
{
if (((left >> i) & 1) != ((right >> i) & 1))
{
ret... | ALGO | 0.999912 | 5.856502 |
dba1c9cd-4078-450a-a93c-7081e7e21ae3 | gourabsingha1/LeetCode-and-GFG-Problems | 0115-distinct-subsequences/0115-distinct-subsequences.cpp | class Solution {
public:
int helper(int n, int m, string& s, string& t, vector<vector<int>>& dp) {
if(n < 0 || m < 0) {
return m < 0;
}
if(dp[n][m] != -1) {
return dp[n][m];
}
int take = 0;
if(s[n] == t[m]) {
take = helper(n - 1, m... | ALGO | 0.999997 | 6.575827 |
10af4564-eb19-4b5d-859e-136f99867e8e | Divyansh-ag14/DSA | linked list/clone_ll_with_next_and_random_pointer.cpp | #include<iostream>
using namespace std;
struct node{
int data;
node *next, *arb;
node(int val) { data=val; next=arb=NULL; }
};
// create n new nodes and point their arbitary according to original nodes arbitary
// then update their next pointers
node *clone(node *head){
if(head==NULL) return head;
... | ALGO | 0.999426 | 3.629379 |
0bf7a198-0236-4686-a5be-20465ecc7199 | anamay9694/Data-Placement-using-local-search | main_code.cpp | #include<bits/stdc++.h>
#include"ufl_n_cache_local_first_come.h"
using namespace std;
class cache_ele//client object
{
public:
int x,y;
int cid;
static int scid;
int oid;
friend bool operator< (const cache_ele &c1, const cache_ele &c2);
cache_ele (const cache_ele &obj)
{
this->x=obj.ge... | ALGO | 0.998781 | 3.427678 |
f4be2121-6c09-4845-8a6e-0b36d6476307 | kimchicaithao/kimchiB | Bai_7_Sap_xep_lai_day_con.cpp | #include<bits/stdc++.h>
using namespace std;
const int maxn = 1e5;
int n, a[maxn];
int main()
{
ios::sync_with_stdio(false);
cin.tie();
int t;
cin>>t;
while(t--)
{
cin>>n;
int i,j;
for(i = 0;i<n;i++)
cin>>a[i];
int s = 0, e = n-1, maxV, minV;
for(s = 0;s<n;s++)
{
if(a[s] > a[s+1])
break;... | ALGO | 0.999808 | 3.793121 |
c6d8bec4-fe9c-4644-a6ba-fa6566b2b81f | cececx/leetcode | 286_wallsAndGates.cpp | // Sourse : https://leetcode.com/problems/walls-and-gates/
// Difficulty : Medium
/***********************************************************************
*
* You are given a m x n 2D grid initialized with these three possible values.
*
* -1 - A wall or an obstacle.
* 0 - A gate.
* INF - Infinity means an empty... | ALGO | 0.999989 | 5.754384 |
9330524b-59e6-42c1-9875-2d33a7442272 | M-E-U-E/Leetcode | 1653. Minimum Deletions to Make String Balanced.cpp | #include<bits/stdc++.h>
#define ll long long
#define endl "\n"
using namespace std;
bool cmp(pair<int,int>a,pair<int,int> b)
{
if(a.first > b.first)
return true;
else if(a.first == b.first and a.second<b.second)
return true;
return false;
}
//vector<ll>v;
//void primeFactors(ll n)
//{
// ... | ALGO | 0.999942 | 5.224088 |
6fbf12e2-5f41-4307-b3d2-dbc425ea995e | OleksiiPliekhov/Concurrency | Indiv_1.cpp | #include <iostream>
#include <atomic>
#include <thread>
#include <vector>
#include <condition_variable>
using namespace std;
class Client {
public:
string fio;
atomic<double> balance;
Client(const string& name, double initialBalance) : fio(name), balance(initialBalance) {}
};
class Cashier {
public:
... | ALGO | 0.932128 | 6.073145 |
183cc52d-a1c3-4424-a51f-a5bdd2d83e66 | monircse061/My-All-Codes | CODEFORCE/codeforcebox.cpp | #include<bits/stdc++.h>
using namespace std;
#define val 10000
int a[val],i,j=0,n,p=0;
int main(){
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a[i]);}
sort(a,a+n);
for(i=n-1;i>=0;i--){
for(j=i-1;j>=0;j--){
if((a[i]>a[j])&&a[i]!=0&&a[j]!=0){
a[i]=a[j];
a[j]=0;
... | ALGO | 0.999797 | 3.345755 |
8dc6644e-a2ae-4497-a949-04f72a955974 | sergio5405/TTP-2018 | Week 4/3669-Superfactorial.cpp | #include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <stdio.h>
using namespace std;
typedef unsigned long long int lli;
int main (){
int N;
scanf("%d", &N);
lli sum = 0;
lli last = 0;
for (int i = 2; i <= N; ++i){
int t = i;
int now = last;
while(!(t&1)){
now++;
t... | ALGO | 0.999943 | 4.294783 |
ba60fcbc-5f39-447c-be72-4f394b3005b8 | aakriti1318/DSA | Arrays/16 Leaders in Array.cpp | // leaders in an array
// if it is the largest from its right side
#include<bits/stdc++.h>
using namespace std;
int main(){
int n; cin>>n;
vector<int> arr;
for(int i=0;i<n;i++){
int a; cin>>a;
arr.push_back(a);
}
int curr = arr[n-1];
cout<<arr[n-1]<<" ";
for(int i=n-2;i>=0;... | ALGO | 0.999987 | 3.679111 |
5ba4ca6a-88f2-4a1a-a6f2-7272a2bca490 | Akshat090803/DSA-leetcode-and-Gfg-ques | Difficulty: Medium/Preorder Traversal and BST/preorder-traversal-and-bst.cpp | //User func template for c++
class Node{
public:
int data;
Node*left,*right;
Node(int x) {
data=x;
left=right=nullptr;
}
};
class Solution {
public:
Node* makeBST(int arr[],int lower,int upper, int & ind,int N){
//base condition when index go out of bound
if(ind>=N) r... | ALGO | 0.999996 | 6.285621 |
7474941c-61dc-4ae1-98d1-0b6caf102472 | daniil-novel/edu_algo | alg7/alg7.cpp | #include <iostream>
#include <string>
#include <fstream>
#include <vector>
using namespace std;
template<typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
for(const T& t : v) {
os << t << endl;
}
return os << endl;
}
int main() {
int t_string;
string filename = "data.tx... | ALGO | 0.989969 | 3.809909 |
c8639d92-878b-4d12-b237-e1dbc5f54f52 | danyalmendigali/programming_scientific_codes | stack_scientific_codes/stack_copying_a_stack_to_another_stack.cpp | #include <bits/stdc++.h>
#include <windows.h>
using namespace std;
#define ar array
#define ll long long
#define FOR(i, a, b) for(int i = a; i < b; i++)
// Копирование стека в другой стек:
int main() {
cin.tie();
SetConsoleOutputCP(CP_UTF8);
SetConsoleCP(CP_UTF8);
stack <int> myStack;
stack <int... | ALGO | 0.985098 | 4.630574 |
2ecbd89b-cc5f-4240-b8e0-24907d645788 | akshin-kuvshin/smth | Олимпиады/2023-2024/Codeforces/CF 943/E/E.cpp | // author: Danila "akshin_" Axyonov
#include <iostream>
using namespace std;
typedef long long int lli;
#define plli pair<lli, lli>
#define mp(_first, _second) make_pair(_first, _second)
#define pb(_elem) push_back(_elem)
void solve();
int main() {
ios::sync_with_stdio(false);
cin.t... | ALGO | 0.999897 | 3.775647 |
9cf33c75-c082-4d91-b2ea-26725f975294 | mmxsrup/procon | yukicoder/400/469.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int,int> pint;
typedef vector<pint> vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#defi... | ALGO | 0.999093 | 3.766742 |
dee0c76e-50c3-4973-b26e-815e40158b41 | Nilesh219/Leetcode_DSA_100days | Same_tree_100.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.999967 | 6.440013 |
d0e84f9f-cb68-4a5f-b1e4-e300b46cfa4f | rflin/PAT-Basic-Level | 1069. 微博转发抽奖(20).cpp | #include <iostream>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
using namespace std;
int main()
{
int m,n,s;
vector<string> vl;
map<string,bool> isgot;
cin>>m>>n>>s;
for(int i=1;i<=m;++i)
{
string name;
cin>>name;
if(i==s)
{
... | ALGO | 0.999503 | 3.217192 |
e7490069-7b34-40ec-949c-a42f8d99379d | Mateosanzep/avanzada | recursividad.cpp | //funcion recursiva: funcion que se llama a si misma
//necesita detenerse
#include <iostream>
using namespace std;
int f(int); //Sumatoria
int f2(int); //Potencias
int f3(int); //Factorial
int f4(int); //Fibonacci
int main(){
cout<< f(10)<<endl;
cout<<f2(0)<<endl;
cout<<f3(5)<<endl;
cout<<f4(45)<<endl;
return... | ALGO | 0.998824 | 4.244555 |
eec15c69-82e9-4b56-87ae-57144a1543cf | glKarin/com.n0n3m4.diii4a | Q3E/src/main/jni/doom3/neo/quake4/ai/Monster_HarvesterDispersal.cpp | /*
================
rvMonsterHarvesterDispersal.cpp
AI for the Harvester on dispersal
================
*/
#include "../../idlib/precompiled.h"
#pragma hdrstop
#include "../Game_local.h"
class rvMonsterHarvesterDispersal : public idAI {
public:
CLASS_PROTOTYPE( rvMonsterHarvesterDispersal );
rvMonsterHarvesterDi... | ALGO | 0.85037 | 4.184064 |
f5ffc488-fa3d-4d4d-9260-52ae9607b729 | MsLeen/CplusProject | 寻找数组的中心索引/test.cpp | #define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include <vector>
using namespace std;
//δͨڸʱͨ
int pivotIndex(vector<int>& nums) {
if (nums.size() == 0)
return -1;
if (nums.size() == 1)
return 0;
int ret = 0;
int left = 0;
int right = nums.size() - 1;
int nleft = nums[left];
int nright = nums[right];
... | ALGO | 0.999973 | 5.188819 |
dda8774e-5a7c-4569-af51-7ebda4867896 | chrismars91/Linear-Kalman-Filter-Cpp-Vs-Python | cpp/eigen/doc/examples/Tutorial_ArrayClass_cwise_other.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
ArrayXf a = ArrayXf::Random(5);
a *= 2;
cout << "a =" << endl
<< a << endl;
cout << "a.abs() =" << endl
<< a.abs() << endl;
cout << "a.abs().sqrt() =" << endl
<< a.abs().sqrt() << endl... | ALGO | 0.972391 | 3.130341 |
4209b9ce-9f79-4910-bb2f-c98618ff469c | DikshantBadawadagi/DSA | connections.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAX_N = 505;
const ll INF = 1e18;
// Adjacency list representation: {to, capacity, edge_index}
vector<vector<tuple<int, ll, int>>> adj(MAX_N);
// Flow through each edge
vector<ll> flow;
// Visited array for BFS
vector<int> parent(MAX_N, -1)... | ALGO | 0.999943 | 5.487745 |
95c3f6c6-442e-4d47-9cff-016d15d030a5 | lanl/shoccs | src/stencils/E6u_1.cpp | #include "stencil.hpp"
#include <range/v3/algorithm/copy.hpp>
#include <range/v3/algorithm/fill.hpp>
#include <range/v3/algorithm/reverse.hpp>
#include <range/v3/view/concat.hpp>
#include <range/v3/view/repeat.hpp>
#include <range/v3/view/take.hpp>
#include <range/v3/view/transform.hpp>
#include <cmath>
/// E6u - un... | ALGO | 0.967789 | 4.6997 |
332024f2-61a1-4689-8f66-32ebcb98cdd9 | yuanwangshui/Capstone-project | 代码/opencv/opencv-3.4.18/samples/cpp/laplace.cpp | #include "opencv2/videoio.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <ctype.h>
#include <stdio.h>
#include <iostream>
using namespace cv;
using namespace std;
static void help(char** argv)
{
cout <<
"\nThis program demonstrates Laplace point/edge detection using OpenC... | ALGO | 0.934695 | 6.190269 |
2cd4eb66-1d68-43fa-b542-c584569f6478 | wengeezhang/node14_fork_for_comment | node-master/deps/icu-small/source/common/bmpset.cpp | #include "unicode/utypes.h"
#include "unicode/uniset.h"
#include "unicode/utf8.h"
#include "unicode/utf16.h"
#include "cmemory.h"
#include "bmpset.h"
#include "uassert.h"
U_NAMESPACE_BEGIN
BMPSet::BMPSet(const int32_t *parentList, int32_t parentListLength) :
list(parentList), listLength(parentListLength) {
... | TOOL | 0.926591 | 4.10513 |
c961a494-a86d-4d7f-a54a-9adb046b3762 | chocolatelove365/SfM | SfM/main.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <Eigen/Core>
#include <Eigen/Geometry>
#include <GLUT/glut.h>
#include <opencv2/opencv.hpp>
#include "json.hpp"
#include "draw.hpp"
#include "sfm.hpp"
int WinID[2];
using json = nlohmann::json;
using namespace std;
std::string filename0, filename1;
in... | TOOL | 0.906801 | 4.40886 |
70d155d9-37bc-4db5-867f-50f33f782794 | HarshitCodex/PDF_Soln | FINAL/Arrays/zerosumsubarray.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
vector<int> a(n);
vector<int> sum = {0};
map<int, int> mp;
mp[0] = 1;
bool... | ALGO | 0.999808 | 4.327466 |
7d0e3012-32c1-4e82-bcf9-7d678ee19a3d | Pussycat-Doll/My_leetcode. | 整数中1出现的个数.cpp | class Solution {
public:
int numOfone(int num)
{
int n = 0;
while(num)
{
if(num % 10 == 1)
++n;
num/=10;
}
return n;
}
int NumberOf1Between1AndN_Solution(int n)
{
int num = 0;
for(int i = 1; i <= n; ++i)
... | ALGO | 0.999907 | 6.085356 |
524f06dc-ab55-430c-be4d-b5ab5d6c8267 | pavel-ryzhov/global_vars | runs/004008.cpp | #include <iostream>
#include <vector>
#include <list>
#include <cmath>
using std::vector;
using std::list;
using std::pair;
using std::cin;
using std::cout;
using std::endl;
using std::swap;
using std::sqrt;
const int MAX_SIZE = 1000;
const int MAX_PAIRS = 0;
const int MAX_SQRT = 200;
const int MAX_LOG = 20;
const in... | ALGO | 0.999466 | 3.879659 |
0dee572c-9cef-4687-8985-45ce1777f428 | murali2006doha/raycasting | part1/raytracer.cpp | /***********************************************************
Starter code for Assignment 3
This code was originally written by Jack Wang for
CSC418, SPRING 2005
Implementations of functions in raytracer.h,
and the main function which specifies the
scene to be rendered.
**********************... | ALGO | 0.954935 | 5.906385 |
faa01542-2d33-4d18-a22e-47c15497d6da | Raghuram1108/leetcode-submissions | 153-find-minimum-in-rotated-sorted-array/find-minimum-in-rotated-sorted-array.cpp | class Solution {
public:
int findMin(vector<int>& nums) {
sort(nums.begin(),nums.end());
vector<int> res = nums;
return res[0];
}
}; | ALGO | 0.99995 | 5.884171 |
af90da15-e423-4794-a041-3a5f1a6eb62a | hiro-tacky/practice | algorithm/2-5/2-5-2.cpp | //ベルマンフォード法
#include <iostream>
#include <vector>
#include <utility>
#include <climits>
#include <random>
using namespace std;
int v=5, e=7;
vector<int> d;
vector<pair<pair<int, int>, int>> es(e);
random_device rnd;
mt19937 mt(rnd());
uniform_int_distribution<> rand100(1, 100);
uniform_int_distribution<> randv(0, v-... | ALGO | 0.999757 | 4.014444 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.