uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
05d0a47e-3358-4678-b98a-85e7fa5ef756 | madmaxujjwal/leetcode-solutions | 568-maximum-vacation-days/568-maximum-vacation-days.cpp | class Solution {
public:
int n;
int k;
vector<vector<int>> f;
vector<vector<int>> d;
long long int rec(int z,int j,vector<vector<int>> &dp){
if(j==k)return 0;
if(dp[z][j]!=-1)
return dp[z][j];
long long int ans=INT_MIN;
for(int i=0;i<n;i++){
... | ALGO | 0.999976 | 5.255948 |
64334f51-28fd-4910-8897-b8eda2226d0b | rakib54/Algorithm-and-problem-solving | online_judge_problem/count_primes_leetcode.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int solve(int n)
{
if (n == 0 || n == 1)
{
return 0;
}
vector<bool> prime(n + 1, true);
int count = 0;
for (int i = 2; i < n; i++)
{
if (prime[i])
{
count++;
for (int j = i; j < n; j += i)
{
prime[j]... | ALGO | 0.998134 | 5.103791 |
d02277b1-3766-4443-886e-524cdf7fade8 | kfazekas/incremental-examples | cadical/src/reap.cpp | #include "reap.hpp"
#include <cassert>
#include <climits>
#include <cstring>
void Reap::init () {
for (auto &bucket : buckets)
bucket = {0};
assert (!num_elements);
assert (!last_deleted);
min_bucket = 32;
assert (!max_bucket);
}
void Reap::release () {
num_elements = 0;
last_deleted = 0;
min_buck... | ALGO | 0.859616 | 5.421096 |
56c69de3-6d64-4cdc-afc2-854c19ffe9e8 | CSUEB-CS201R/Lecture12Examples | InsertionSort.cpp | #include <iostream>
using namespace std;
void InsertItem(int values[], int startIndex, int endIndex)
// Post: values[0]..values[endIndex] are now sorted.
{
for (int current = endIndex; current != startIndex; current--) {
if (values[current] < values[current - 1]) {
swap(values[current], values... | ALGO | 0.999995 | 5.262737 |
f9259a55-65bc-4cce-804a-856578484c9b | alexandraback/datacollection | solutions_5634947029139456_0/C++/chhabraamit/chargingChaosSmall.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cst... | ALGO | 0.999538 | 3.914339 |
a8eb0473-60f6-4992-852b-ec2acb7708f7 | spikebarnett/cpp-euler | 9.cpp | #include <iostream>
using namespace std;
int main()
{
for(int m=2;m<23;++m)
{
for(int n=1;n<m;++n)
{
int a=m*m-n*n;
int b=2*m*n;
int c=m*m+n*n;
if(a+b+c==1000)
{
cout << a*b*c << endl;
return 0;
}
}
}
}
// 40824
| ALGO | 0.997479 | 3.882033 |
317c722a-2d0d-4a4f-a5f9-5faa2d3b2e07 | FNCRosse/PUCP-2024-1 | PROGRAMACION 2/EXAMENES/01/copia/CopiaP3/ColaGenerica.cpp | /*
* File: ColaGenerica.cpp
* Author: Rosa Cristina La Cruz Musayon
* Codigo: 20213714
* Created on 14 de mayo de 2024, 07:38
*/
#include <iostream>
using namespace std;
#include "ColaGenerica.h"
enum RegCola {CABEZA,COLA,TOTAL};
enum RegNodo {DATO,SIG};
void GeneraCola(void *&Cola){
void **AuxCola = new vo... | TOOL | 0.919253 | 3.667877 |
b189dac5-10e7-461c-898d-1b259ab21bc5 | ephlexaudio/FlxPedalV6-FlxMain | Processes/Filter3Band2.cpp | /*
* Filter3Band2.cpp
*
* Created on: Nov 1, 2018
* Author: buildrooteclipse
*/
#include "Processes.h"
#include "../valueArrays.h"
#include "../config.h"
using namespace std;
#define dbg 0
Filter3Band2::Filter3Band2():lp_y {0.000,0.000,0.000},
lp_x {0.000,0.000,0.000},bp_y {0.000,0.000,0.000,0.000,0.000... | ALGO | 0.988115 | 4.212428 |
bd3c3dc9-fed9-47db-ba43-607d5b985442 | rt-kill/CompetitiveProgramming | Codeforces/1956/D/main.cpp | #include <bits/stdc++.h>
using namespace std;
/* Macros {{{ */
/* A lot of this is from some of Benq's submissions
[https://codeforces.com/profile/Benq]
Ugly af to the eyes, but with vim fold its barable
Hopefully c++20 concepts can make all this stuff must cleaner */
/* Basics {{{ */
using ll = long lon... | ALGO | 0.999337 | 3.895192 |
b37b2a82-acf7-4974-b551-fb82ecac3800 | GBotogoske/megacell_scripts | MyMinuitFit_crosstalk.cpp | #include "TMinuit.h"
#include <TH1F.h>
#include <TMath.h>
#include <iostream>
#include <fstream>
#include <vector>
#define N 8
double y_e[N];
double y_error[N];
double y_f[N];
double chi_2;
int factorial(int n)
{
int result = 1;
for(int i=1; i<=n; i++)
{
result *= i;
}
return result;
}
// Define the functio... | ALGO | 0.998486 | 4.897233 |
b532068c-6ac1-4eb2-b698-8f57aa763bee | ishandutta2007/codeforces | vepifanov/normal/246/D.cpp | #include <cstdio>
#include <numeric>
#include <iostream>
#include <vector>
#include <set>
#include <cstring>
#include <string>
#include <map>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <bitset>
#include <queue>
#include <sstream>
#include <deque>
using namespace std;
#define mp make_pair
#define ... | ALGO | 0.999987 | 3.827619 |
8fd497ad-e9b6-40ad-ae3a-74431dcdabf9 | Aryanprakashh/StriversSheetChallenge | 367-valid-perfect-square/valid-perfect-square.cpp | class Solution {
public:
bool isPerfectSquare(int num) {
for(int i=1;num>0;i+=2){
num-=i;
}
return num==0;
}
}; | ALGO | 0.999892 | 5.45384 |
01e3f80f-f91a-46ed-8a3a-00ad788ec362 | karlissonJR/online-judges | [1121] Robô Colecionador.cpp | #include <stdio.h>
#include <stdlib.h>
#define MAX 101
int n,m,o;
char grid[MAX][MAX];
typedef struct sense{
char c;
int i,j;
struct sense* esq;
struct sense* dir;
} sense;
bool isValide(int u, int v){
return u>=0 && v>=0 && u<n && v<m && grid[u][v] != '#' ? true : false;
}
int main()
{
sense N, S, L, O, *ptr... | ALGO | 0.999713 | 3.546494 |
8761d43e-0b81-4e81-9642-b55a1a6ab876 | Mahe2112s/OwlCoder-3.0 | Difficulty: School/Print 1 To N Without Loop/print-1-to-n-without-loop.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
//Complete this function
int i=1;
void printNos(int N)
{
//Your code here
if(N==0) return;
cout<<(i)<<" ";
i+=1;
printNos(N-1);
}
};
//{ Dr... | ALGO | 0.999646 | 5.881955 |
585d0ecc-abdd-4529-ba77-aecc9b241730 | corykacal/Hacker-Rank-Challenges | data-structures/tree/Binary-Search-Tree:Insertion.cpp | /*
Node is defined as
typedef struct node
{
int data;
node * left;
node * right;
}node;
*/
node * insert(node * root, int value) {
if(root==NULL) {
root = new node();
root->data = value;
return root;
}
node* cur = root;
node* prev = NULL;
while(cur!=NULL) {
... | ALGO | 0.999978 | 5.208204 |
3d193ac8-58be-471a-bd01-e0106f2a6c02 | Jhonve/LearnScotty3D | deps/assimp/code/PostProcessing/TextureTransform.cpp | /** @file A helper class that processes texture transformations */
#include <assimp/Importer.hpp>
#include <assimp/postprocess.h>
#include <assimp/DefaultLogger.hpp>
#include <assimp/scene.h>
#include "TextureTransform.h"
#include <assimp/StringUtils.h>
using namespace Assimp;
// -----------------------------------... | TOOL | 0.861531 | 7.711715 |
9eb1e5b9-c9b8-4624-921b-b7145d4058ba | raincross7/code-similarity | codes/train_code/problem107/problem107_358.cpp | #include <stdio.h>
int ng[16][16];
int rec(int x, int y){
if(ng[x][y]) return 0; //工事中なら0
if(x == 0 && y == 0) return 1; //スタート地点なら1
if(x == 0) return rec(0, y-1);
if(y == 0) return rec(x-1, 0);
return rec(x-1, y) + rec(x, y-1);
}
int main(void){
int h, w, n, x, y, a, b;
// && は and, || は... | ALGO | 0.999529 | 4.076138 |
84cf3f1c-684b-4843-a7ec-961487989b4c | DeveshDutt2710/CP_Weekwise | 2021-05-17/18_minHeap_priorityQueue_STL.cpp | #include <iostream>
#include <queue>
typedef priority_queue<int, vector<int>, greater<int> > MINHEAP
using namespace std;
void printPriorityQueue(MINHEAP pq)
{
MINHEAP dummy = pq;
while(!dummy.empty())
{
cout<<"\t"<<dummy.top();
dummy.pop();
}
cout<<"\n";
}
int main() {
MINHE... | ALGO | 0.980742 | 3.957967 |
06b13738-6eb6-43c9-b90b-2ec9f1f184dc | Liu8018/T_puzzle-gui | patterngenerator.cpp | #include "patterngenerator.h"
PatternGenerator::PatternGenerator()
{
m_minRadius = -1;
m_maxRadius = -1;
m_n_sides = -1;
m_n_units = -1;
}
void PatternGenerator::getDstPattern(std::vector<cv::Point> &dstPattern)
{
randomizeParas();
generateDstPattern();
dstPattern.assign(m_dstPat... | TOOL | 0.958631 | 5.197644 |
11336186-1d17-4d86-8d37-c2ce88790f50 | NusantaraProject-ROM/android_frameworks_av | media/libstagefright/codecs/mp3dec/src/pvmp3_stereo_proc.cpp | /*
------------------------------------------------------------------------------
PacketVideo Corp.
MP3 Decoder Library
Filename: pvmp3_stereo_proc.cpp
Functions:
pvmp3_st_mid_side
pvmp3_st_intensity
pvmp3_stereo_proc
-------------------------------------------------------------------------... | ALGO | 0.997364 | 6.241484 |
9c2a5844-163c-4337-9c56-76146e4130ba | Ethereal-Tian/turtlebot2_mpc_local_planner | control_box_rst/src/numerics/src/finite_differences.cpp | #include <corbo-numerics/finite_differences.h>
namespace corbo {
void ForwardDifferences::computeJacobian(std::function<void(int, const double&)> inc_fun, std::function<void(Eigen::Ref<Eigen::VectorXd>)> eval_fun,
Eigen::Ref<Eigen::MatrixXd> jacobian)
{
ForwardDifferences:... | ALGO | 0.998825 | 6.717229 |
8efd2058-0f83-40a7-94ce-be3e1d793539 | shafayetejaman/CLI-projects | extractText/files/week 07/day 2/Chef_and_Battery.cpp | // https://www.codechef.com/problems/FIFTYPE
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
typede... | ALGO | 0.999643 | 4.662512 |
a9d1799f-4ee7-4bc5-b7a4-15b4362f5b35 | abdallamaher/competitive_programming | Math/Algebra/B_Duff_in_Love.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
bool go(ll x) {
return sqrt(x * 1.0) == (int)sqrt(x * 1.0);
}
bool can(ll n) {
for (ll i = 1; i * i <= n; i++) {
if (n % i == 0) {
if (i > 1 && go(i))return 0;
if (n/i > 1 && go(n / i))return 0;
}
}
... | ALGO | 0.999927 | 4.653131 |
7a1a9f36-5ade-4f3e-94e3-59af0c7c1b47 | pxmaschine/prj006-practice-bgfx | Source/ThirdParty/bgfx.cmake/bgfx/3rdparty/glsl-optimizer/src/glsl/opt_vectorize.cpp | /**
* \file opt_vectorize.cpp
*
* Combines scalar assignments of the same expression (modulo swizzle) to
* multiple channels of the same variable into a single vectorized expression
* and assignment.
*
* Many generated shaders contain scalarized code. That is, they contain
*
* r1.x = log2(v0.x);
* r1.y = log2... | ALGO | 0.985164 | 7.704506 |
6ff97cf2-6c5f-44c5-949a-a641a66fe952 | ParkYeoungJun/Algorithm | 1967_tree_jirum2.cpp | #include<iostream>
#include<cstdio>
#include<string.h>
#include<vector>
using namespace std;
vector<pair<int, int> > tree [100005];
bool check[100005];
int maxi;
int root;
void dfs(int index, int sum)
{
check[index] = true;
if(maxi < sum)
{
maxi = sum;
root = index;
}
for(int i... | ALGO | 0.999866 | 4.086939 |
78caed51-9fb4-47a1-970e-8bf7d2d9da5b | Ahmed-dark7/Abo-Hadhod-Homework-Solutions | الحلقة 39 lesson 35/the-solution-of-problem32.cpp | #include <iostream>
#include <cmath>
using namespace std;
float power()
{
float num;
short power;
cout << "please enter the value of the number and the power :\n";
cin >> num >> power;
return num = pow ( num , power );
}
int main()
{
cout << "the result is : " << power();
return 0;
} | ALGO | 0.999138 | 4.331166 |
5183c293-ebd9-4386-bae9-33c978a67bb8 | Mustafa-Hassan2001/DSA-Course | day25.cpp | #include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
void printSum(int arr[][3], int row, int col){
for(int row=0; row<3; row++){
int sum = 0;
for(int col=0; col<3; col++){
sum += arr[row][col];
}
cout<<sum<<" ";
... | ALGO | 0.999063 | 3.831742 |
7a4b4976-5649-4185-b3e0-a7b058aa89dd | Maithani-ji/CPP-DSA | 0141-linked-list-cycle/0141-linked-list-cycle.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
bool hasCycle(ListNode *head) {
// Initialize two pointers, i and j, both initially pointing to the head of the linked list.... | ALGO | 0.999899 | 5.744603 |
65cd35d2-6f5b-474e-96fd-dac7afd8a232 | tmd2018/MyOLLVM | lib/CodeGen/OptimizePHIs.cpp | #include "llvm/CodeGen/Passes.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/IR/Function.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Targ... | ALGO | 0.950986 | 7.69647 |
65779402-a729-4a24-aa47-d8770ecd383f | andrewraim/fntl | inst/tinytest/cpp/test-trunc.cpp | // [[Rcpp::depends(fntl)]]
#include "fntl.h"
// [[Rcpp::export]]
Rcpp::NumericVector d_beta_trunc(Rcpp::NumericVector x, double shape1,
double shape2, double lo, double hi, bool log = false)
{
fntl::density f = [&](double x, bool log) {
return R::dbeta(x, shape1, shape2, log);
};
fntl::cdf F = [&... | ALGO | 0.970016 | 5.973408 |
1650b842-6872-41cd-91e4-499036b9c553 | jumbojett/hiphop-php-docker | src/boost_1_50_0/libs/graph/example/boost_web_graph.cpp | template <class Distance>
class calc_distance_visitor : public boost::bfs_visitor<>
{
public:
calc_distance_visitor(Distance d) : distance(d) { }
template <class Graph>
void tree_edge(typename boost::graph_traits<Graph>::edge_descriptor e,
Graph& g)
{
typename boost::graph_traits<Graph>::v... | ALGO | 0.999497 | 4.914168 |
f37e0ad3-0103-4cea-8c2d-6b12a108bb6c | sarvex/leetcode-beef | solution/0100-0199/0158.Read N Characters Given read4 II - Call Multiple Times/Solution.cpp | /**
* The read4 API is defined in the parent class Reader4.
* int read4(char *buf4);
*/
class Solution {
public:
/**
* @param buf Destination buffer
* @param n Number of characters to read
* @return The number of actual characters read
*/
int read(char* buf, int n) {
int... | ALGO | 0.908724 | 5.672235 |
337faaa7-84bc-45d4-baa1-eb14d1118955 | kriti-002/Coding-Solutions | 1512-number-of-good-pairs/1512-number-of-good-pairs.cpp | class Solution {
public:
int numIdenticalPairs(vector<int>& nums) {
int count=0;
unordered_map<int, int>m;
for(int i=0; i<nums.size(); i++){
m[nums[i]]++;
count+=(m[nums[i]]-1);
}
return count;
}
}; | ALGO | 0.999983 | 6.027271 |
424c1e88-69bc-4eb4-b973-f2ebaded4ae4 | AngadSingh04/DSA-Leetcode | 2685.cpp | class Solution {
public:
vector<int> parent, rank;
int countCompleteComponents(int n, vector<vector<int>>& edges) {
parent.resize(n);
rank.resize(n, 1);
for (int i = 0; i < n; i++) {
parent[i] = i;
}
for (auto& edge : edges)... | ALGO | 0.999888 | 5.644597 |
75c9f269-0bc8-43c2-b579-52e21d8d5db0 | sijan2006/csit | csit/C++/lab3/program1.cpp | // wap to fins the are of triangle, rectangle, sqare and circle by overloading the area function
#include <iostream>
using namespace std;
float area(float l, float b);
float area(float r);
int area(int l, int b);
int area(int l);
int main()
{
int l, b, r;
cout << "enter length breadth for the shapes and radius ... | ALGO | 0.995866 | 3.51615 |
100cff1f-424f-4522-b66f-f5d86c5fb637 | preethiboga/cpp | recursion npowerp.cpp | #include<bits/stdc++.h>
using namespace std;
int npowerp(int n,int p);
int main()
{
int n,p;
cout<<"Enter n,p:";
cin>>n>>p;
cout<<npowerp(n,p)<<endl;
}
int npowerp(int n,int p)
{
if(p==0)
return 1;
else
return n*npowerp(n,p-1);
} | ALGO | 0.999934 | 4.502806 |
f1d5c650-037d-4f71-8f52-46fad66e4997 | ishandutta2007/codeforces | xlk/normal/1462/A.cpp | #include <bits/stdc++.h>
using namespace std;
int t, n;
int a[320];
int main()
{
cin >> t;
for (int tt = 0; tt < t; tt++)
{
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
for (int i = 0, j = n; i < j;)
{
cout << a[i++] << " ";
if (i < j)
{
cout << a[--j] << " ";
}
}
cou... | ALGO | 0.999378 | 3.318868 |
50b26bd7-fd26-4fcf-b482-624b7e7e4239 | 731676158/Octree | 3rdparty/pcl_for_ubuntu/ml/src/densecrf.cpp | #include <pcl/ml/densecrf.h>
pcl::DenseCrf::DenseCrf(int N, int m)
: N_(N), M_(m), xyz_(false), rgb_(false), normal_(false)
{
current_.resize(N_ * M_, 0.0f);
next_.resize(N_ * M_, 0.0f);
tmp_.resize(2 * N_ * M_, 0.0f);
}
pcl::DenseCrf::~DenseCrf()
{
for (auto& p : pairwise_potential_)
delete p;
}
void
pc... | ALGO | 0.996577 | 6.914659 |
58acad97-301c-41dc-9755-fc099a90932b | xqdd/learning-base-data-structures-and-algorithms | src/chapter06/main.cpp | #include <iostream>
#include <valarray>
#include <bitset>
#include "../utils/main.cpp"
#include "genBST.h"
#include "printableTree.h"
#include "genThreaded.h"
using namespace std;
int main() {
init();
BST<int> bst;
bst.insert(6);
bst.insert(8);
bst.insert(7);
bst.insert(3);
bst.insert(1);... | ALGO | 0.994145 | 4.569791 |
ea64912e-b04b-43a3-882e-2ab6f7eaa90e | Ruthvik283/CS-254-Design-and-Analysis-of-Algorithms-Lab | Assignment 2/qn3/3.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
void inplace_merge(ll *a,ll start,ll end,ll m){
// using the same code of qn2.cpp and creating a void function
ll i=start,j=start+m;
while(j<=end){
if(i<j){
... | ALGO | 0.999788 | 4.230261 |
016c6f42-5fe9-4feb-a451-640b9ce0fe12 | gabriel-salmoria/competitive-programming | material/number_theory/euclid.cpp | // ufsc - sc - br
#include <bits/stdc++.h>
// hehe got em
#define Linux ios::sync_with_stdio(false);
#define MaiorQue cin.tie(nullptr);
#define Windows cout.tie(nullptr);
using namespace std;
#define int long long
int gcd(int a, int b) {
while (b) {
a %= b;
swap(a, b);
}
return a;... | ALGO | 0.999832 | 3.937162 |
cf0c97be-8ba9-4556-abd1-43b2c8fe7b04 | anushkaGurjar99/Data-Structure-and-Algorithms | Interviewbit/Strings/Stringoholics.cpp | /*
* Author : Anushka Gurjar
* Date : April 2020
* flags : -std=c++14
*/
#include<bits/stdc++.h>
using namespace std;
// Problem Statement: https://www.interviewbit.com/problems/stringoholics/
// Time Limit Exceed for last testcase
bool rotateAllStrings(vector<string> &A, vector<string> original, int& rotati... | ALGO | 0.999929 | 5.270323 |
fcf40e32-6549-4157-9b06-b5a98af82a73 | GPGPUSIM-SIMPLESSD/GPGPUSIM | src/intersim2/allocators/wavefront.cpp | // $Id: wavefront.cpp 5262 2012-09-20 23:39:40Z dub $
/*wavefront.cpp
*
*The wave front allocator
*
*/
#include "booksim.hpp"
#include "wavefront.hpp"
Wavefront::Wavefront( Module *parent, const string& name,
int inputs, int outputs, bool skip_diags ) :
DenseAllocator( parent, name, inputs, outputs ),
... | ALGO | 0.998796 | 5.688654 |
681c417e-80fd-433b-b65e-f96c964f61bd | ishandutta2007/codeforces | w4yneb0t/normal/380/C.cpp | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<cassert>
#define PB push_back
#define sz(v) ((v).size())
#define forn(i,n) for(in i=0;i<(n);i++)
#define forv(i,v) forn(i,sz(v))
using namespace std;
typedef long long in;
in n,m;
string s;
vector<int> tps[10000... | ALGO | 0.999754 | 3.23298 |
b7785695-70b9-45e5-8dc6-1da42a7ac872 | xuyanxun1201/2021c2 | week09-6.cpp | #include <stdio.h>
#include <string.h>
char strA[]="XYZ";
char strB[]="ABC";
int main(){
int c =strcmp("X","A");
printf("X-A±o¨ì %d\n",c);
c =strcmp(strA,strB);
printf("%s %s±o¨ì %d\n",strA,strB,c);
c =strcmp(strB,strA);
printf("%s %s±o¨ì %d\n",strB,strA,c);
}
| ALGO | 0.999827 | 3.209311 |
bf709e5f-77a3-47c4-a45b-3b8ff09a9297 | FengISU/DEM_project | src/fix_heat_gran_conduction.cpp | #include "fix_heat_gran_conduction.h"
#include "atom.h"
#include "compute_pair_gran_local.h"
#include "fix_property_atom.h"
#include "fix_property_global.h"
#include "force.h"
#include "math_extra.h"
#include "math_extra_liggghts.h"
#include "properties.h"
#include "modify.h"
#include "neigh_list.h"
#include "pair_gra... | ALGO | 0.991387 | 5.702526 |
3e881a4f-542d-418e-8756-1c9f13bda133 | mukeshmjn/LeetCode-Problems | 64-minimum-path-sum/64-minimum-path-sum.cpp | class Solution {
public:
int minPathSum(vector<vector<int>>& grid) {
int r = grid.size();
int c = grid[0].size();
vector <vector <int>> dp(r, vector <int>(c, 0));
dp[0][0] = grid[0][0];
for (int i = 1; i < c; i++) {
dp[0][i] = grid[0][i] + dp[0][i - ... | ALGO | 0.999939 | 5.956035 |
49c8bab4-d2da-4a83-9dd8-77e32ed7877c | MaksS7/Qt_bis | Qt_bis/rsa.cpp | /*Версия от 25.05.2020*/
#include "rsa.h"
#include <iostream>
#include <vector>
#include <iomanip>
#include <cmath>
#include <climits>
#include <stack>
#include <random>
#include <fstream>
using namespace std;
int64_t gcd(int64_t a, int64_t b) {
int64_t t;
while(1) {
t = a % b;
if(t == 0) {
... | ALGO | 0.998071 | 3.557346 |
f277e18d-9c66-4fd0-a316-bfde1c6e9a30 | lcsrd/ALGORITMOS-CONDICIONAIS | 12.cpp | #include <stdio.h>
#include <locale.h>
int main(){
setlocale(LC_ALL, "portuguese");
float n1,n2,n3,me,ma;
printf("Informe a primeira nota:");
scanf("%f", &n1);
printf("\nInforme a segunda nota:");
scanf("%f", &n2);
printf("\nInforme a terceira nota:");
scanf("%f", &n3);
me = (... | TOOL | 0.995242 | 3.760273 |
55d94b88-083f-46fb-8979-4dd3ddce0c98 | ckf42/leetcode-code | sol/3152/3152.cpp | struct Solution {
vector<bool> isArraySpecial(vector<int>& nums, vector<vector<int>>& queries) {
int n = nums.size();
vector<int> badCount(n, 0);
for (int i = 0; i < n - 1; ++i){
badCount[i + 1] = badCount[i] + 1 - ((nums[i] ^ nums[i + 1]) & 1);
}
int q = queries.... | ALGO | 0.999458 | 5.622446 |
e2f375c6-7bed-4ef1-851f-983d16517f55 | OneCodeMonkey/Algorithm | leetcode_solved/leetcode_1177_Can_Make_Palindrome_from_Substring.cpp | // AC: Runtime: 1004 ms, faster than 15.77% of C++ online submissions for Can Make Palindrome from Substring.
// Memory Usage: 194.8 MB, less than 16.15% of C++ online submissions for Can Make Palindrome from Substring.
// .
// T:O(m + n), S:(m), m = s.length(), n = queries.length
//
class Solution {
public:
vecto... | ALGO | 0.999936 | 5.567489 |
c8da3a54-818e-4d48-92d7-3f5c40e078d2 | aryantomar16/2141020023 | CAPSTONE/2141020023_LSP_CAPSTONE_ASSIGNMENT-3/task3.cpp | #include <iostream>
#include <filesystem>
#include <fstream>
#include <sstream>
#include <algorithm>
#include <vector>
#include <dirent.h>
#include <unistd.h>
#include <csignal>
using namespace std;
namespace fs=std::filesystem;
struct ProcessInfo{
int pid;
string name;
double cpuUsage;
long memoryUsage;
};
string ... | TOOL | 0.976701 | 3.950744 |
677047d7-5665-41b3-934d-2c944766e82f | ahmedmamdouh886/codeforces-solutions | lucky_numbers.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
int n, k, count(0);
cin >> n >> k;
string s;
while (n--)
{
int lucky(0);
cin >> s;
// Unsigned integral type --> Alias of one of the fundamental unsigned integer types.
for (size_t i = 0; i < s... | ALGO | 0.999012 | 4.46722 |
1d215a9c-5854-40e6-bd24-da89251a6e07 | ukmaurya/GFG | Difficulty: Medium/Max Sum without Adjacents 2/max-sum-without-adjacents-2.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 {
int solve(vector<int> &arr,int i,int cnt,vector<vector<int>> &dp){
if(i>=arr.size())
return 0;
if(dp[i][cnt]!=-1... | ALGO | 0.999604 | 6.186022 |
720d675d-ed6c-4629-b638-d132ad23596f | Shapooo/leetcode | 1839.所有元音按顺序排布的最长子字符串.cpp | #include <string>
using namespace std;
/*
* @lc app=leetcode.cn id=1839 lang=cpp
*
* [1839] 所有元音按顺序排布的最长子字符串
*/
// @lc code=start
class Solution {
public:
int longestBeautifulSubstring(string word)
{
}
};
// @lc code=end
| ALGO | 0.999163 | 6.083195 |
229a9373-b29f-4b6c-898a-30f597101dff | cricklet/wasm-quake3-renderer | src/cpp/hitscan.cpp | #include "hitscan.h"
#include "bsp.h"
static optional<float> distanceToTriangle(
const glm::vec3& location,
const glm::vec3& direction,
const glm::vec3& vertex0,
const glm::vec3& vertex1,
const glm::vec3& vertex2
) {
// Thank you: https://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algo... | ALGO | 0.999158 | 6.32906 |
799dfef9-5232-4514-9c8d-c3d4f3cc3eb0 | 25pratiksha/Algo_Lab | 4e.cpp | #include<bits/stdc++.h>
using namespace std;
#define SIZE 205
using namespace std;
struct node
{
int x, y, dist,hop;
void set(int x, int y, int dist,int hop)
{
this->x = x;
this->y = y;
this->dist = dist;
this->hop=hop;
}
}src,dest;
struct node countrr[3];
int m,n;
bool maze[SIZE][SIZE];
bool visi... | ALGO | 0.999657 | 3.245481 |
58aa2a99-5d3c-4e8d-8d26-0363dbfad209 | Viganesh1/HW1- | Problem7/Problem7/Problem7.cpp | #include <iostream>
#include <vector>
#include <numeric>
using namespace std;
//function gradient weights
double gradient_weights(double delta, vector<double>& w, const vector<double>& x, double y) {
vector<double> dw(w.size(), 0.0);
for (int i = 0; i < w.size(); i++) {
dw[i] = (2 * delta * (w[i] * x[... | ALGO | 0.999598 | 4.003818 |
dd768d7f-7bb6-4de0-84eb-b9a8f16a2e10 | Jashimjnn/CppProject | phitron1.cpp/Algorithm/DFS/practise10.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define Y cout << "YES" << endl;
#define N cout << "NO" << endl;
const int X = 20;
int mat[X][X];
int vis[X][X];
int dx[4] = {0, 0, -1, 1};
int dy[4] = {1, -1, 0, 0};
int n, m;
bool valid(int x, int y)
{
return !vis[x][y] &... | ALGO | 0.999948 | 4.814029 |
292d9495-b680-4727-9823-1c5cf8db43cf | ndh140305/LTNC | BT02/C-2-3-4.cpp | #include <bits/stdc++.h>
using namespace std;
void triangle_2 (int n){
for (int i=1 ; i<=n ; ++i){
for (int j=1 ; j<i ; ++j){
cout << " ";
}
for (int j=i ; j<=n ; ++j){
cout << "*";
}
cout << endl;
}
}
void triangle_3 (int n){
for (int i=1 ; ... | ALGO | 0.99981 | 3.277476 |
4c36db05-f9ac-4a10-b088-b5172539d8e0 | thangitus/LeetCode-Solution | C++/Sliding Window/Minimum Size Subarray Sum.cpp | #include <bits/stdc++.h>
using namespace std;
/**
* https://leetcode.com/problems/minimum-size-subarray-sum/
* */
class Solution {
public:
int minSubArrayLen(int target, vector<int> &nums) {
int result = INT_MAX, curSum = 0, left = 0;
for (int right = 0; right < nums.size(); right++) {
... | ALGO | 0.999969 | 6.474841 |
7156d62f-a078-40ff-8827-f8da9f2c2a92 | NishantUdupa/Dungeon-Crawler-Game | tests.cpp | #include <iostream>
#include "logic.h"
using std::cout, std::endl;
// TODO(student): Write unit tests for the functions in logic.h
// You should end up with at least 500 lines of test code
int main() {
// example
/*
example.txt
-----------
5 3
3 0
M + -
- + -
-... | ALGO | 0.893059 | 4.426711 |
c65fef67-71a7-400c-8a0a-74a664258e55 | helenzhangyc/advent-of-code-2022 | Day 10 Cathode-Ray Tube/d10p2.cpp | #include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
vector<string> split_str(string s)
{
vector<string> retval;
stringstream ss(s);
string word;
while (ss >> word)
{
retval.push_back(word);
}
return retval;
}
int ... | ALGO | 0.999631 | 5.045767 |
2a23d30c-98d3-4f92-8d28-60945d0a41e4 | theoden42/code-store | codeforces/Codeforces Round 923 (Div. 3)/B.cpp |
/* author: (g)theoden42 */
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define all(a) a.begin(), a.end()
#ifdef ON_PC
#include <debug.h>
#else
#define debug(x...)
#endif
template<typename T>
using o... | ALGO | 0.99987 | 4.638351 |
3f07baed-3949-4f15-bef1-60100ae94a23 | ishandutta2007/codeforces | leaf1415/normal/1611/G.cpp | #include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <cassert>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <algorithm>
#include <utility>
... | ALGO | 0.999579 | 4.127244 |
0da8d245-f7f5-4861-b08c-9b433279b6bf | B21DCCN712/C_plus_Ptit | UngDungSapXep/BoSungPhanTu.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
sort(a,a+n);
int m=a[n-1]-a[0]+1;
set<int> s;
for(int i=0;i<n;i++){
s.insert(a[i]);
}
cout<<m-s.size()<<endl;
}
}
| ALGO | 0.999247 | 3.918329 |
f6248a42-68c3-444a-b40a-ee654159f65a | payce06/cPlusPlus---Notes | pointer.cpp | #include <iostream>
using namespace std;
// p is a pointer to an int and stores the memory address of a.
// *p (dereferencing) gives the value at the address stored in p.
int main() {
int a = 10; // Normal integer variable
int* p = &a; // p is a pointer to an integer a.
cout << "Value of a: " << ... | TOOL | 0.858442 | 4.455674 |
3eb561e4-867e-4b00-9664-aea95176d867 | imxinlei/leetcode | 260_Single_Number_III.cpp | /*
* https://leetcode.com/problems/single-number-iii/description/
*
* Find the two elements that appear only once.
*
* For example:
*
* Given nums = [1, 2, 1, 3, 2, 5], return [3, 5].
*
* Note:
* The order of the result is not important. So in the above example, [5, 3] is also correct.
* Your algorithm shoul... | ALGO | 0.999915 | 5.796146 |
6947388c-707f-4a0d-b4e0-8a6b56091ef7 | Nexonous/Peregrine | src/systems/OutputSystem.cpp | #include "OutputSystem.hpp"
#include "InputSystem.hpp"
#include "Stabilizer.hpp"
#include "core/Common.hpp"
#include "core/Constants.hpp"
#include "core/GlobalState.hpp"
#include "core/Logging.hpp"
constexpr auto g_RotorMinPWM = 1000;
constexpr auto g_RotorMaxPWM = 2000;
constexpr auto g_ServoMinimum = 0;
constexpr... | TOOL | 0.885825 | 6.866067 |
71685227-d020-4d35-8d5e-ce03f91e7a04 | shiny02/CIDR-cpp | scPCA.cpp | // helper inline code to calculate individual dissimilarity entries - given
// particular count and truth "column" vectors
#include "scPCA.hpp"
namespace scPCA {
template <typename InputIterator1, typename InputIterator2, typename InputIterator3, typename InputIterator4>
inline double
my_accumulate(InputIterator1 ... | ALGO | 0.998771 | 6.968693 |
bb137010-cf27-4d11-8b67-c41d2db0ae65 | bitcoinbam/btcbam | src/versionbits.cpp | #include <versionbits.h>
#include <consensus/params.h>
const struct VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_BITS_DEPLOYMENTS] = {
{
/*.name =*/ "testdummy",
/*.gbt_force =*/ true,
},
{
/*.name =*/ "csv",
/*.gbt_force =*/ true,
},
{
/... | ALGO | 0.994021 | 7.673152 |
b7e89b25-28db-4b73-a9b0-0fdea05a3a0c | imicola/Questions-and-Impressions | main/codeforces/Codeforces Round 1006 (Div. 3)/C_Creating_Keys_for_StORages_Has_Become_My_Main_Skill.cpp | //#pragma GCC optimize(3)
#include <bits/stdc++.h>
#define int LL
#define endl '\n'
#define size_t int
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long LL;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<string> vstr;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
vo... | ALGO | 0.999928 | 4.306126 |
171ceb29-e6f5-478c-8e34-b3e5f314bcd0 | pranavsindura/CompetitiveProgramming | codeforces/contest/1417/d.cpp | #include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define pi pair<int,int>
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define sz(x) ((int)x.size())
#define ln(x) ((int)x.length())
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define ff first
#define s... | ALGO | 0.998476 | 3.42932 |
f9a0548e-7d2c-4a3a-a6bf-19d14ce7f985 | ishandutta2007/codeforces | batman/normal/494/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define ld long double
#define ll long long
#define N ((ll)101*1000)
#define K ((ll)22)
#define MOD ((ll)1e9+7)
ll n,q,dp_down[2][N],dp_up[2][N],dis[N],dis_w[N],par[K][N],sz[N];
vector <pair<ll,ll> > e[N];
void dfs_down(ll x)
{
sz[x]=1;
for(int i=1;i<K;i++)par[i][x]=par... | ALGO | 0.999965 | 4.251551 |
bf2fd7b5-1ab5-4379-92d3-a058d942dec0 | yi-ning-le/NOIP | 地杰斯特拉.cpp | #include <iostream>
#include <stack>
#include <windows.h>
#include <cstring>
#include <cstdio>
using namespace std;
const int N = 100;
const int INF = le7;
int map[N][N],dist[N],p[N],n,m;
bool flag[N];
void Dijkstra(int u)
{
for (int i = 1; i <= n; ++i)
{
dist[i] = map[u][i];
flag[i] = false;
if (dist[i] == ... | ALGO | 0.999946 | 3.292743 |
22f54e02-008b-4420-9490-ae0b1c92b525 | maria-ilinca/SD | hash_table.cpp | /*Fie o multime de numere naturale initial vida. Asupra acestei multimi se efectueaza operatii de urmatoarele tipuri:
operatia de tipul 1: se adauga elementul x la multime (unde x este un parametru al operatiei). Daca x este deja in multime, atunci aceasta ramane neschimbata.
operatia de tipul 2: se sterge elementul x... | ALGO | 0.999493 | 4.531737 |
952c9a80-6365-473f-bd25-2ec06a65e550 | pratyaksh1001/c-- | c++/linked list 10.cpp | //failed attempt to merge two sorted linked list
#include <iostream>
#include <chrono>
using namespace std;
auto start = chrono::steady_clock::now();
class node{
public:
int data;
node* next;
node(int d){
this->data=d;
this->next=NULL;
}
int attail(node* tail){
this->nex... | ALGO | 0.999904 | 5.092247 |
c49f2db3-5160-438b-aa92-86dc4c081d8a | Amanthink/practices | 2469. Convert the Temperature.cpp | class Solution {
public:
vector<double> convertTemperature(double c) {
vector<double> ans(2);
ans[0]=c+273.15;
ans[1]=c*1.80+32.00;
return ans;
}
};
| ALGO | 0.997986 | 5.558074 |
c18d1daf-55fb-4e4b-90a4-63da069ed651 | ishandutta2007/codeforces | johnkram/normal/1726/C.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define MAXN 200005
int t,n,m,i,s[MAXN],top,ne[MAXN];
char c[MAXN];
int work(int l,int r)
{
if(l>r)return 0;
int i,s=1;
for(i=l;i<=r;i=ne[i]+1)s+=work(i+1,ne[i]-1);
return s;
}
int main()
{
scanf("%d",&t);
while(t--)
{
scanf("%d%s",&n,c+1);
to... | ALGO | 0.999483 | 3.543271 |
b743c0b6-4769-4e05-9762-7a9265b1ac61 | aburussel87/DSA-1 | 13 Normal_sorting/selection.cpp | #include <iostream>
#include <vector>
using namespace std;
void selectionSort(vector<int>& arr) {
int n = arr.size();
for (int i = 0; i < n - 1; ++i) {
int min_idx = i;
for (int j = i + 1; j < n; ++j)
if (arr[j] < arr[min_idx])
min_idx = j;
swap(arr[i], arr[m... | ALGO | 0.999869 | 5.293567 |
44bc1697-85a3-4a1e-b74e-c09095b34106 | ManaliSharma/Autonomous_Vehicle | sdc_gym/box2d-py-2.3.8/Box2D/Collision/b2TimeOfImpact.cpp | #include <Box2D/Collision/b2Collision.h>
#include <Box2D/Collision/b2Distance.h>
#include <Box2D/Collision/b2TimeOfImpact.h>
#include <Box2D/Collision/Shapes/b2CircleShape.h>
#include <Box2D/Collision/Shapes/b2PolygonShape.h>
#include <Box2D/Common/b2Timer.h>
#include <cstdio>
using namespace std;
float32 b2_toiTime,... | ALGO | 0.999591 | 6.382549 |
9cb99c92-0939-46e1-9f14-87ecef435d3c | axrdiv/CSES_Problem_Set | 04_Graph_Algorithms/Investigation/Invistigation.cpp | #include<iostream>
#include<vector>
#include<queue>
using namespace std;
const int maxn = 1e5 + 5;
const long long INF = 1e18;
const int MOD = 1e9 + 7;
int n, m;
bool vis[maxn];
long long dis[maxn][4];
vector<pair<int, int> > G[maxn];
void bellman() {
for(int i = 1; i <= n; i++)
dis[i][0] = INF;
di... | ALGO | 0.999979 | 4.178221 |
0bc551c1-8b8e-4026-af5f-61eef3eed020 | anjali0508/ADABMSCE | Knapsack.cpp | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int n;
cout<<"Enter no of items";
cin>>n;
int w;
cout<<"Enter capacity";
cin>>w;
int val[n], wt[n];
cout<<"Enter "<<n<<" values";
for(int i=0;i<n;i++)
cin>>val[i];
for(int i=0;i<n;i++)
cin>>wt[i];
int table[n+1][w+1] = {0};
for(int ... | ALGO | 0.999992 | 3.707555 |
b94d394c-f6d0-4949-a8d5-d70be516077b | ishandutta2007/codeforces | dlalswp25/normal/1148/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
int A[303030];
int P[303030];
int N;
vector<pii> V;
void f(int a, int b) {
V.push_back({a, b});
swap(P[A[a]], P[A[b]]);
swap(A[a], A[b]);
}
int main() {
scanf("%d", &N);
for(int i = 1; i <= N; i++) {
scanf("%d", &A[i]);
P[A[i]] = i;
... | ALGO | 0.99984 | 3.371877 |
ea5ed633-444d-493e-be4a-468b0b553f29 | kasparschlegel/lifev-em | lifev/electrophysiology/solver/IonicModels/IonicFitzHughNagumo.cpp | //@HEADER
//@HEADER
/*!
@file
@brief Ionic model of FitzHugh-Nagumo
@date 01-2013
@author Giacomo Rosilho de Souza <<EMAIL>>
@contributors
@mantainer Giacomo Rosilho de Souza <<EMAIL>>
@last update 01-2013
*/
#include <lifev/electrophysiology/solver/IonicModels/IonicFitzHughNagumo.hpp>
namespace Lif... | ALGO | 0.993757 | 5.879901 |
a50a8d51-3d01-44a5-953e-85467712b20f | praveenreddychalamalla/Problem-Solving | CPP/Backtracking/n_queens.cpp | /**
* @author Praveen Reddy Chalamalla
* @create date 2021-06-01 19:47:53
* @desc N Queens - Backtracking
*/
#include <bits/stdc++.h>
using namespace std;
int board[15]={0};
vector<vector<int>>v;
bool isSafe(int k, int col){
//Check all the rows from [1,k) if any queen is placed in the same column 'col' or if t... | ALGO | 0.998975 | 5.676373 |
9bf582c1-ec68-499b-a597-2431a1d9705c | kamukwededothy/math-problems | src/37.cpp | #include <iostream>
using namespace std;
int main() {
int x = 5;
int y = 3;
int sum = x + y;
cout << "The sum of " << x << " and " << y << " is: " << sum << endl;
return 0;
}
| TOOL | 0.963777 | 4.440142 |
3546b43c-8602-4134-a72d-e8de3a2574f6 | priyanshusharma80/CPQuestions | 2.14_BalancedArray.cpp | #include <iostream>
using namespace std;
void solve() {
int n;
cin>>n;
int temp = n/2;
if(temp%2){
cout<<"NO"<<endl;
return;
}
cout<<"YES"<<endl;
int sum1 = 0,sum2=0;
for(int i=1;i<=n/2;i++) cout<<(2*i)<<" ",sum1+=2*i;
for(int i=1;i<=n/2-1;i++) cout<<(2*i-1)... | ALGO | 0.999533 | 4.770673 |
04dae796-1694-4e54-a829-77a1f6075685 | sudipto0315/MyPrograms | Assignments/sem3_Assignment/assignment_8/q3a.cpp | #include <iostream>
#include <vector>
#include <stack>
using namespace std;
void addEdge(vector<vector<int>> &adj, int u, int v)
{
adj[u].push_back(v);
adj[v].push_back(u);
}
void DFS(const vector<vector<int>> &adj, vector<bool> &visited, int v)
{
visited[v] = true;
for (int neighbor : adj[v])
{
... | ALGO | 0.999923 | 6.684935 |
e9b7597a-309a-4ea1-bb0f-0a9df0153a6b | k99812/Cpp | 인프런 강의/2-N 9012/2-N 9012/9012.cpp | #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
vector<char> ret;
string s;
int n;
bool is_vps;
int main() {
cin >> n;
for (int i = 0; i < n; i++) {
cin >> s;
ret.clear(); is_vps = false;
for (int j = 0; j < s.length(); j++) {
if (ret.size()) {
if (s[j] ... | ALGO | 0.999704 | 4.139369 |
4e9d7019-90ec-4a24-adba-6a011d4c1c83 | yuvraj653/semester-1-assingment | 8. C program to swap two numbers using 3rd variable and without 3rd variable.cpp | #include <stdio.h>
int main() {
int a, b, temp;
printf("Enter two numbers: ");
scanf("%d%d", &a, &b);
printf("Before swapping: a = %d, b = %d\n", a, b);
// Swap using a third variable
temp = a;
a = b;
b = temp;
printf("After swapping: a = %d, b = %d\n", a, b);
return 0;
}
| ALGO | 0.999373 | 4.853001 |
3f14c9c1-b61b-478e-8e8b-7900189e7909 | DhruvPandey1509/Vscode-Program-Folders | Problem-Solutions/Lngst_substr_without_rpt_char.cpp | #include"bits/stdc++.h"
using namespace std;
class Solution {
public:
int lengthOfLongestSubstring(string s) {
if(s.size() <= 1)
{
return s.size();
}
int start = -1, end = 0, maxlen = 0;
vector<int> dict(256,-1);
for(int end = 0 ;... | ALGO | 0.999941 | 5.277321 |
709b6edd-a381-47d9-86e3-31d2a5f5710f | Chowdhury-DSP/ChowMultiTool | src/dsp/BandSplitter/BandSplitterProcessor.cpp | #include "BandSplitterProcessor.h"
namespace dsp::band_splitter
{
BandSplitterProcessor::BandSplitterProcessor (const Params& bandSplitParams, const ExtraState& extraState)
: params (bandSplitParams),
extraState (extraState),
analyzerTasks ({
{ SpectrumBandID::Low, &lowSpectrumAnalyserTask },... | TOOL | 0.869509 | 6.640089 |
e815e2d2-d224-4a91-bafd-e9ce1ab5c153 | lucaophp/uri | 3301.cpp | #include <stdio.h>
int main() {
unsigned short int h, z, l;
scanf("%hu %hu %hu", &h, &z, &l);
if ((z > h && h > l) || (z < h && h < l))
printf("huguinho");
else if ((h > z && z > l) || (h < z && z < l))
printf("zezinho");
else
printf("luisinho");
printf("... | ALGO | 0.999484 | 3.250051 |
f61174ee-2919-4ff1-a066-f5b5d7450e6f | Troll338cz/source-sdk-2013-hl1dm | mp/src/mathlib/vmatrix.cpp | #if !defined(_STATIC_LINKED) || defined(_SHARED_LIB)
#include "basetypes.h"
#include "mathlib/vmatrix.h"
#include "mathlib/mathlib.h"
#include <string.h>
#include "mathlib/vector4d.h"
#include "tier0/dbg.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
#pragma warning (disab... | ALGO | 0.973522 | 6.892869 |
cede81d5-600f-42b3-8c51-88168c316bf4 | SI-Abid/Hello-world | Codeforces/1627a.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n,m,r,c, b=0;
cin>>n>>m>>r>>c;
bool row[n],col[m];
char mat[n][m];
memset(row,0,sizeof(row));
memset(col,0,sizeof(col));
for(int i=0;i<n;i++)
{
... | ALGO | 0.99751 | 3.651514 |
9d205383-fbb6-4665-a76f-fa982ff7699e | singh-chandan123/DSA-with-C-plus-plus | DSA C++/Dynamic Programming question/Longest Common Subsequence.cpp | #include <bits/stdc++.h>
int solve(string &st1,string &st2,int i,int j,vector<vector<int>>&dp){
//base case
if(i==st1.length()){
return 0;
}
if(j==st2.length()){
return 0;
}
if(dp[i][j]!=-1){
return dp[i][j];
}
int ans=0;
if(st1[i]==st2[j]){
ans= 1+solve(st1,st2,i+1,j+1,dp);
}
else{
ans=max(ans,max(solve(st1... | ALGO | 0.999984 | 5.532687 |
6842cd1e-0854-4b8b-a244-3edf61ef6a46 | frostAdarsh/CrackYourInternship | Flattening a Linked List.cpp |
#include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
struct Node *next;
struct Node *bottom;
Node(int x) {
data = x;
next = NULL;
bottom = NULL;
}
};
void printList(Node *Node) {
while (Node != NULL) {
printf("%d ", Node->data);
Node =... | ALGO | 0.999919 | 4.413352 |
e50c1fe7-fdf4-4fb5-9dc9-53a125e68cae | sarthakbadgujar2/Competitive-Programming-Solutions | CSES/8_Two_Sets.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll n;
cin >> n;
ll sum = 0;
vector<ll> whole;
vector<ll> v1;
vector<ll> v2;
for(ll i=1;i<=n;i++)
{
whole.push_back(i);
sum += i;
}
... | ALGO | 0.999929 | 3.644919 |
8ff238b3-5fe4-45d7-a640-50809a884a82 | gc2321/Coursera_Algorithmic_Toolbox | week3/problem5/main.cpp | #include <iostream>
#include <vector>
using std::vector;
vector<int> optimal_summands(int n) {
vector<int> summands;
int sum = n;
int i = 1;
while (sum > 0){
if ((sum-i) >= 0){
sum -= i;
summands.push_back(i);
}else{
break;
}
i +=1;
}
if (sum !=0){
summands[summan... | ALGO | 0.999922 | 5.185692 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.