uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
c1d52adf-a5b9-4daa-b94a-43183b1813f8 | salimmia/Problem-Solving | Code_Template/Notes and files/ACM-Library Druboo vai/Graph/shortestPath/Dijkstra(V^2).cpp | #define maxN 1000
int n;
int dis[maxN],cost[maxN][maxN],par[maxN];
void Dijkstra (int start) { // v^2
vector<int>found(n+1);
dis[start] = 0;
while (start != -1) {
found[start] = true;
int best = -1;
for (int k = 1; k <= n; k++)
if (!found[k]) {
if (dis[k] ... | ALGO | 0.999906 | 3.532872 |
84d4fe13-f8e3-4fa3-b443-9d9a4be87ff6 | sylvanaalpert/Model-Predictive-Control | src/Eigen-3.3/doc/snippets/EigenSolver_EigenSolver_MatrixType.cpp | MatrixXd A = MatrixXd::Random(6,6);
cout << "Here is a random 6x6 matrix, A:" << endl << A << endl << endl;
EigenSolver<MatrixXd> es(A);
cout << "The eigenvalues of A are:" << endl << es.eigenvalues() << endl;
cout << "The matrix of eigenvectors, V, is:" << endl << es.eigenvectors() << endl << endl;
complex<double> l... | ALGO | 0.998707 | 3.088587 |
f0be47cd-2cd3-4998-b017-5d7e65ca5c82 | ishandutta2007/codeforces | interestinglsy/normal/158/B.cpp | #include <algorithm>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <vector>
#include <bitset>
#include <ctime>
#include <queue>
#include <stack>
#include <set>
#include <map>
#define F first
#define S second
#define qq queue
#define dq deque
#define vc vector
#define INF ((int)(1e... | ALGO | 0.999987 | 3.592366 |
26b50568-6996-4f3f-a49b-61276bf8ecd1 | ODCS1/PersonalTechStudies | flutter/projetos/projeto6/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.997773 | 6.76775 |
28fbcfd7-a59c-4a15-b5be-35507c98c6f3 | FantomZong/git-course | Laba3/3,1/3,1/DSU.cpp | #include "DSU.h"
void set_make(Vertex* v)
{
v->parent = v;
}
Vertex* set_find(Vertex* v)
{
if (v->parent == v)
return v;
set_find(v->parent);
}
void set_union(Vertex* v1, Vertex* v2)
{
set_find(v2)->parent = v1;
}
| ALGO | 0.979262 | 4.013482 |
c9140646-d599-431c-8a39-588728c20f4b | huxingyi/autoremesher | thirdparty/cgal/CGAL-5.1-beta1/examples/Triangulation/regular_triangulation.cpp | #include <CGAL/Epick_d.h>
#include <CGAL/point_generators_d.h>
#include <CGAL/Regular_triangulation.h>
#include <CGAL/assertions.h>
#include <iostream>
#include <iterator>
#include <vector>
const int D = 5; // Dimension
const int N = 100; // Number of points
typedef CGAL::Epick_d< CGAL::Dimension_tag<D> > ... | ALGO | 0.999529 | 6.786064 |
9e37a9c9-24a8-4a44-af5e-d25ebdd2c3b7 | openmeeg/openmeeg | OpenMEEG/src/assembleFerguson.cpp | #include <operators.h>
#include <progressbar.h>
#include <constants.h>
namespace OpenMEEG {
// geom = geometry
// mat = storage for Ferguson Matrix
// pts = where the magnetic field is to be computed
void assemble_ferguson(const Geometry& geom,Matrix& mat,const Matrix& pts) {
// Computatio... | ALGO | 0.986258 | 5.036629 |
99b8d0b2-5624-4c16-8f39-e8bd931e26c6 | aadityarajkumawat/trek | utils.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <string>
#include <dirent.h>
void print_vector_int(std::vector<int>& n) {
for (int i = 0;i < n.size();i++) {
std::cout << n[i] << " ";
}
}
void print_vector_string(std::vector<std::string>& n) {
for (int i = 0;i < n.size();i++... | TOOL | 0.995597 | 4.405573 |
e9dfc9c8-1042-4517-83b0-adc1a9f06a15 | Ming-J/LeetCode | HackerRank/Erupting_Volcanoes.cpp | #include <iostream>
#include <vector>
using namespace std;
class volcanoes{
private:
vector< vector<int> > vol;
public:
volcanoes(int n){
for(int i=0;i<n;i++){
vector<int> row(n,0);
vol.push_back(row);
}
}
void impact(int x, int y, int w){
vol[x][y]==w;
impacthelp(x,y,w,1);
}
vo... | ALGO | 0.999896 | 4.232365 |
6bacbf2c-2a3f-4ba2-b8c2-b4f0a09fe670 | Udrasht/6Companies30Days | Goldman Sachs/Query_Kth_Smallest_Trimmed_Number.cpp | // Question Link:- https://leetcode.com/problems/query-kth-smallest-trimmed-number/description/
/*
You are given a 0-indexed array of strings nums, where each string is of equal length and consists of only digits.
You are also given a 0-indexed 2D integer array queries where queries[i] = [ki, trimi]. For each queries... | ALGO | 0.999931 | 7.048277 |
690a15fd-b6bf-48fa-acf6-810aaad2463b | kingkk31/BOJ | source code/1002_터렛.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main(void)
{
int T;
cin >> T;
for (int i = 0; i < T; i++)
{
double x1, y1, x2, y2;
int r1, r2;
cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
if (r1 < r2)
{
int temp;
temp = r1;
r1 = r2;
... | ALGO | 0.999798 | 3.494556 |
320cf77d-e0c4-40b3-8d17-99610f906339 | andrewaarestad/ode-system-fitting-with-boost-and-nlopt | boost_1_77_0/libs/msm/doc/HTML/examples/iPodEuml.cpp | #include <vector>
#include <set>
#include <string>
#include <iostream>
// we need more than the default 20 states
#define FUSION_MAX_VECTOR_SIZE 20
// we need more than the default 20 transitions
#include "boost/mpl/vector/vector50.hpp"
#include <boost/msm/back/state_machine.hpp>
#include <boost/msm/front/euml/euml.hpp... | TOOL | 0.941216 | 5.742204 |
bbd4072a-7522-4234-89a8-e4dd9e6a2576 | rupali-12/Leetcode-Problems | Largest subarray with 0 sum - GFG/largest-subarray-with-0-sum.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
/*You are required to complete this function*/
class Solution{
public:
int maxLen(vector<int>&A, int n)
{
// Your code here
// <sumtillindex, index>
unordered_map<i... | ALGO | 0.99986 | 6.30599 |
64a9df88-dd4a-4c94-b8ce-34281b6dc034 | ollcesar/beecrowd | 1064.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int i, a = 0;
double numero, soma = 0;
for (i = 0; i < 6; i++)
{
cout << "";
cin >> numero;
if(numero>0){
a++;
soma += numero;
}
}
cout << a << " valores positivos\n";
... | ALGO | 0.998985 | 3.386241 |
d3e48224-812c-4ea9-a69b-f5922adf87db | Erik9631-Organization/WinFramework | libs/PhysX-4.1/physx/source/geomutils/src/gjk/GuGJKTest.cpp | #include "GuGJK.h"
#include "GuGJKRaycast.h"
#include "GuGJKPenetration.h"
#include "GuGJKTest.h"
namespace physx
{
namespace Gu
{
using namespace Ps::aos;
GjkStatus testGjk(GjkConvex& a, GjkConvex& b, const Vec3VArg initialSearchDir, const FloatVArg contactDist, Vec3V& closestA, Vec3V& closestB, Vec3V& normal, Flo... | ALGO | 0.970809 | 5.715431 |
a18e48cf-5980-4d55-a1c4-1c645ad88884 | woodbri/vehicle-routing-problems | tools/archive/vrpdptw-steve/Problem.cpp | #include <limits>
#include <stdexcept>
#include <algorithm>
#include <math.h>
#include "Problem.h"
// NON class functions for sorting
bool sortByDist(Order a, Order b)
{
return a.dist > b.dist;
}
// Class functions
unsigned int Problem::getNodeCount() {
return (unsigned int) N.size();
}
unsigned int Probl... | ALGO | 0.998112 | 5.4632 |
4b51e9b8-4be0-4e84-812b-734ea0a9cc0e | DylanD42/Dylan-Individual-Assignments | BST_Word_Counting/bst.cpp | #include "bst.h"
#include <iostream>
#include <fstream>
#include <cctype> // to lower
/**
* Constructor for the Node class
*
* @param value The value to initialize the node with
* @pre None
* @post The node is created with the given value, left and right children are set to null, and the count is set to 1.
*/
Node::N... | ALGO | 0.994368 | 5.38379 |
4401d225-39b2-48f5-bb79-8a2505d38a6c | AnkitDeshpande/DSA-Must-Do-Questions.- | 08_Bubble sort/Ideal Solutions/bubbleSort.cpp | #include <bits/stdc++.h>
using namespace std;
void bubbleSort(int arr[], int n)
{
// A function to implement bubble sort
for (int i = 0; i < n - 1; i++) {
for (int j = 0; j < n - i - 1; j++) {
if (arr[j] > arr[j + 1])
swap(arr[j], arr[j + 1]);
}
}
// Printin... | ALGO | 0.999868 | 5.422114 |
0b564a1b-5938-4234-b947-dab7a08616bd | AaronyfDesign/FP-Dataset | test_sin_simple.cpp | #include <iostream>
#include <cmath>
#include <iomanip>
int main() {
double x;
std::cin >> x;
std::cout << std::setprecision(17) << sin(x) << std::endl;
return 0;
}
| ALGO | 0.996338 | 5.457615 |
2d49dc01-7ac8-4044-b878-71d4d9f8cc19 | Ketan9548/C--practies | Subarrayfind.cpp | // #include <iostream>
// #include <vector>
// using namespace std;
// int main()
// {
// vector<int> v = {1, 2, 3, 4, 5};
// int n = v.size();
// int i = 0;
// for (int i = 0; i < n; i++)
// {
// for (int j = i; j < n; j++)
// {
// for (int k = i; k < j; k++)
// ... | ALGO | 0.999576 | 4.537412 |
c664c21a-6bcb-47ab-a32f-9fec451d69ef | sjsakib/lightoj-solutions | codes/Segment Tree, Interval Tree/LightOJ 1097 - Lucky Number.cpp | /**
* Author : sjsakib.bd
* Lang : C++
* Date : 2017-03-20 00:40:58
* Problem : 1097 - Lucky Number
* CPU : 0.424
* Memory : 24412
**/
#include <bits/stdc++.h>
using namespace std;
int LIMIT = 1429431;
int tree[1429431*4];
int ans[100000+10];
int s;
void update(int at,int val,int L,int... | ALGO | 0.999432 | 3.35278 |
90c66b51-f806-4636-9869-0bdd5d74ddf9 | KUAlgorithmStudy/Algo-Strudy-4th | 2주차/KCM/[W2]_16947.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
class SubwayLineTwo {
vector<vector<int>> subway;
vector<bool> isVisited;
vector<int> distance;
vector<int> circleLine;
int N;
bool dfs(int, int);
public:
SubwayLineTwo(int n = 3) {
this->N = n;
vector<int> v;
subway.assign(n + 1... | ALGO | 0.999994 | 4.606831 |
1754ada6-01ee-454b-91b5-f749df021b81 | raincross7/code-similarity | codes/train_code/problem396/problem396_182.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#define pi 3.14159265358979323846264338327950
int main() {
std::string s; std::cin >> s;
int x = s.length(), i;
std::vector<bool> q(26);
for (i = 0; i < x; i++) q[s[i] - 'a'] = true;
... | ALGO | 0.999931 | 4.8552 |
3643759e-2728-41c7-916b-44d51d80b80b | farleyrai/TADS-PRIMEIRO-PERIODO | farley-algoritimos-1-periodo/switch-case/switch case n 1 1.cpp | #include<iostream>
#include<locale.h>
using namespace std;
int main(){
setlocale(LC_ALL, "portuguese");
int mes;
cout<<" Digite o numero referente ao ms: "<<endl;
cin>>mes;
switch(mes){
case 2:
cout<<" 28 dias. "<<endl;
break;
case 4:
case 6:
case 9:
case 11:
cout<<" 30 dias. "<<endl;
break;... | ALGO | 0.966743 | 3.629585 |
ac581883-3ccb-4d56-97eb-7e29bcd87ad1 | 100meshh/Leetcode | 943-sum-of-subarray-minimums/sum-of-subarray-minimums.cpp | class Solution {
public:
int sumSubarrayMins(vector<int>& arr) {
int n = arr.size();
const int mod = 1e9 + 7;
//psee(previous smaller or equal element)
vector<int> psee(n);
stack<int> st;
for (int i = 0; i < n; i++) {
while (!st.empty() && arr[st.top()]... | ALGO | 0.999995 | 6.030571 |
1c5add69-831f-40c4-92e5-d92867f85301 | NkL708/NSTU-labs | multithreading/mpi/OpenCL_Lab/Source.cpp | #include <iostream>
#include <string>
#include <fstream>
#include <math.h>
#include <omp.h>
#include <CL/cl.hpp>
void copy(float* target, float* src, int size)
{
for (int i = 0; i < size; i++) {
target[i] = src[i];
}
}
void fillCuboid(float* cuboid, int k, int m, int n, int temp1, int temp2)
{
for (int z = 0; z... | ALGO | 0.999086 | 4.330323 |
36022aa1-8ca1-4598-aaf1-04023a267c3d | sarvex/leetcode-clisp | solution/0200-0299/0203.Remove Linked List Elements/Solution.cpp | class Solution {
public:
ListNode* removeElements(ListNode* head, int val) {
ListNode* dummy = new ListNode();
dummy->next = head;
ListNode* p = dummy;
while (p->next) {
if (p->next->val == val) {
p->next = p->next->next;
} else {
... | ALGO | 0.999957 | 6.128409 |
bf7efcf0-1011-4038-be88-2ec2a1e184ee | OzcanFatihCan/student_attendance_control-for-flutter | 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.998859 | 6.785645 |
ea016d60-d651-4721-9342-6e1bb5645d50 | trainsn/CSE_5194.02 | lab4/Streamline/Streamline/UniformGrid.cpp | #include "UniformGrid.h"
#include <math.h>
#include <iostream>
using namespace std;
UniformGrid::~UniformGrid()
{ }
int UniformGrid::getCell(int i,int* v)
{
int cell_row = i / (N1-1);
int cell_col = i % (N1-1);
v[0] = i + cell_row;
v[1] = v[0]+1;
v[2] = v[1]+N1;
v[3] = v[0]+N1;
return 4;
}
int Unif... | ALGO | 0.996138 | 4.804808 |
73fa3e1b-3fef-4918-b6b1-7f3e34c3beae | devgoel186/SIP-Prep-CPP | RandomProblems/largestBST.cpp | // #include <bits/stdc++.h>
// using namespace std;
// #define ll long long
// struct Node
// {
// int data;
// Node *left;
// Node *right;
// Node(int data)
// {
// this->data = data;
// left = NULL;
// right = NULL;
// }
// };
// int minSubtree(Node *root)
// {
// ... | ALGO | 0.999921 | 5.487212 |
47102ca2-33ed-480e-b16f-e00cd5bd5ae9 | adilhamid/Practice-Leetcode | allpermutation.cpp | #include"import.h"
using namespace std;
void permute(string str, int l, int r, int k) {
int i;
if (l == r || r-l == k) {
cout << str << " ";
}
else {
for (int i = l; i <= r; i++) {
swap(str[l], str[i]);
permute(str, l + 1, r,k);
swap(str[l], str[i]); //backtrack the initial step
}
}
}
int main() ... | ALGO | 0.999834 | 4.753953 |
948bf128-9321-4a20-b45b-366bf5bf0090 | batman-rises/Competitive-Programming | codechef/starters_181/Breaking Sticks.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
// your code goes here
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
int arr[n];
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
int cnt = 0;
for (int i = 0; i < n... | ALGO | 0.999775 | 4.999426 |
cd803243-6c86-4844-b107-8c74f09ecbd3 | masamenaza/git | extern/agg24-svn/src/agg_trans_warp_magnifier.cpp | #include <math.h>
#include "agg_trans_warp_magnifier.h"
namespace agg
{
//------------------------------------------------------------------------
void trans_warp_magnifier::transform(double* x, double* y) const
{
double dx = *x - m_xc;
double dy = *y - m_yc;
double r = sqrt(dx * d... | ALGO | 0.98901 | 6.221128 |
a86ba5be-3ed3-43aa-b9d3-6ef8ee2df0a0 | SamanKhamesian/ACM-ICPC-Problems | Codeforces/61A - Ultra-Fast Mathematician.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
string num1, num2;
cin >> num1;
cin >> num2;
for (int i = 0; i < num1.size(); i++)
{
int x, y;
x = (int)(num1[i] - '0');
y = (int)(num2[i] - '0');
cout << ((x + y) % 2);
}
} | ALGO | 0.999862 | 3.546732 |
b953f76a-63ec-4a32-bb0b-d09f079c25e9 | Altermoz/Projects | 5 Letters Password Cracker/5 Letters Password Cracker.cpp | #include <iostream>
#include <string>
#include <ctime>
using namespace std;
string generateNextGuess(const string& guess){
string nextGuess = guess;
int i = nextGuess.length() - 1;
while (i >= 0 && nextGuess[i] == 'z'){
nextGuess[i] = 'a';
i--;
}
if (i >= 0){
nextGuess[i]++... | ALGO | 0.960017 | 4.542018 |
31e6c5de-a8f6-4291-be5b-c5951144cbd2 | ishandutta2007/codeforces | wxhtzdy/normal/863/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
int n=(int)s.length(),j=-1;
for(int i=n-1;i>=0;i--)if(s[i]!='0'){j=i;break;}
for(int i=0;i<=j;i++){
if(s[i]!=s[j-i]){
cout<<"NO";
return 0;
}
}
cout<<"YES";
return 0;
} | ALGO | 0.999827 | 4.195259 |
011c6fc0-ed57-402e-8a16-37703b293d8a | vishugoyal/Online-Codes | DP/balance the paranthesis.cpp | /*
// http://www.spoj.com/problems/ANARC09A/
*/
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<map>
#include<vector>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<set>
#include<stack>
#include<deque>
#include<queue>
#include <limits.h>
#define pb(x) push_back(x)
#defi... | ALGO | 0.996489 | 3.428355 |
01f0d8d6-9250-40c1-b481-cc3c002fb869 | OpenXRay/xray-16 | src/xrParticles/particle_actions_collection.cpp | #include "stdafx.h"
#include "particle_actions_collection.h"
#include "particle_effect.h"
#include "xrCore/Threading/ParallelFor.hpp"
using namespace PAPI;
void PAPI::PAAvoid::Execute(ParticleEffect* effect, const float dt, float& tm_max)
{
float magdt = magnitude * dt;
switch (position.type)
{
cas... | ALGO | 0.998595 | 6.660783 |
07e77ae3-d709-4441-870f-6e56af905c40 | GodOrGovern/CSE_3150 | Week4_Lab/main.cpp | #include <iostream>
#include "linked_list.h"
int main(void) {
using namespace std;
int elements = 10;
cout << "Building list with " << elements << " elements" << endl;
Node* list = build_linked_list(elements);
int result = sum_values_in_linked_list(list, elements);
cout << "Sum of values in ... | ALGO | 0.972667 | 5.110697 |
607e7c00-ae34-463b-8fa6-1c0e170663b7 | harshanandsingh/Leetcode-solution | 1029-TwoCityScheduling/1029-TwoCityScheduling.cpp | // Last updated: 4/29/2025, 6:16:20 PM
class Solution {
public:
static bool cmp(vector<vector<int>>&a , vector<vector<int>>&b){
return a[1]>b[1];
}
int twoCitySchedCost(vector<vector<int>>& c) {
sort(c.begin(), c.end(), [](vector<int>& a, vector<int>& b){
return (a[0] - a[1]) < (... | ALGO | 0.99999 | 6.111176 |
d412b47c-ad55-4809-ada2-6f051b5bd519 | hemantgarg1452/LeetCode-Interview-Questions | 0605-can-place-flowers/0605-can-place-flowers.cpp | class Solution {
public:
bool canPlaceFlowers(vector<int>& flowerbed, int n) {
for(int i=0; i< flowerbed.size(); i++){
if((flowerbed[i]==0) && (i == 0 || flowerbed[i-1]==0)
&& (i == flowerbed.size()-1 || flowerbed[i+1] == 0)){
flowerbed[i] =1;
... | ALGO | 0.999993 | 6.774014 |
88802f66-4431-422c-8db8-935ab549de59 | sanketdisale871/DSA | 1252-break-a-palindrome/break-a-palindrome.cpp | class Solution {
public:
string breakPalindrome(string s) {
int n = s.length();
if(n<=1){
return "";
}
int ind = -1;
for(int i=0;i<n/2;i++){
if(s[i]!= 'a'){
ind = i;
break;
}
}
if(ind!=-1){... | ALGO | 0.999138 | 4.55002 |
099b4ce2-98fa-4b65-8734-2da5c67c16f4 | richeytastic/rimg | src/Equi2Rect.cpp | #include "Equi2Rect.h"
using rimg::Equi2Rect;
#include <cmath>
#ifndef M_PI
#define M_PI 3.14159265359
#endif
// public static
// From rectilinear coordinates (x,y), calculate the latitude and longitude on the spherical image.
void Equi2Rect::calc45LatLon( float x, float y, float centralLat, float centralLon, float& ... | ALGO | 0.997611 | 5.794395 |
548740de-0cdf-42b7-9f89-01858d7a7393 | CodeWCBrandon/DSACPP | DSA Notes/GraphsDFS.cpp | #include <stdio.h>
#include <stdlib.h>
//this struct to represent the node
struct AdjListNode
{
int dest;
AdjListNode* next;
};
//represent an adjency list
struct AdjList
{
AdjListNode* head;
};
//represent the graph duh
struct Graph
{
int v; //Vertices or Nodes, this counts how many nodes in this graph
AdjList... | ALGO | 0.999822 | 5.2649 |
ee32e8a6-36da-4a6d-a6cc-8cea3708f0b9 | Sookmyung-Algos/2022algos | algos_assignment/플래티넘_스터디/3주차 과제/길수민_2093ab/3080.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
ll MOD = 1e9 + 7;
class TRIE {
bool finish;
int kinds;
bool onlyOne;
int cnt;
vector<pair<char, TRIE*>> child;
public: TRIE ()
{
kinds = 0;
finish = false;
onlyOne... | ALGO | 0.99997 | 5.192342 |
626a3c15-c7b3-4e78-b4bf-5a2491b342b2 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_1929_8.cpp | #include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
struct point {
double x, y;
point(double x = 0, double y = 0) : x(x), y(y) {}
point operator+(const point &p) const { return point(x + p.x, y + p.y); }
point operator-(const point &p) const { return point(x - p.x, y - p.y); }
point oper... | ALGO | 0.999828 | 3.394402 |
ae764951-ee1e-4dae-b6ae-1b12e1376897 | KevinCJM/My_C_Tools | my_ctools/cal_max_dd.cpp | // cal_max_dd_threadpool.cpp
#include <pybind11/pybind11.h>
#include <pybind11/numpy.h>
#include <vector>
#include <limits>
#include <thread>
#include <algorithm>
#include <sstream>
#include <iomanip>
#include <ctime>
namespace py = pybind11;
const double NAN_D = std::numeric_limits<double>::quiet_NaN();
const int6... | ALGO | 0.98975 | 6.141355 |
c52e4ede-0808-4fd9-990b-a1b9c58d3910 | omteja04/CSES | Mathematics/GraphPaths-2.cpp | /**
* Author: omteja04
* Created on: 30-05-2025 22:08:47
* Problem: GraphPaths-2
* Link: https://cses.fi/problemset/task/1724
**/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = LLONG_MAX / 2;
#define fast_cin() \
ios_base::sync_with_stdio(false); \
c... | ALGO | 0.999872 | 4.203962 |
f86a0ab5-f0c2-48e2-a506-628892128186 | Agam3108/Data_Structures-n-Algorithms | 0028-find-the-index-of-the-first-occurrence-in-a-string/0028-find-the-index-of-the-first-occurrence-in-a-string.cpp | class Solution {
public:
int strStr(string haystack, string needle) {
int n = haystack.size();
int m = needle.size();
int j ;
for(int i = 0;i<=n-m;i++){
for(j = 0;j<m;j++){
if(needle[j]!=haystack[i+j])
break;
}
if(j=... | ALGO | 0.999942 | 5.670437 |
2fbaa12f-6c77-4917-85e0-eb1599898429 | yogeshmahale629/lp | huff2.cpp | // C++(STL) program for Huffman Coding with STL
#include <bits/stdc++.h>
using namespace std;
// A Huffman tree node
struct MinHeapNode {
// One of the input characters
char data;
// Frequency of the character
unsigned freq;
// Left and right child
MinHeapNode *left, *right;
MinHeapNode(char data... | ALGO | 0.999987 | 5.48348 |
8859795f-1533-450d-b7dc-7bbd88a0aecd | labib899/Operating-System | Process Scheduling/priority_non.cpp | #include<bits/stdc++.h>
using namespace std;
struct Process
{
int id,at,bt,priority,ct,wt,tat;
};
int n;
vector<Process> proc;
bool cmp(Process a, Process b)
{
return a.priority<b.priority;
}
void priority()
{
sort(proc.begin(),proc.end(),cmp);
int mn=INT_MAX,min_ind=-1;
for(int i=0;i<n;i++)
{
... | ALGO | 0.999956 | 3.726841 |
8317bd39-fe72-438b-ab36-bac0e60cd08a | aalissss/laba3 | laba3/laba3.cpp | #include <iostream>
using namespace std;
//узел односвязного списка
struct Node {
int data;
Node* next = nullptr;
};
//структура циклического списка
struct List {
Node* first = nullptr;
Node* last = nullptr;
Node* prev = nullptr;
Node* temp = nullptr;
int cnt = 0;
int position = 0;
... | ALGO | 0.99966 | 4.189886 |
1b580177-da73-4004-9985-490abc0c62d5 | poliglota26/Programacao-Competitiva | familiasdetroia.cpp | #include <bits/stdc++.h>
using namespace std;
int m[50005][10736];
bool * b;
bool g;
int N;
int tot;
void bep (int n)
{
if(!b[n])
{
g = true;
b[n] = true;
for(int i = 1; i<= N; i++)
{
if(m[n][i] == 1)
{
bep(i);
}
}
... | ALGO | 0.999686 | 4.448104 |
0f4812c7-8a2c-4aa0-bf47-07fde2debf87 | acc-cosc-1337-fall-2024/course-CesarMontano1 | src/homework/06_tic_tac_toe/main.cpp | #include <iostream>
#include <string>
#include <limits>
#include "tic_tac_toe.h"
#include "tic_tac_toe_manager.h"
#include "tic_tac_toe_4.h"
#include "tic_tac_toe_3.h"
int main()
{
TicTacToeManager manager; // Create an instance of TicTacToeManager
char choice;
do {
int game_type_choice;
... | ALGO | 0.969544 | 5.696713 |
5baed505-8575-4580-8f77-d9c2a67b6407 | ishandutta2007/codeforces | kevinyang/normal/1407/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
cin.tie(nullptr)->sync_with_stdio(false);
int t;
cin >> t;
while(t--){
int n;
cin >> n;
vector<int>arr(n);
for(int i = 0; i<n; i++){
cin >> arr[i];
}
int zeroes = 0; int ones = 0;
for(int i = 0; i<n; i++){
if(arr[... | ALGO | 0.999942 | 4.080215 |
7d6004fd-3c90-4e50-95cc-40b4adc520aa | coderheck/learning-programming-languages | why-am-i-learning-cpp-now/Advent-of-Code_2024/d1p2.cpp | #include"iostream"
const int N=1000;
using namespace std;
int a[1000],b[1000],cnt[100005];
long long res=0;
int main(){
freopen("d1.inp","r",stdin);
for(int i=0;i<N;i++){
cin>>a[i]>>b[i];
cnt[b[i]]++;
}
for(int i=0;i<N;i++){
res+=a[i]*cnt[a[i]];
}
cout<<res;
} | ALGO | 0.99995 | 3.379359 |
ec321d21-2efb-4b96-b4bf-1e5a491179cd | sriram84502/flutter | test/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.997179 | 6.761023 |
87cf7535-98bc-476e-9940-de81c9168ada | kunalkatara12/DSA-Questions | Linked List/(057)Merge Two Sorted List.cpp | /*
Link: https://leetcode-cn.com/problems/merge-two-sorted-lists/
Problem: Merge Two Sorted Lists
Level: Easy
Company Tags: Amazon, Microsoft, Bloomberg, Uber, Facebook, Adobe, Oracle, Shopee, Accenture
Statement: You are given the heads of two sorted linked lists list1 and list2.
Merge the two lists into one sorted ... | ALGO | 0.999929 | 5.673826 |
4b4a5b44-84d6-413c-9f14-5cc75faa8686 | VanshRana-1004/TLE_CP-31_Sheet | 900/04.cpp | // Problem Link : https://codeforces.com/contest/1875/problem/A
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--){
unsigned long long int a,b,n,x,sum=0;
cin>>a>>b>>n;
while(n-->0){
cin>>x;
if(x<a) sum+=x;
else sum... | ALGO | 0.99875 | 3.441999 |
510aee8d-28f3-49f5-9b1a-4313b21c6c3a | aarushi6601/LeetCode-Solutions | 0001-two-sum/0001-two-sum.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
unordered_map<int, int> seen;
for (int i = 0; i < nums.size(); ++i) {
int b = nums[i], a = target - nums[i];
if (seen.count(a))
return {seen[a], i}; // Found pair of (a, b), so that ... | ALGO | 0.999872 | 6.615208 |
632d97b8-1073-48ce-9abb-dadae78e4921 | VTroyanGolovyan/MiptAaDS | 2022/c++/Classes/VectorAndContiguosIterator.cpp | #include <iostream>
#include <vector>
#include <algorithm>
template <typename T>
class Vector {
public:
template<bool IsConst>
class Iterator {
public:
using iterator_category = std::contiguous_iterator_tag;
using iterator_concept=std::contiguous_iterator_tag;
using self_type=Itera... | ALGO | 0.999457 | 5.293198 |
70c630ef-d4fd-4168-a990-244d3845b90f | varun-thota27/Leetcoding | LeetCode/Medium/0130-surrounded-regions/0130-surrounded-regions.cpp | int drow[]={-1,0,1,0};
int dcol[]={0,1,0,-1};
class Solution {
public:
void dfs(int row,int col,vector<vector<int>>& vis,vector<vector<char>>& v)
{
int n=v.size(),m=v[0].size();
vis[row][col]=1;
for(int i=0;i<4;i++){
int nrow= row+ drow[i];
int ncol= col + dcol[... | ALGO | 0.999928 | 5.649998 |
d74c377b-95b1-4dcb-9888-88c327cae750 | ishandutta2007/codeforces | arbuzick/normal/1685/B.cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
int a, b, c, d;
cin >> a >> b >> c >> d;
string s;
cin >> s;
int n = s.size();
map<char, int> count;
for (auto ch : s) {
count[ch]++;
}
if (count['A'] != a + c + d) {
cout << "NO\n";
return;
}
... | ALGO | 0.999949 | 5.464725 |
e5cfffb9-7a82-40f5-bdf3-45d7cb765345 | Oince/TIL | ps/1406.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int m;
string str;
list<char> l;
getline(cin, str);
for(char c : str) {
l.push_back(c);
}
auto iter = l.end();
cin >> m;
while(m--) {
char command;
cin >... | ALGO | 0.999831 | 4.7393 |
a765d866-07bf-42b9-9484-9597acf97531 | CSdlwr/OJ | POJ/1469/12971899_TLE.cpp | #include<iostream>
#include<string.h>
using namespace std;
bool find(int a);
bool vs[305];
int result[305];
bool mp[305][305];
int p, n;
int cn, s;
int main() {
int ds;
scanf("%d", &ds);
while (ds-- > 0) {
scanf("%d %d", &p, &n);
memset(mp, 0, sizeof(mp));
for (int i = 1; i <= p; ++i) {
scanf("%d", &cn);
... | ALGO | 0.999947 | 3.487258 |
03d0a9ed-f36d-4407-862c-dbd9b9325891 | KhoiBui16/Fullhouse_Code_Online | DSA/Contest/01_DSA - LyThuyetSo/Bai_23/T_Prime2.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
bool IsPrime(ll n)
{
if (n < 2)
return false;
for (ll i = 2; i <= sqrt(n); i++)
if (n % i == 0)
return false;
return true;
}
int main()
{
ll n;
cin >> n;
int cnt = 0;
for (ll i = 2; i <= sqrt(n);... | ALGO | 0.999696 | 5.005589 |
adaf5a69-f236-4344-85ce-0ade390da2a9 | yamanojo/Atcoder_code | ABC/ABC157/D_2.cpp | #include <bits/stdc++.h>
using namespace std;
# define rep(i,n) for(int i=0;i<(n);i++)
typedef long long ll;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
ll N,M,K;
cin>>N>>M>>K;
vector<set<ll>> f_set(N);
vector<set<ll>> b_set(N);
rep(i,M){
ll a,b;
cin>>a>>b;
f_set[... | ALGO | 0.999848 | 3.509034 |
84e2ba62-24e5-4041-8e4e-e2428392ce22 | dipayansaha2002/Leetcode-solutions-Updated | 3043-find-the-length-of-the-longest-common-prefix/3043-find-the-length-of-the-longest-common-prefix.cpp | class Solution {
public:
int longestCommonPrefix(vector<int>& arr1, vector<int>& arr2) {
int maxi = 0;
unordered_map<int, bool> umap;
for(int i = 0; i < arr1.size(); i++){
while(arr1[i]){
umap[arr1[i]] = true;
arr1[i] /= 10;
}
}... | ALGO | 0.999607 | 6.027396 |
2c0fabce-7846-40e3-8f3c-e261f36d9233 | manish3749/spoj-solution | DIVFACT.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define MAX 10000
#define mod 1000000007
ll FACTORS();
ll PRIME(ll n);
ll arr[MAX];
ll c=-1;
int main()
{
FACTORS();
ll t;
cin>>t;
while(t--)
{
ll n;
cin>>n;
ll arr1[MAX];
ll i=0,j=0;
while(... | ALGO | 0.999969 | 4.342739 |
bafbff7c-12e5-4a0c-bf0c-79d546d13de7 | csienslab/icLibFuzzer | libcxx/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval.pass.cpp | // <random>
// template<class RealType = double>
// class fisher_f_distribution
// template<class _URNG> result_type operator()(_URNG& g);
#include <random>
#include <cassert>
#include <vector>
#include <algorithm>
#include <cmath>
#include "test_macros.h"
double fac(double x)
{
double r = 1;
for (; x > 1;... | TEST | 0.968827 | 4.550962 |
e10b9797-8a80-4def-851f-fca7df3c31fd | ArtiGaund/Leetcode | 0859-buddy-strings/0859-buddy-strings.cpp | class Solution {
public:
bool buddyStrings(string s, string goal) {
if(s.size()!=goal.size()) return false;
if(s==goal)
{
vector<int> freq(26,0);
for(auto ch:s)
{
freq[ch-'a']+=1;
if(freq[ch-'a']==2) return true;
... | ALGO | 0.999985 | 5.392176 |
603262fb-5d1d-44a9-906e-0fa72492b116 | n1ghtk1ng/DSA | Coding Blocks/lpfall 2016/Coding-Problems-master/Miscellanous/PathFindingUsingDP.cpp | #include<iostream>
#include<vector>
#include<map>
using namespace std;
class doubleInt{
public:
int x;
int y;
doubleInt(int x,int y){
this->x = x;
this->y = y;
}
};
//int calls=0;
map< pair<int,int>,bool> hashmap;
bool findPath(int path[10][10],int x,int y,vector<doubleInt> &v){
if(x==0&&y=... | ALGO | 0.999777 | 3.384579 |
117a71c5-bc1e-48b1-9cbc-66c1453beaaa | ishandutta2007/codeforces | liti/normal/361/C.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <fstream>
#include <cstring>
#include <iomanip>
#include <deque>
#define SZ(x) (( (int) x.size() ))
using namespace std;
const int maxN = 5000 + 10;
bool t[maxN];
int... | ALGO | 0.999988 | 3.224682 |
a71761d7-660e-4724-9c3f-69ef30b5d877 | POC-2025/leetcode | solution/1600-1699/1602.Find Nearest Right Node in Binary Tree/Solution.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.240639 |
8a7d8cca-e67d-47d4-856d-22deb442aab4 | nemurinda/procon-archive | atcoder.jp/arc098/arc098_a/Main.cpp | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#incl... | ALGO | 0.999954 | 3.770032 |
c24d043f-4462-41c1-bf06-f090f3368382 | Greary2025/ros_badget | ceres_test/performance_demo.cpp | #include <iostream>
#include <vector>
#include <random>
#include <chrono>
#include <iomanip>
// 矩阵乘法函数
void matrix_multiply(const std::vector<std::vector<double>>& a,
const std::vector<std::vector<double>>& b,
std::vector<std::vector<double>>& result) {
int n = a.size();
... | ALGO | 0.976589 | 6.056622 |
9ff7ecf5-445c-4898-81af-2f566663553a | Zendelo/IRQPP | indri_code/LogQlC.cpp | //
// runquery
//
// 24 February 2004 -- tds
//
// 18 August 2004 -- dam
// incorporated multiple query, query expansion, and TREC output support
//
//
// Indri local machine query application
//
/*! \page IndriRunQuery Indri Query Retrieval
<H3>QueryEnvironment Parameters</H3>
<H4>Retrieval Parameters</H4>
<dl>
<dt>in... | TOOL | 0.873635 | 4.031896 |
c82dabd6-f9b2-435d-9c45-1cba98277162 | Aniketkaygude/DSA-CPP- | RECURSION/HARD questions/Minimize operation to reduce A & B to 1.cpp | #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
int solve(int a , int b,vector<vector<int>>dp){
if(a==1 && b==1){
return 0;
}
if(a==b || a%b == 0 && b%a ==0){
return 1;
}
if(dp[a][b]!=-1){
return dp[a][b];
}
int ans1 = solve(a-1,b,dp);
int ans2 =solve(a... | ALGO | 0.999953 | 4.886503 |
091ecd06-0915-4cbb-9c3a-631dc11769a5 | Yateesh96/Coding-with-CPP | Pointers/split_.cpp | #include<iostream>
using namespace std;
void split(int* a,int n,int* pri,int* com)
{
int np,nc,t,f;
np=nc=0;
for(int i=0;i<n;i++)
{
t=1,f=0;
while(t<=*(a+i))
{
if(*(a+i)%t==0)
f++;
t++;
}
if(f==1||f==2)
{
*(pri+np)=*(a+i);
np++;
}
else
{
*(com+nc)=*(a+i);
nc++;
}
}
cout<<"... | ALGO | 0.999828 | 3.635918 |
8905ebd3-1ca1-40d2-aade-1b68c38aa692 | sarvex/leetcode-raku | solution/1900-1999/1975.Maximum Matrix Sum/Solution.cpp | class Solution {
public:
long long maxMatrixSum(vector<vector<int>>& matrix) {
long long s = 0;
int cnt = 0, mi = INT_MAX;
for (auto& row : matrix) {
for (int& v : row) {
s += abs(v);
mi = min(mi, abs(v));
cnt += v < 0;
... | ALGO | 0.999993 | 6.109669 |
cd9bec90-a202-4400-8a49-3f0ae9877d1c | LeoVargass/Programacion-Competitiva | OIA/OIAJ/teclado predictivo - n1/predictivo.cpp | #include<bits/stdc++.h>
using namespace std;
vector<string> separar(string &s){
vector<string>rta;
string aux = "";
for(int i=0; i<(int)s.size(); i++){
if(s[i] == ' '){
rta.push_back(aux);
aux = "";
} else {
aux += s[i];
}
}
rta.push_back(... | ALGO | 0.999825 | 3.679367 |
627601af-7128-4375-b935-18432ff95b47 | hajeongyeon/ComputerGraphics | Warming Up/2.List.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
struct StoreList {
char x = 0, y = 0, z = 0;
float dst = 0;
};
int func_compare(const void*, const void*);
int main(void)
{
StoreList list[10] = { 0, };
char input[20];
printf("+ x y z : Ʈ Է\n");
printf("- : Ʈ \n");
printf("e x ... | TOOL | 0.966786 | 3.492097 |
f5d9c561-36d3-4db7-9b29-26fdc7b0d846 | navaneet-rao/TAP-CELL | src/C++/MirrorTree.cpp | #include "Commoncpp.h"
using namespace std;
class Node {
public:
int data;
Node *left;
Node *right;
// NOTE: explicit:
// The compiler is allowed to make one implicit conversion to resolve the
// parameters to a function. This means that the compiler can use constructors
// callable with a single param... | ALGO | 0.992428 | 6.478932 |
a3891593-df58-493a-ad75-c927e20a5ad5 | rijwanofficials/2D_Array | diagonals_matrix.cpp | #include <iostream>
using namespace std;
int main()
{
int n, m;
int rsum = 0;
int lsum = 0;
int i, j;
cout << "Enter the size of the square matrix: ";
cin >> n;
m = n;
int mat[n][m];
cout << "Enter the elements of the matrix: " << endl;
for (i = 0; i < n; i++)
{
f... | ALGO | 0.999989 | 4.043177 |
d1c101fe-742e-448c-9b25-5558557d360e | shammo18/Sports-Programming | uva108.cpp | //Bismillahir Rahmanir Rahim
//#pragma GCC optimize("Ofast,unroll-loops")
//#pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#d... | ALGO | 0.99997 | 3.298873 |
89094e3a-7f02-4145-9814-ea48d94901e5 | bira37/problem-solving | Codeforces/Gym/2012-2013 ACM-ICPC Pacific Northwest Regional Contest/B.cpp | #include <bits/stdc++.h>
#define int long long
#define double long double
#define ff first
#define ss second
#define endl '\n'
#define ii pair<int, int>
#define DESYNC ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define pb push_back
#define vi vector<int>
#define vii vector< ii >
#define EPS 1e-9
#defin... | ALGO | 0.999853 | 4.487273 |
e0b8ed5c-f853-40b9-ad43-b42923d0a9fb | mohumedsalah/Problem-Solve | sagheeer/Greedy/11157 - Dynamic Frog.cpp | #include <iostream>
using namespace std;
int N;
bool isSmall[105];
bool hit[105];
// positions[N] = D
int positions[105];
// Will always need to skip over the small rocks at least once
int GetWorstDistance()
{
int minDist = positions[0];
for (int i = 0; i < N; ++i)
{
hit[i] = true;
// Ski... | ALGO | 0.998892 | 3.514199 |
1fd5b19e-cf03-4c4b-846a-dd13640c1363 | sarvex/leetcode-d | solution/0600-0699/0676.Implement Magic Dictionary/Solution.cpp | class MagicDictionary {
public:
/** Initialize your data structure here. */
MagicDictionary() {
}
void buildDict(vector<string> dictionary) {
for (string word : dictionary) {
s.insert(word);
for (string p : gen(word)) ++cnt[p];
}
}
bool search(string sea... | ALGO | 0.999665 | 6.15628 |
9dfbd103-59b9-47b3-b39f-ec6a3b7aa92b | darnoceloc/Algorithms | Competitive Programming/subsets_with_duplicates.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> subsetsWithDup(vector<int>& nums) {
vector<vector<int>> res;
vector<int> v;
res.push_back(v);
for(int i = 0; i < nums.size(); i++){
v.push_back(nums[i]);
vector<vector<int>> temp = res;
for(int... | ALGO | 0.999959 | 5.270694 |
a45c58de-ef1f-4d70-b32f-3f9dd4f63a97 | andrewmegaris/sdc_pp | src/Eigen-3.3/doc/examples/TutorialLinAlgExComputeSolveError.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
MatrixXd A = MatrixXd::Random(100,100);
MatrixXd b = MatrixXd::Random(100,50);
MatrixXd x = A.fullPivLu().solve(b);
double relative_error = (A*x - b).norm() / b.norm(); // norm() is L2 norm
cout << "The ... | ALGO | 0.99955 | 3.625966 |
f07350d8-3484-45de-ab81-e76473d0dba6 | zjh-cpu/adds-pra | QuickSort.cpp | #include "QuickSort.h"
std::vector<int> QuickSort::sort(std::vector<int> list) {
quickSort(list, 0, list.size()-1);
return list;
}
void QuickSort::quickSort(std::vector<int>& list, int low, int high) {
if (low < high) {
int pi = partition(list, low, high);
quickSort(list, low, pi - 1);
... | ALGO | 0.999883 | 5.27785 |
fbe0aae3-5268-44f7-9c93-55231aa1d261 | s0urav6529/Codeforces-Solutions | 1675D.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;
template<typename T>
using ordered_set=tree<T, null_type,less<T>, rb_tree_tag,tree_order_statistics_node_update>;
using ll=long long;
using ld=long double;
#define fas... | ALGO | 0.999747 | 4.45843 |
92fe64fb-434d-4e6d-9dde-2a27163f6cca | shivendrra/axgrad | axgrad/csrc/cpu/ops_redux.cpp | #include <math.h>
#include <stdint.h>
#include <stddef.h>
#include <stdio.h>
#include "ops_redux.h"
void max_tensor_ops(float* a, float* out, size_t size, int* shape, int* strides, int* res_shape, int axis, int ndim) {
if (axis == -1) {
// global min - find minimum of all elements
float min_val = a[0]; // i... | ALGO | 0.995266 | 6.881952 |
1780195e-14d8-4805-ad03-95579b0020f3 | Quadroue4/Algorithm | 1202.cpp | //1202.cpp
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
bool compare(pair<int,int> a,pair<int,int> b){
if(a.first < b.first)
return true;
else if(a.first == b.first && a.second > b.second)
return true;
return false;
}
struct cmp{
bo... | ALGO | 0.999982 | 3.764151 |
0f78b999-1bdd-4784-8ee3-bf3e6cd0fd61 | ishandutta2007/codeforces | allvik06/normal/1566/E.cpp | #include <bits/stdc++.h>
using namespace std;
vector <vector <int>> g;
vector <int> p, gl;
vector <bool> now;
void dfs(int v) {
for (int i : g[v]) {
if (i == p[v]) continue;
p[i] = v;
gl[i] = gl[v] + 1;
dfs(i);
}
}
int ans = 0;
void dfs1(int v) {
int cnt = 0;
for (int ... | ALGO | 0.999828 | 5.554688 |
e830bbb9-4d21-418c-9238-767f75005749 | DenMoz/spisci_ocheredi_stack | стек №2/functions.cpp | #include<stdio.h>
#include<stdlib.h>
#include"Header.h"
int menu()
{
printf("1- \n2- \n"
"3- 1 \n4- 2 \n5- \n6- \n");
int operation;
scanf_s("%d", &operation);
printf("\n");
return operation;
}
int getStackSize()
{
static int i = 1;
printf("e %d \n", i);
i++;
int size;
scanf_s("%d", &size);
... | ALGO | 0.886469 | 3.376968 |
baec87f4-f675-4def-8b19-d01d9ef2052a | DSC-SPIDAL/harpgbdt | sub/LightGBM-7282533/compute/perf/perf_set_union.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/set_union.hpp>
#include <boost/compute/container/vector.hpp>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);
}
int... | ALGO | 0.987844 | 5.67805 |
db733bba-2cc5-4791-a4b3-9968c55a940b | seal0712/2023aaia2 | week17/week17-2.cpp | #include <Stdio.h>
void myPrint(int a[10])
{
for (int i=0; i<10; i++)
{
printf("%d",a[i]);
}
printf("\n");
}
int main()
{
int a[10]= {9,8,7,6,5,4,3,2,1,0};
myPrint(a);
for(int i=0;i<10;i++){
for(int j=i+1;j<10;j++){
if(a[i]>a[j]){
int temp=a[i];
... | ALGO | 0.999814 | 3.452119 |
53eec4d4-726d-4e9c-a974-80a37928e0b4 | yingjunzou/C-Programming-from-Problem-Analysis-to-Program-Design | Chapter 2/Exercise2_16.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main() {
//named constants
const double CARTON = 3.78;
//declare variable
double amount, cost, profit;
cost = 0.38;
profit = 0.27;
//user input
cout << "Please enter total amount of milk produced today in liters: ";
ci... | TOOL | 0.972923 | 4.799922 |
4ac1a41e-cea2-44ac-a325-5d82d72f62d5 | deepak-ganwani/CSES-Problem-Set | 2. Searching & Sorting/Distinct.cpp | //Link: https://cses.fi/problemset/task/1621
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define rep(i,x,y) for(int i=x; i<y; i++)
#define vi vector<int>
#define all(v) v.begin(), v.end()
#define pb emplace_back
void solve(int tc){
int n,c=0;
cin>>n;
map<int, int>... | ALGO | 0.998995 | 4.369626 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.