uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
1af077bd-400a-4e36-ba4b-7fc0751bae37 | Canvas-world/Core | src/wallet/scriptpubkeyman.cpp | #include <hash.h>
#include <key_io.h>
#include <logging.h>
#include <outputtype.h>
#include <script/descriptor.h>
#include <script/sign.h>
#include <util/bip32.h>
#include <util/strencodings.h>
#include <util/string.h>
#include <util/time.h>
#include <util/translation.h>
#include <wallet/scriptpubkeyman.h>
#include <o... | ALGO | 0.989537 | 4.185894 |
4edd476e-cb9a-4c45-b70e-a65ba7380017 | 23f2002007/leetcode | solution/2300-2399/2301.Match Substring After Replacement/Solution2.cpp | class Solution {
public:
bool matchReplacement(string s, string sub, vector<vector<char>>& mappings) {
bool d[128][128]{};
for (auto& e : mappings) {
d[e[0]][e[1]] = true;
}
int m = s.size(), n = sub.size();
for (int i = 0; i < m - n + 1; ++i) {
bool o... | ALGO | 0.999634 | 6.344943 |
9b5405c5-e323-4d94-9f66-eae5c22849f6 | itsAMd22/Competitive_Programming | Phase 1/Part 1/Class 3/Practice/4.CSES_Range_Xor_Queries.cpp | #include<bits/stdc++.h>
using namespace std;
#define Alhamdulillah ios_base::sync_with_stdio(0), cin.tie(0);
#define ll long long
#define ull unsigned long long
#define endl '\n'
#define db(i) cout << "c -> " << i << endl;
#define pv(v) for(auto e : v) cout << e << " "; cout << endl;
#define pm(m) for(auto [x,y] :... | ALGO | 0.999963 | 4.816713 |
44fae49f-62b7-480f-bbc9-46f3153e238b | 124327288/YuYu | libs/bullet/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.cpp | #include "btSoftBodyConcaveCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletCollision/CollisionShapes/btMultiSphereShape.h"
#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
#include "BulletCollision/CollisionShapes/btConcaveShape.h"
#include "Bulle... | ALGO | 0.99877 | 7.065645 |
e1193a67-0cea-421c-9d86-84d310fb8a0a | Salvely/OI | Luogu/ch8_simul_precision/3.cpp | #include <iostream>
using namespace std;
typedef struct person {
int direction;
string name;
}person_t;
int main(void)
{
int n,m;
cin >> n >> m;
person_t arr[n];
for(int i = 0; i < n; i++) {
cin >> arr[i].direction >> arr[i].name;
}
int current = 0;
for(int i = 0; i < m; i++) {
int dir;
int num;
cin >>... | ALGO | 0.999945 | 4.193902 |
ff615f83-2baf-4933-b0d1-967ac816c8f5 | arnabm14/Algorithms-Codec | dijkstra.cpp | #include<bits/stdc++.h>
using namespace std;
#define SIZE 100000 + 1
vector < pair<long long, int> > v[SIZE]; //to store the adjacency list of the directed graph.
int parent[SIZE]; //to store the parent of the current node in its shortest path so that we can track the path later.
long long dist[SIZE]; //... | ALGO | 0.999992 | 3.9076 |
b4c905e3-0f9f-49ff-a6a2-dafb620e9ee8 | rahul5F1/hackerrank-si-basic-solutions | Check bit.cpp | /*
In a given integer N, check whether the ith bit is set or not.
Input Format:
First and only line of input contains N and i.
Constraints:
0 <= N <= 109
0 <= i <= 30
Output Format:
Print "true" if ith bit is set in the given integer N, "false" otherwise.
Sample Input:
10 1
Sample Output:
true
*/
//Program
#inclu... | ALGO | 0.999344 | 4.737622 |
0e727678-5276-4061-b1ea-3d196a01a0d7 | ricardo-emanuel01/problems-resolutions | problems/product-array-except-self-238/solution.cpp | # include <bits/stdc++.h>
using namespace std;
vector<int> productExceptSelf(vector<int>& nums) {
int size = nums.size();
vector<int> preffix(size);
vector<int> postfix(size);
vector<int> res(size);
for (int i = 0; i < size; i++) {
if (i == 0) preffix[i] = nums[i];
else preffix[i]... | ALGO | 0.999945 | 4.419269 |
eae3eec6-f64a-4256-a86f-c3d995ed5cc5 | Root007x/DSA-and-problem | data_structure/queue/queue_linked_list.cpp | #include<bits/stdc++.h>
using namespace std;
bool isEmpty();
bool isFull();
void enQueue(int data);
int deQueue();
void display();
struct Node{
int data;
Node *next;
};
Node *front = NULL;
Node *rear = NULL;
int main(){
enQueue(10);
enQueue(20);
enQueue(30);
cout << deQueue() << endl;
display();
return 0;... | ALGO | 0.998066 | 4.041394 |
b8b5aa9a-d11b-44c4-af2e-a1faae8ce031 | 11223uhh/Stm32_Deploy_AI | Example/opencv/图像腐蚀/实验13 TFT LCD显示实验/opencv/cvaux/src/cvepilines.cpp | #include "_cvaux.h"
#include "cvtypes.h"
#include <float.h>
#include <limits.h>
#include "cv.h"
/* Valery Mosyagin */
#undef quad
#define EPS64D 1e-9
int cvComputeEssentialMatrix( CvMatr32f rotMatr,
CvMatr32f transVect,
CvMatr32f essMatr);
in... | ALGO | 0.999591 | 5.378318 |
58af6434-6bb8-4a94-a0ae-55c227a11220 | alaimiranda/FAL | Retos/1/1_contandoDesdeElCero.cpp | #include <iostream>
using namespace std;
void resolver (){
int numero;
cin >> numero;
if (numero < 0) cout << numero << "\n";
else cout << numero - 1 << "\n";
}
int main (){
int n;
cin >> n;
for (int i = n; i > 0; i--)
resolver();
return 0;
} | ALGO | 0.999854 | 3.72016 |
0381f3c0-56f3-477e-ac75-218f6df16e0d | glenstarchman/maiden | osrm-backend/benchmarks/static_rtree.cpp | #include "../data_structures/query_node.hpp"
#include "../data_structures/static_rtree.hpp"
#include "../data_structures/edge_based_node.hpp"
#include "../algorithms/geospatial_query.hpp"
#include "../util/timing_util.hpp"
#include <osrm/coordinate.hpp>
#include <random>
#include <iostream>
// Choosen by a fair W20 ... | TEST | 0.918191 | 7.270576 |
d7264bea-d368-4994-937b-06ae7c74fcce | Abhinav200207/CrackYourPlacement | DynamincPrograming/KnightDialer.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
long long int mod=1e9+7;
public:
int knightDialer(int n)
{
vector<vector<int>> dp(n + 1, vector<int>(10, 0));
dp[1] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
for (int i = 2; i <= n; i++)
{
dp[i][0] = (dp[i - ... | ALGO | 0.999952 | 5.454149 |
299a8d32-bdb2-43ef-b8e4-ce93ce163f9a | MohdAliJasim/C---DSA-Practice-Questions | 741-Cherry-Pickup.cpp | class Solution {
public:
int solve(vector<vector<int>>& grid, int i1, int i2 , int j1, int j2, int n,vector<vector<vector<vector<int>>>>&dp){
if(i1 == n-1 && i2== n-1 && j1 == n-1 && j2 == n-1){
int ans = grid[n-1][n-1];
return ans;
}
if(i1 >= n || i2 >= n || j1 >= ... | ALGO | 0.999989 | 5.734055 |
b24a6836-1274-4166-945f-f547d68d07ba | Ddelval/Competitive-programming | CodeForces/1555-E.cpp | // 1555-E.cpp
// Created by David del Val on 31/07/2021
//
//
// https://github.com/Ddelval/Competitive-programming/blob/master/template.cpp
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#ifdef DEBUG
#define db(x) x
#els... | ALGO | 0.999887 | 5.223433 |
e505887e-9da8-4a3a-887b-0ccbe168c81c | HPC-AI-Team/lammps-fugaku-threadpool-sc23 | src/OPENMP/thr_data.cpp | /* ----------------------------------------------------------------------
Contributing author: Axel Kohlmeyer (Temple U)
per-thread data management for LAMMPS
------------------------------------------------------------------------- */
#include <cstdio>
#include <cstring>
#include "thr_data.h"
#include "memory... | TOOL | 0.891068 | 6.903655 |
1a1a42b8-f8f3-43b1-a1e3-4b4f2c5073ea | harrywaugh/SuperscalarSim | clean_dir/src/ALU.cpp | #include "DecodeUnit.h"
#include "ALU.h"
// EXECUTE UNIT
Processor::ALU::ALU()
{
}
void Processor::ALU::update_next_instruction(Processor *processor)
{
// if (processor->alu_reservation_station.size() == 0) return;
// next_instruction = processor->alu_reservation_station.at(0);
// processor->alu... | ALGO | 0.926259 | 4.051558 |
bffed4c6-cc44-48ec-ba4b-6a39354a8579 | A-jay98/Go-MiniMax | BaseGo/core/Node/Node.cpp | //
// Created by Ali Jamadi on 2019-01-23.
//
#include <iostream>
#include "Node.h"
using namespace std;
Node::Node(int depth, int move) : depth(depth), move(move) {
}
vector<Node *> Node::genChildren(int color) {
vector<Node *> childs;
int move;
for (int i = 0; i < 9; i++) {
for (int j = 0; j ... | ALGO | 0.997759 | 3.773266 |
ec691c20-d72e-4881-988a-026eb3fbd93c | swapnilhota/interviewBit | Two Pointers/Remove Duplicates from Sorted Array.cpp | int Solution::removeDuplicates(vector<int> &A) {
if(A.size()==1)
{
return 1;
}
if(A[0]==A[A.size()-1])
{
A.resize(1);
return 1;
}
int i=0;
int j=1;
while(j<A.size())
{
if(A[i]==A[j])
{
j++;
}
else... | ALGO | 0.999955 | 5.551784 |
a33d51c9-6b84-42d0-9e8d-4460f34fad1c | cjlworld/OJ | Luogu/P1115.cpp | #include<set>
#include<map>
#include<queue>
#include<stack>
#include<ctime>
#include<cmath>
#include<bitset>
#include<vector>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
const int N=2e5+5;
const ... | ALGO | 0.999948 | 3.487303 |
3e6357b5-3007-4869-ae06-4ba190ed49d9 | ishandutta2007/codeforces | a_g/normal/1553/H.cpp | #include <bits/stdc++.h>
using namespace std;
const int K = 19;
const int INF = 1e9;
int mn[2][1<<K], mx[2][1<<K], f[2][1<<K];
int main () {
ios_base::sync_with_stdio(0); cin.tie(0);
int n, k;
cin >> n >> k;
int m = 1<<k;
fill(mn[0], mn[0]+m, INF);
fill(mx[0], mx[0]+m, -INF);
fill(f[0], f[0]+m, INF);
... | ALGO | 0.999959 | 4.05688 |
a636afd2-4075-4162-ab70-b5eba04621c2 | reddyjv/competativeprogramming | recursion/binarysearch.cpp | #include<iostream>
using namespace std;
bool binarysearch(int *arr,int s,int e,int k){
//base case (element not found)
if(s>e)
return false;
int mid=s+(e-s)/2;
cout<<"value of mid is"<<mid<<endl; //debugging purpose
//element found
if(arr[mid]==k)
{
return true;
}
if(arr[... | ALGO | 0.999953 | 4.635332 |
45483e72-2a36-4f0c-b978-c2eb63a87304 | YellowCucumber23/zipzap | arduino/src/main.cpp | #include <Arduino.h>
/*GLOBAL VARIABLES*/
enum pieces{EMPTY, wP, wN, wB, wR, wQ, wK, bP, bN, bB, bR, bQ, bK};
char pieces[] = {'0', 'P', 'N', 'B', 'R', 'Q', 'K', 'P', 'N', 'B', 'R', 'Q', 'K'};
int sensor_board[8][8] = {
{23,25,27,29,31,33,35,37},
{39,41,43,45,47,49,51,53},
{22,24,26,28,30,32,34,36},
{38,40,42,... | ALGO | 0.90652 | 4.024271 |
b433190e-94a7-41a9-bacc-55feb3877de4 | ishandutta2007/codeforces | flowerletter/normal/1280/B.cpp | /*mjytxdy!*/
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fir first
#define sec second
#define all(x) x.begin(),x.end()
#define size(x) ((int)x.size())
#define pii pair<int,int>
#define pil pair<int,ll>
#define pli pair<ll,int>
#define pll pair<ll,ll>
#define inl inline
#define rep(i,l,r) ... | ALGO | 0.999875 | 3.863423 |
9e0a85fe-0071-41df-a3ee-12d249342fe8 | Andrew5c/Cplusplus-in-Linux-guide | code/sortAlgorithm/main.cpp | /*************************************************************************
> File Name: main.cpp
> Author: Andrew. Q
> Describe:
> Created Time: 2020年09月28日 星期一 19时11分21秒
************************************************************************/
#include<iostream>
#include<iterator>
#include"sort.h"
using names... | ALGO | 0.999529 | 4.713299 |
d0c48350-c250-4f0f-9095-564f56b575dc | AIdevol/employee-pocket-management-app | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
ed35d4b0-ee2e-4456-bd63-d4976b44cab7 | LIHPC-Computational-Geometry/qualif | src/qualifinternal/Pyramide.cpp | #include "Pyramide.h"
#include "Quadrangle.h"
namespace Qualif {
//**************************************************************
// METHODES ET DEFINITIONS DE LA CLASSE
// PYRAMIDE
//**************************************************************
//============================... | ALGO | 0.998336 | 5.53306 |
39fd4347-93ac-4153-b285-f3c62610ebc0 | sef-computin/cpp-labs | 1 Семестр/lab17/lab17task1.cpp | // lab1 task 1
#include <iostream>
void InputArray(int[10000], int);
int FindMinimumIndex(int[], int, int);
void Swap(int&, int&);
void SelectionSort(int[], int);
void OutputArray(int[], int);
//
int main()
{
int len;
int* Array;
printf("Array:\n");
scanf_s("%d", &len);
while (len > 10000) { printf("out of maximum... | ALGO | 0.999693 | 4.083031 |
c0833a45-de28-41ab-9576-50873c236404 | KarunyaGupta/CPP-Practice | Drafts/reverse_digit_of_number_loop.cpp | #include <iostream>
using namespace std;
int main(){
int number ;
cout<<"Enter number : ";
cin>> number ;
int lastdigit;
cout<< "The reverse of the number is : ";
// while(number>0){
// lastdigit = number%10;
// number = number/10;
// cout<< lastdigit;
//... | ALGO | 0.999488 | 3.822603 |
99067a40-b0da-4e06-b9a0-92dda30b142e | andyvand/ReactOS-Source | rosapps/applications/fraginator/MainDialog.cpp | #include "Unfrag.h"
#include "MainDialog.h"
#include "resource.h"
#include "Fraginator.h"
#include "Defragment.h"
#include "ReportDialog.h"
vector<wstring> DrivesList;
LRESULT AnalyzeID;
LRESULT FastID;
LRESULT ExtensiveID;
bool QuitWhenDone;
bool Stopping;
LRESULT PriHighID;
LRESULT PriAboveNormID;
LRESULT PriNormal... | TOOL | 0.926418 | 4.29406 |
5b125ff0-1601-4946-974f-70e1ba212ae8 | A1-mamun/CP-Problem | ideal_point.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<int>
#define vl vector<long long>
#define pb push_back
#define vpll vector<pair<ll, ll>>
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
ll t;
cin >> t;
while (t--)
{
ll n, k, l, r, c = 0, l1 = 0, ... | ALGO | 0.999964 | 3.545148 |
c6a63add-1f39-41ef-900b-c1e5be326481 | Class-17/CodeForces | A2OJ/Div.A/0165.Supercentral_Point.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n; cin >> n;
vector<pair<int, int>> points(n);
for (auto & point : points)
cin >> point.first >> point.second;
int cnt = 0;
for (int i = 0; i < points.size(); i++) {
... | ALGO | 0.999962 | 4.378009 |
99efd4ad-133c-41f9-8f48-149d03662ddb | dks1018/CoffeeShopCoding | 2021/Code/C++/MailServer/Final/cryptopp-CRYPTOPP_8_2_0/cryptopp-CRYPTOPP_8_2_0/des.cpp | // des.cpp - modified by Wei Dai from Phil Karn's des.c
// The original code and all modifications are in the public domain.
/*
* This is a major rewrite of my old public domain DES code written
* circa 1987, which in turn borrowed heavily from Jim Gillogly's 1977
* public domain code. I pretty much kept my key sch... | ALGO | 0.998791 | 6.463319 |
c1ed0ac4-2e85-403c-9c2b-ac2ab262673d | jurbn/mrgcv-msoa | Nori2/ext/nanogui/ext/eigen/test/visitor.cpp | #include "main.h"
template<typename MatrixType> void matrixVisitor(const MatrixType& p)
{
typedef typename MatrixType::Scalar Scalar;
Index rows = p.rows();
Index cols = p.cols();
// construct a random matrix where all coefficients are different
MatrixType m;
m = MatrixType::Random(rows, cols);
for(Ind... | TEST | 0.90899 | 6.242714 |
e571147a-2b3f-40f0-b04f-48418f01f74e | Nyapy/FMTS | 2024algorithm/Project1/h2304.cpp | //#ifndef _CRT_SECURE_NO_WARNINGS
//#define _CRT_SECURE_NO_WARNINGS
//#endif
//
//#include <stdio.h>
//
//
//
//extern void init(int N, int mId[], int mLocation[]);
//extern int add(int mId, int mLocation);
//extern int remove(int mStart, int mEnd);
//extern int install(int M);
//
//////////////////////////////////////... | ALGO | 0.985276 | 3.76528 |
0d69d0de-e8a7-44c6-a3e5-e0dff40ea23c | pavelsimo/ProgrammingContest | topcoder/PastContest/SumsOfPerfectPowers.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <list>
#include <bitset>
#include <deque>
#include <numeric>
#include <iterator>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ccty... | ALGO | 0.9977 | 4.667317 |
891272d1-0f76-4aa7-a6d4-22a79d94984b | ishandutta2007/codeforces | magga/normal/251/C.cpp | #include<bits/stdc++.h>
using namespace std;
void pre(){}
long long int a,b,k;
long long int inf = 1e9;
long long int oo = 0;
long long int val(long long int k){
long long int ret = 1;
for(long long int i=2;i<=k;i++){
ret=(ret*i)/(__gcd(i,ret));
}
return ret;
}
long long int distance(long long i... | ALGO | 0.999965 | 3.686059 |
c0d272ff-8551-433b-b619-64c814504c63 | AbidurRahman24/C_pp_for_DSA | module/module 6/sort.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin>>s;
sort(s.begin(), s.end());
cout<<s<<endl;
return 0;
} | ALGO | 0.999546 | 4.135603 |
f20bdcc5-24e4-4bbc-91da-e1a2fe5fc0ba | ballista01/leetcode | passed/121.best-time-to-buy-and-sell-stock.cpp | /*
* @lc app=leetcode id=121 lang=cpp
*
* [121] Best Time to Buy and Sell Stock
*/
#include <iostream>
#include <vector>
#include <math.h>
using namespace std;
// @lc code=start
class Solution
{
public:
int maxProfit(vector<int> &prices)
{
int minPrice = INT32_MAX;
int maxProfit = 0;
... | ALGO | 0.999328 | 6.272032 |
72f5b022-a4bf-46b7-b618-d324eff8e108 | huypl53/FaceLiteiOS | source/geometry/GeometryBinary.cpp | #include "ConvertUtils.hpp"
#include "geometry/GeometryComputer.hpp"
#include "shape/SizeComputer.hpp"
namespace MNN {
class GeometryBinary : public GeometryComputer {
public:
virtual bool onCompute(const Op* op, const std::vector<Tensor*>& inputs, const std::vector<Tensor*>& outputs,
Con... | TOOL | 0.961032 | 7.193332 |
3ed250d5-2247-45dd-83d8-bc98488332d3 | AmarjeetJyotis/GeeksForGeeks- | Difficulty: Easy/Help the Old Man!!!/help-the-old-man.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution{
public:
vector<int> res;
int cnt = 0;
void do1(int n, int from, int to) {
++cnt;
if (cnt == n) {
res.push_b... | ALGO | 0.999762 | 6.066505 |
12af6eec-abe1-46fa-b1da-453f37b4d8d3 | lindaxs/kleaverParser | lib/Core/StatsTracker.cpp | #include "StatsTracker.h"
#include "klee/ExecutionState.h"
#include "klee/Statistics.h"
#include "klee/Config/Version.h"
#include "klee/Internal/Module/InstructionInfoTable.h"
#include "klee/Internal/Module/KModule.h"
#include "klee/Internal/Module/KInstruction.h"
#include "klee/Internal/Support/ModuleUtil.h"
#include... | TOOL | 0.889228 | 7.854326 |
6540167d-ea76-4281-bb62-58125027e3d3 | vg11k/Advent-of-Code-2023 | Sujet 17/main.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
using namespace std;
static const int maxErrorFactor = 9;
static const int maxProfondeur = 450;
static const string filename = "input.txt";
//static const string filename = "example.txt";
static const int max... | ALGO | 0.999756 | 4.036036 |
05dc4019-1413-4eec-a729-3ca72ba4104b | saojiprasad/CP | Code Forces/math/1000 Olesya and Rodion.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
char ss(int n){
char arr[10]={'0','0','2','3','4','5','6','7','8','9'};
return arr[n];
}
int main(){
ll a,b;
cin>>a>>b;
string s="";
string s1;
s1=ss(b);
if(a<2&&b==10){
cout<<"-1"<<endl;
}
else if(a>=2&&... | ALGO | 0.999796 | 4.157631 |
ba24b5f8-e24c-4d1f-8288-6d60f45e440c | ManojKumarPatnaik/Sr.SoftwareEngineerInterviewPrep | Searching and Sorting/C++/Shell_Sort.cpp | #include<iostream>
using namespace std;
void ShellSort(int a[], int n) // A function implementing Shell sort.
{
int i, j, k, temp;
// Gap 'i' between index of the element to be compared, initially n/2.
for(i = n/2; i > 0; i = i/2)
{
for(j = i; j < n; j++)
{
for(k = j-i; k >= 0; k = k-i)
{
if(a[... | ALGO | 0.999919 | 4.436674 |
a1185e95-bc84-4333-b2b7-e9a018a7c3e9 | anindya028/Programming-Contest-Problems | UVa/v111/11125.CPP | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<ctype.h>
#include<algorithm>
#include<queue>
#include<list>
#include<vector>
#include<string>
using namespace std;
#define sq(a) ((a)*(a))
#define pb(a) push_back(a)
#define Min(a,b) (((a)<(b))?(a):(b))
#define Max(a,b) (((a)>(b))?(a):(... | ALGO | 0.999959 | 3.495836 |
385cf234-3336-44eb-bbfa-a6c534ef4dd4 | enzogl25/Competitive-Programing | Beecrowd/1052.cpp | #include <bits/stdc++.h>
using namespace std;
#define _ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define f first
#define s second
#define pb push_back
#define ppb pop_back
using ll = long long;
int main() {
_
vector<string> v = {"January", "February", "March", "April", "May", "June", "... | ALGO | 0.996653 | 3.650196 |
3ee8b696-0450-453b-b6fb-86006302b7ba | Shaleengovil25/Practice-Codes | Searching and Sorting/Merge Sort.cpp | //Time O(nlogn) Space O(n)
#include <bits/stdc++.h>
using namespace std;
void Merge(int a[],int lb,int mid,int ub){
int i = lb;
int j = mid+1;
int k = 0;
int b[ub-lb+1];
while(i<=mid && j<=ub){
if(a[i] <= a[j]){
b[k] = a[i];
i++;
}
else{
... | ALGO | 0.999975 | 4.88426 |
b8354404-9d15-41c0-8806-0e15579c3560 | himanshu062/geeksforgeeks-potd | Hard/2024/04-02-2024 - Subtraction in Linked List.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// Node Class
class Node {
public:
int data;
Node* next;
Node(int val) : data(val), next(NULL) {}
};
// Linked List Class
class LinkedList {
public:
Node* head;
Node* tail;
LinkedList() : head(NU... | ALGO | 0.999878 | 5.741949 |
3a487890-f15e-4b5c-a37d-02fb4c80c06f | l3vi-7/Programming | Important Concepts/Hashing_OpenAddressing_QuadraticProbing.cpp | #include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define ll long long int
void printArray (vector <int> v) {
cout << endl;
for (auto i : v)
cout << i << " ";
cout << endl;
}
void delete_element (vector <int> &mapk, int el... | ALGO | 0.999951 | 3.679424 |
a84a2efb-b7e5-45cd-9996-f120840a0f62 | jsueprez/Cpp | Codility/oddPairs.cpp | #include <vector>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#include <algorithm>
// you can write to stdout for debugging purposes, e.g.
// cout << "this is a debug message" << endl;
int oddPairs(vector<int> &A) {
// write your code in C++14 (g++ 6.2.0)
//unordered_map<int, int> m(... | ALGO | 0.997818 | 5.179111 |
d64e1dc4-79a5-4a53-a140-ea9a22139083 | Gabriel-Baril/boost | boost_1_81_0/libs/math/example/root_finding_multiprecision_example.cpp | // Note that this file contains Quickbook mark-up as well as code
// and comments, don't change any of the special comment mark-ups!
// Example of root finding using Boost.Multiprecision.
#ifndef BOOST_MATH_STANDALONE
#include <boost/math/tools/roots.hpp>
//using boost::math::policies::policy;
//using boost::math::t... | ALGO | 0.999326 | 3.615398 |
47aea2c8-5d58-471b-999c-ccaa0a55f3fd | canivel/CarND-MPC-Project | src/Eigen-3.3/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_1nn.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Eigen::MatrixXf m(2,4);
Eigen::VectorXf v(2);
m << 1, 23, 6, 9,
3, 11, 7, 2;
v << 2,
3;
MatrixXf::Index index;
// find nearest neighbour
(m.colwise() - v).colwise().squaredNorm()... | ALGO | 0.999888 | 4.152517 |
d86f858e-7baa-498f-a7b6-713e59e16d5b | misima49/LeetCode-Solutions | 2326-spiral-matrix-iv/2326-spiral-matrix-iv.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
void spiralOrder(vector<vecto... | ALGO | 0.999998 | 5.887677 |
ff3142ab-b659-4c0e-86bd-86631d20f006 | flagflag/FlagGG | 3rd/bgfx/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_permute_function_parameters.cpp | #include <numeric>
#include <vector>
#include "source/fuzz/fuzzer_context.h"
#include "source/fuzz/fuzzer_pass_permute_function_parameters.h"
#include "source/fuzz/fuzzer_util.h"
#include "source/fuzz/instruction_descriptor.h"
#include "source/fuzz/transformation_permute_function_parameters.h"
namespace spvtools {
na... | TOOL | 0.932238 | 7.936697 |
4f5d3bc0-0218-4fa8-9b9f-252b1d780fb0 | Ryshab/Data-structures-and-algorithm | sorting/bubblesort.cpp | #include <iostream>
using namespace std;
void bubble(int arr[], int n)
{
for (int i = n - 1; i > 0; i--)
{
for (int j = 0; j < i; j++)
{
if (arr[j] > arr[j + 1])
{
int temp = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = temp;
... | ALGO | 0.999985 | 4.801621 |
de5741eb-9120-4531-97fd-e3af22ad2825 | SaltineChips/Konjungate-Control | src/rpcsmessage.cpp | #include "main.h"
#include "rpcserver.h"
#include <boost/lexical_cast.hpp>
#include "smessage.h"
#include "init.h" // pwalletMain
using namespace json_spirit;
using namespace std;
extern void TxToJSON(const CTransaction& tx, const uint256 hashBlock, json_spirit::Object& entry);
Value smsgenable(const Array& params... | WEB | 0.909894 | 5.579466 |
d641e4c1-e982-476d-a68a-baa72d714920 | InsightforGeeks/flutter-widgets | convex_bottombar/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.998772 | 6.76073 |
2ddc1bd8-7565-4e75-9fe3-41c44e875273 | jaencin1/target-tracking-sim | cpp-simulator/lib/eigen-3.4.0/bench/sparse_randomsetter.cpp |
#define NOGMM
#define NOMTL
#define EIGEN_GOOGLEHASH_SUPPORT 1
#include <map>
#include <ext/hash_map>
#include <google/dense_hash_map>
#include <google/sparse_hash_map>
#ifndef SIZE
#define SIZE 10000
#endif
#ifndef DENSITY
#define DENSITY 0.01
#endif
#ifndef REPEAT
#define REPEAT 1
#endif
#include "BenchSparseUt... | TOOL | 0.905902 | 4.503383 |
b3cb11b6-c3cb-4c02-bcfd-1bb5c5d51861 | amrharb/leetcode | 5-longest-palindromic-substring/5-longest-palindromic-substring.cpp | class Solution {
public:
string s;
bool check(int i,int j){
for(;i<j;i++,j--){
if(s[i]!=s[j])return 0;
}
return 1;
}
string longestPalindrome(string x) {
s=x;
string ans;
int mx=0,n=s.size();
for(int i=0;i<n;i++){
for(int j=n-... | ALGO | 0.999973 | 5.891907 |
25874ca7-8847-4511-bad2-db40d29d92bd | HeZephyr/Awesome-Algorithm-Resources | 数据结构与算法学习/单调队列单调栈/单调队列-滑动窗口问题.cpp | /**
*@filename:单调队列
*@author: pursuit
*@csdn:unique_pursuit
*@email: <EMAIL>
*@created: 2021-06-02 15:25
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e6 + 10;
const int P = 1e9+7;
int n,k,a[N];//我们用单调队列记录下标。
void get_min(){
deque<int> q;
//先将k - 1个数入队。由于这里求... | ALGO | 0.999997 | 3.749668 |
8596254c-b5a7-4821-9471-2685d6840747 | Devchawla2608/100Days | Day16/LeetcodeDaily.cpp | // Fair Distribution of Cookies
// You are given an integer array cookies, where cookies[i] denotes the number of cookies in the ith bag. You are also given an integer k that denotes the number of children to distribute all the bags of cookies to. All the cookies in the same bag must go to the same child and cannot be ... | ALGO | 0.999979 | 5.340104 |
433ebed8-05e6-4e51-a595-7a497a0fbe54 | sambler/myblender | extern/bullet2/src/BulletSoftBody/btSoftSoftCollisionAlgorithm.cpp | #include "btSoftSoftCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
#include "BulletCollision/CollisionShapes/btBoxShape.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletSoftBody/btSoftBodySolvers.h"
#include "btSoftBody.h"
#include "BulletCo... | ALGO | 0.995261 | 3.784431 |
afdf89cc-8f02-427b-bc7a-271645c9c87b | Guru-180188/C_P_P_Programms | Unique.cpp | #include<iostream>
using namespace std;
void unique(int num[],int n){
int ans=0;
for(int i=0;i<n;i++){
ans=ans^num[i];
}
cout<<"the unique element is "<<ans<<endl;
}
int main(){
int n;
cin>>n;
int num[100];
for(int i=0;i<n;i++){
cin>>num[i];
}
unique(num,n);
} | ALGO | 0.99994 | 4.492092 |
631144c1-23d5-45aa-b0d0-2ec5539c3595 | B20DCCN528/C- | songuyenthuy.cpp | #include <bits/stdc++.h>
using namespace std;
string solve(string s) {
string t = s;
reverse(t.begin(), t.end());
return s + t;
}
void testCase() {
int n; cin >> n;
queue<string> q;
q.push("");
while (!q.empty()) {
string s = q.front();
q.pop();
if (s != "") {
... | ALGO | 0.999873 | 5.800036 |
1cbe3635-b6e2-4742-a327-bfc09cff3c44 | panyaoyu/BeautifulAlgorithm | Chapter-2-Recursion/递归法辗转相除.cpp | //շת
#include<iostream>
using namespace std;
int zhanzhuanxiangchu(int m,int n ){
if (m%n==0)
return n;
return zhanzhuanxiangchu(n,m%n);
}
int main(){
int a = 35,b = 42;
cout<<zhanzhuanxiangchu(a,b);
return 0;
}
| ALGO | 0.999891 | 3.438161 |
c39f5715-4a7c-4f2b-bc5f-6c7fbcfd5d1d | trlste/new-mega-scggm | eigen3/doc/examples/class_CwiseBinaryOp.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
// define a custom template binary functor
template<typename Scalar> struct MakeComplexOp {
EIGEN_EMPTY_STRUCT_CTOR(MakeComplexOp)
typedef complex<Scalar> result_type;
complex<Scalar> operator()(const Scalar& a, const Scalar& b... | ALGO | 0.969143 | 6.700232 |
77018998-09d3-4669-9448-3f1961980ccf | sahilkhan03/CF-Solutions | codeforces/962/B.cpp | /* “Whether you think you can or you think you can’t, you’re right” - Henry Ford */
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fast \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define all(... | ALGO | 0.999542 | 3.811578 |
0ceb4a6c-d606-4c5e-96ff-2a7c1ffb1dbf | MohdAqib8267/6-Companies_30_days_Challenges | 0064-minimum-path-sum/0064-minimum-path-sum.cpp | class Solution {
public:
int solve(int i,int j,int m,int n,vector<vector<int>>& grid, vector<vector<int>>&dp){
if(i>=m || j>=n){
return INT_MAX;
}
if(i==m-1 and j==n-1){
return grid[i][j];
}
if(dp[i][j]!=-1){
return dp[i][j];
}
... | ALGO | 0.999985 | 6.030602 |
6bd37a21-fc4c-4dea-a1cd-d969341ec9a7 | jochongs/codetree-TILs | 240223/정사각형의 넓이/area-of-a-rectangle.cpp | #include <iostream>
using namespace std;
int main() {
// 여기에 코드를 작성해주세요.
ios_base :: sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin >> n;
cout << n * n << '\n';
if(n < 5) {
cout << "tiny";
}
return 0;
} | ALGO | 0.99924 | 4.406995 |
b314d358-be8e-4e91-a71a-80fcc5129f32 | ancloudie/exerciseProsedural_120 | exerciseProsedural_120/exerciseProsedural_120.cpp | #include <iostream>
using namespace std;
int arr[20]
int main();
double rerata(double a, double b) {
return (a + b) / 2;
}
double nama;
string status(double c) {
if (c >= 80)
return "Diterima";
else
return "Tolak";
}
int main()
{
double nilM, nilB;
cout << "Masukan nilai Matem... | TOOL | 0.970492 | 4.041956 |
81ff13df-923d-4d41-909e-e7bc18547418 | dngtundt/KTLT_NICE | chuong_5/Bai15.cpp | #include <stdio.h>
#define _CRT_SECURE_NO_WARNINGS
// Khai báo trước các hàm đệ quy
long long TongA(int n);
long long TinhA(int n);
// Hàm tính tổng các giá trị từ A1 đến A(n-1)
long long TongA(int n) {
if (n == 1) {
return 1;
}
return TongA(n - 1) + TinhA(n - 1);
}
// Hàm đệ quy để tính giá trị của An
long lo... | ALGO | 0.999871 | 4.341209 |
a54994be-0bad-43d0-827a-35c35222b359 | HafizulHaque/Coding-Problem-Solving | BFS/459 - Graph Connectivity.cpp | #include<iostream>
#include<vector>
#include<map>
#include<queue>
#include<cstring>
#include<cstdio>
using namespace std;
vector<int>edges[100];
map <char, int> nodes;
int vis[1000];
int bfs(int src)
{
queue <int> q;
q.push(src);
vis[src]=1;
while(!q.empty()){
int u=q.front(); q.pop();
f... | ALGO | 0.999376 | 3.847727 |
13b5f1f5-6f34-43ea-b7be-39c3efccdd9a | maximumsw/straus-s_troop | C++/Object-oriented programming С++/old/dz_deadline_04.27.2024/dz_deadline_04.27.2024_01.cpp | #include <iostream>
#include <stdexcept> // Для генерації виключень
using namespace std;
template<typename T>
class Queue {
private:
int front; // Індекс переднього елемента черги
int rear; // Індекс заднього елемента черги
int maxSize; // Максимальний розмір черги
int itemCount; // Кількі... | ALGO | 0.996761 | 5.44615 |
8dad9f48-2df8-4244-8a61-26f45360e46f | parrotfish813/Object-Oriented-Programming-Class | Labs/Lab 3/Brandon_Townes_PartC_Lab3.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main() {
int num;
cout << "Enter the number of lines: ";
cin >> num;
for (int current = 1; current <= num; ++current) {
for(int spaces = 0; spaces < num - current; ++spaces)
cout << " ";
for(int number = ... | ALGO | 0.997833 | 3.89907 |
e297cc44-6316-47f1-9839-28282c5c2bb5 | prajalpatidar06/CPP_practice | cf_bit++.cpp | // link: https://codeforces.com/problemset/problem/282/
#include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int res = 0;
string s;
while (n--){
cin>>s;
if(s[0] == '+' || s[1] == '+' || s[2] == '+')
res++;
else
res--;
}
cout<<res... | ALGO | 0.999845 | 4.001004 |
d819f4ef-a215-473f-901e-6c1d05012eb5 | PacktPublishing/-Master-Data-Structures-and-Algorithms-Interviews---Ace-Leetcode-Blind-75- | 0053-maximum-subarray/0053-maximum-subarray.cpp | #include <vector>
#include <algorithm>
class Solution {
public:
int maxSubArray(std::vector<int>& nums) {
int currentSum = nums[0];
int maxSum = nums[0];
for (int i = 1; i < nums.size(); ++i) {
currentSum = std::max(nums[i], currentSum + nums[i]);
maxSum = std::max(... | ALGO | 0.999918 | 6.879467 |
02df3444-27ae-46bd-ace1-0033d8be516d | HUECTRUM/reference | convolutions_transforms/xor_conv/xor_conv.cpp | #include <bits/stdc++.h>
using namespace std;
struct BitConvolutions {
template<typename T> void fwhtDiv(vector<T> &arr, int sz, bool inverse = false) {
for (int len = 1; 2 * len <= sz; len <<= 1) {
for (int i = 0; i < sz; i += 2 * len) {
for (int j = 0; j < len; ++j) {
... | ALGO | 0.999413 | 3.584386 |
22fdb800-feaf-46b5-8463-8b008ae49cbe | baquyptit2001/C- | fibo1.cpp | #include<iostream>
using namespace std;
long long mod=1000000007;
long long fibo(int n){
if(n==0||n==1)
return n;
int f0=0, f1=1, dem=1, tmp;
while(dem<n){
tmp=f0%mod;
f0=f1%mod;
f1=(tmp+f0)%mod;
dem++;
}
return f1;
}
int main(){
int t;
cin>>t;
... | ALGO | 0.999883 | 4.315312 |
56e888e3-ddb3-4356-9cd3-e525b1f51195 | JN513/codigosc- | c++/posiounega.cpp | #include <iostream>
using namespace std;
int main()
{
int x;
cin >> x;
if (x == 0)
{
cout << "nulo";
}
if (x < 0)
{
cout << "negativo";
}
if (x > 0)
{
cout << "positivo";
}
}
| ALGO | 0.99916 | 3.742791 |
d143f5df-be92-4663-ad4e-d3b8161cf50b | Deltron18/c | sumofn.cpp | #include<iostream>
using namespace std;
int sum(int n){
if(n==1)
return 1 ;
return n + sum(n-1);
}
int main(){
int n=5;
cout<<sum(n);
} | ALGO | 0.999837 | 4.20426 |
7c1031ed-cd0a-4965-af20-a1ab1b94f787 | jaesunglee9/acmicpc | 01018.cpp | // template for competitive programming
// also don't forget cout << '\n'
// don't use c style input
#include <cstdlib>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
const int INF = 1e9 + 7;
int fwr(vector<vector<int>>& b, int sx, int sy) {
vector<int> wr = {0,1,0,1,0,1,0,1};
int s... | ALGO | 0.999377 | 4.499867 |
0fa07306-004a-42f5-b7fe-15c7cb6f8711 | InSange/BaekJoon | BaekJoon/BaekJoon/10809.cpp | #include <iostream>
using namespace std;
int main()
{
cin.tie(NULL);
ios::sync_with_stdio(false);
int check[26] = {}, count=0;
string s;
cin >> s;
for (int i = 0; i < 26; i++) {
check[i] = -1;
}
for (char ch : s) {
if (check[ch - 97] == -1) check[ch - 97] = count;
count++;
}
for (int i = 0; i < 2... | ALGO | 0.999941 | 4.032312 |
ef47eedd-4a68-4d2c-b0bf-aec4e902ad54 | Voley/Algorithmic-Problems | Recursion/Robot/main.cpp | #include <iostream>
#include <vector>
#include <string>
#include <unordered_map>
class Point {
int x;
int y;
public:
Point(int xVal, int yVal) {
x = xVal;
y = yVal;
}
int getX();
int getY();
std::string stringRepresentation();
};
bool operator == (Point& lhs, Point& rhs) {
... | ALGO | 0.999486 | 5.238887 |
6acd691a-d479-4ad0-8cd7-a263d90e2269 | techlism/LeetCode-Solutions | 0606-construct-string-from-binary-tree/0606-construct-string-from-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999939 | 6.395323 |
726b7e77-575c-4e6f-8ef9-c1576769d949 | DerrickPikachu/Leetcode | submission/Dice_Roll_Simulation.cpp | class Solution {
public:
int dieSimulator(int n, vector<int>& rollMax) {
const int modulo = 1000000007;
vector<vector<long int>> dp(7, vector<long int>(n, 1));
vector<long int> possibleSum(7, 1);
long int sum = 6;
rollMax.insert(rollMax.begin(), 0);
... | ALGO | 0.999941 | 4.851704 |
ebfd7b5d-c74d-450e-8c97-5f3751162b63 | OscarRexid/PP | libraries/eigen-3.4.0/bench/benchmark.cpp | // g++ -O3 -DNDEBUG -DMATSIZE=<x> benchmark.cpp -o benchmark && time ./benchmark
#include <iostream>
#include <Eigen/Core>
#ifndef MATSIZE
#define MATSIZE 3
#endif
using namespace std;
using namespace Eigen;
#ifndef REPEAT
#define REPEAT 40000000
#endif
#ifndef SCALAR
#define SCALAR double
#endif
int main(int ar... | ALGO | 0.99332 | 3.675187 |
4e56fec3-c7a1-407d-951f-bfd32f46ba96 | tranlehuy106/ninepm | frondend/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.998492 | 6.76073 |
14a55cba-630f-4a66-8142-7a500e6fddc9 | hugmoklob/T2210M | Bai tap buoi 5 23-10/Bai 5.cpp | //Tìm chữ số lớn nhất của số nguyên dương n
#include <stdio.h>
int main(){
int n, x, max = 0;
printf("Nhap vao so n>0: ");
scanf("%d", &n);
if(n<=0){
printf("Nhap vao so n>0");
}
while(n!=0){
int x = n%10;
if(x>max){
max = x;
}
n = n/10;
}
printf("Chu so lon nhat cua n: %d \n", max);
} | ALGO | 0.999587 | 3.271579 |
8409dd6c-cf2b-4d6d-9fe0-f18e248715a2 | noah-ftnx/rpl | sde/23/07_.cpp | class Solution {
public:
// Function to detect cycle in a directed graph.
bool isCyclic(int V, vector<int> adj[]) {
// Khan's Algorithm
// find indegree for each node
vector<int> indegree(V, 0);
for (int from=0; from<V; from++) {
for (int to: adj[from]) {
... | ALGO | 0.999642 | 6.205092 |
04fc5d90-fd10-4688-a689-758cfbd8d96d | czfshine/my_oj | src/hdu1166.cpp | /*线段树经典题*/
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include <cstring>
#include <string>
#include <vector>
#include <iomanip>
#include <cmath>
#include <list>
#include <bitset>
using namespace std;
#define ll long long
#define lson l,m... | ALGO | 0.998244 | 3.706562 |
7eb7445d-24c2-4dbf-8025-a96d730f6c3d | ashishkumar11125/GFG-DSA-question | Hard/Split Array Largest Sum/split-array-largest-sum.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
bool isPossible(int arr[],int k , int minSol,int n){
int subSum = 0;
int cnt = 1;
for(int idx = 0; idx < n; idx++){
if(arr[idx] > minSol)
return false;
... | ALGO | 0.999987 | 5.929876 |
632546c2-6eed-4244-8d85-c01e44da649a | kane-crypte/js | piletempel/main.cpp | #include <iostream>
template <typename T, size_t MaxSize>
class Pile {
private:
T tableau[MaxSize]; // Le tableau pour stocker les lments de la pile
int topIndex; // L'indice du sommet de la pile
public:
// Constructeur qui initialise la pile vide (topIndex = 0)
Pile() : topIndex(0) {}
// Ajout... | TOOL | 0.983015 | 6.040156 |
bb4778ea-a808-4670-8c94-f63b6d258d63 | Nikolavac/CPP_LEARN | CodeCraft-2019/Dijkstra.cpp | #include "Dijkstra.h"
#include <string>
#define DBL_MAX 1.7976931348623158e+300
//图类定义
void Graph::addEdge(Edge& edge){
vertices.insert(edge.source);
vertices.insert(edge.destine);
edges.insert(edge);
adjacents[edge.source].insert(edge);
/*
if(adjacents.count(edge.source)){
std::set<Edge> curEdgeSet = adjac... | ALGO | 0.998534 | 3.964983 |
a3276a6f-9f10-49b8-a298-13adf89622d7 | AbihaFatima/LeetCode | 258-add-digits/258-add-digits.cpp | class Solution {
public:
int addDigits(int num) {
for(int i=0;i<num;i++){
int a = num/10;
int b = num%10;
num = a+b;
if(num/10 < 1){
break;
}
}
return num;
}
}; | ALGO | 0.999921 | 6.234204 |
e76c2fb2-1baf-4d01-9ea9-ddb39a8c5e27 | Axmedov2004/my_first-app-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.998799 | 6.776823 |
4f1b8557-80d5-4607-940f-27f1e8bb0725 | metanoia1989/DataStructure | BeautyAlgorithm/02.指针与数组/Matrix_Z_glyph_arrangement.cpp | #include <iostream>
#include <iomanip>
//******************************************************************
// 图片的JPEG压缩的Z字形编排
// 对于原始矩阵matrⅸx中的任意元素 matrix[U的遍历走向规律可以分为如下3种情况。
// 如果二维数组中的元素 matrix{]中纵坐标j是偶数,且i=0或者=7,那么遍历路径在矩阵中的走向就是水平向右移动一格。
// 如果二维数组中的元素 matrix[u]中纵坐标是奇数,且j=0或者j=7那么遍历路径在矩阵中的走向就是垂直向下移动一格。
// 除上述规则以外的情况... | ALGO | 0.998768 | 3.263121 |
b8254c67-2528-4601-8644-5552c91e49c4 | ishandutta2007/codeforces | data_h/normal/763/A.cpp | #include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <iostream>
#include <cassert>
#include <vector>
#include <string>
#include <map>
#include <set>
using namespace std;
const int N = 1e5 + 7;
int down[N], up[N];
int color[N], n;
vector<int> adj[N];
bool ok;
void check(int u, int from, int c) {
if (... | ALGO | 0.999921 | 3.824739 |
dd87fba8-6ba7-4d3a-aaf0-f0e3f0da23ce | PravdiilShilinskas/Mama-I-m-a-programmer | Graff/Dirak.cpp | #include <iostream>
using namespace std;
int dirak(int* evo, int* evd, int e, int v, int k){
int c=0;
for(int i=0;i<e;i++){
if((evo[i]==k)||(evd[i]==0)){
c++;
};
};
if((c>=v/2)||(dirak(evo, evd, e, v, k+1)==1)){
return 1;
}
else{
return 0;
};
}
void Graff(int e, i... | ALGO | 0.999757 | 4.232914 |
7eea2545-7d59-4de2-9b2d-779629a44615 | wayhong0928/Coding-Practice | C++/ZeroJudge/c067- 00591 - Box of Bricks.cpp | #include<iostream>
#include<cmath>
using namespace std;
int main(void)
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n, sum = 0, count = 0, c = 0;
while (cin >> n)
{
if (n == 0)
{
return 0;
}
c++;
sum = 0;
count = 0;
int * m = new int[n];
for (int i = 0; i < n; i++)
{
... | ALGO | 0.999757 | 3.278091 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.