uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
c37fc586-3d80-4b13-b31d-0ca677245521 | bl000m/CPP-Modules-42 | module_09/ex02/PMergeMe.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* PMergeMe.cpp :+: :+: :+: ... | ALGO | 0.999109 | 5.369033 |
e459810f-9530-4914-a176-0f6410f6b447 | ishandutta2007/codeforces | cchao/normal/710/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
#define REP(i, n) for (int i = 0; i < int(n); ++i)
#define REPE(i, a, b) for (int i = (a); i <= int(b); ++i)
#define F first
#define S second
int main() {
int n;
cin >> n;
vector<int> a(n);
for (int &x : a)
ci... | ALGO | 0.999868 | 4.176694 |
a2870ee3-132b-4f3d-ba54-8e0ac13d41f9 | HwangHyeonseok/DalmutiGame | DalmutiGame/DalmutiGame/[Logic]cardDistribute.cpp | // ī й
// ÷̾鿡 ī带 йش.
// NumPlayers : ÷̾
// playerCards : ÷̾ ִ ī 迭
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#define NUM_CARDS 80 // ī 80
#pragma region distributeCards Լ : ī й
void distributeCards(int NumPlayers, int playerCards[4][20]) {
int num_cards_per_player = NUM_CARDS / NumPlayers;... | ALGO | 0.954216 | 3.480577 |
6e88ab23-f3e7-4d7e-b292-2e42943709d2 | StoicGang/Problem_Solving | 0_HackerEarth/binary_search.cpp |
/**
Binary Search Implementation
Problem:
Search for a given key in a sorted array using binary search algorithm
Input:
- First line: N (size of array)
- Second line: N space separated integers (array elements)
- Third line: Q (number of queries)
- Next Q lines: Each contains a key to search
Output:
- For... | ALGO | 0.99996 | 5.338038 |
f3522417-bd6e-4f91-bf74-10344779cf1e | hekoh99/daily_leetcode | problems/2181-merge-nodes-in-between-zeros/2181-merge-nodes-in-between-zeros.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 {
public:
ListNode* mergeNodes(... | ALGO | 0.999912 | 5.357731 |
602844c7-69c7-4b25-889e-1766a1326a24 | ljw020711/Problem_Solving | DP/1932.cpp | #include <iostream>
using namespace std;
int height;
long long D[505][505];
int tri[505][505];
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cin >> height;
for(int i = 0; i < height; i++)
{
for(int j = 0; j <= i; j++)
{
cin >> tri[i][j];
}
}
D[0][0] = tri[0][0];
for(int i = 1; ... | ALGO | 0.99996 | 3.86632 |
5d772e3f-55bf-46c3-b90b-b4273ad08abb | hasib-24/DSA | SortingRelatedProblem/Vayna and lanterns.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, l;
cin >> n >> l;
vector<int> v(n);
for (int i = 0; i < n; i++) {
cin >> v[i];
}
sort(v.begin(), v.end());
double dis = 0;
for (int i = 1; i < n; i++) {
dis = max(dis, double(v[i] - v[i - 1]));
}... | ALGO | 0.999893 | 3.453827 |
d345734b-f45c-47e4-9e80-2463d70aab2e | Runarok/LeetSolutions | Solutions/2998-count-symmetric-integers/count-symmetric-integers.cpp | class Solution {
public:
int countSymmetricIntegers(int low, int high) {
int count = 0; // This will store the number of symmetric integers
// Iterate through all numbers from low to high
for (int num = low; num <= high; ++num) {
int temp = num;
int digits = 0;
... | ALGO | 0.999987 | 7.0507 |
3c76851f-5189-4fb4-b7ea-174622c784c2 | ishandutta2007/codeforces | summitwei/normal/1103/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<pair<int, int> > vpii;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<ll, ll> pll;
#define INF 1000000000
#define MOD 1000000007
#define EPSILON 0.00001
#define f first
#define s second
#define pb push_back
#define mp m... | ALGO | 0.999869 | 3.072575 |
3db89e0d-23b4-4325-9875-38ea0cf9fc20 | GyeongHoKim/algorithm | docs/STL/numericAlgorithms/partialSum.cpp | #include <iostream>
#include <vector>
#include <numeric>
using namespace std;
int main()
{
vector<int> v1;
v1.push_back(10);
v1.push_back(20);
v1.push_back(30);
v1.push_back(40);
v1.push_back(50);
cout << "v1: ";
for(vector<int>::size_type i = 0; i < v1.size(); i++)
cout << v1[... | ALGO | 0.999443 | 4.693558 |
5798536e-d31f-4d8e-ba3f-839c12be9164 | mkst/cryptopals | src/challenges/08.cpp | #include <string>
#include <fstream>
#include <iostream>
#include "utils.h"
void challenge_08(){
std::ifstream infile("data/08.txt");
std::string line;
while (std::getline(infile, line)) {
std::vector<uint8_t> v1(line.begin(), line.end());
std::vector<uint8_t> v2 = hex2v(v1);
if(ecbmatch(v2)) {
... | ALGO | 0.977296 | 3.942148 |
c7bef902-2a1f-45e2-91d0-e7e75b8b885a | CandiceStewart/Game | Games/Box2D_v2.2.1/Box2D_v2.2.1/Box2D/Collision/b2Distance.cpp | #include <Box2D/Collision/b2Distance.h>
#include <Box2D/Collision/Shapes/b2CircleShape.h>
#include <Box2D/Collision/Shapes/b2EdgeShape.h>
#include <Box2D/Collision/Shapes/b2ChainShape.h>
#include <Box2D/Collision/Shapes/b2PolygonShape.h>
// GJK using Voronoi regions (Christer Ericson) and Barycentric coordinates.
int3... | ALGO | 0.999967 | 3.500086 |
53900854-02a1-4789-9611-ebfb7d7fafc8 | Hosseinabady/Caffe2_fpga | third_party/eigen/unsupported/test/BVH.cpp | #include "main.h"
#include <Eigen/StdVector>
#include <Eigen/Geometry>
#include <unsupported/Eigen/BVH>
namespace Eigen {
template<typename Scalar, int Dim> AlignedBox<Scalar, Dim> bounding_box(const Matrix<Scalar, Dim, 1> &v) { return AlignedBox<Scalar, Dim>(v); }
}
template<int Dim>
struct Ball
{
EIGEN_MAKE_ALIGN... | TEST | 0.990451 | 6.337957 |
df8eb01a-87f7-4a8d-879a-855e31aace4b | anusha2402/LeetCode-Questions | 8-string-to-integer-atoi/string-to-integer-atoi.cpp | class Solution {
public:
int myAtoi(string s) {
if(s.empty())
return 0;
int len = s.length(), i = 0, sign = 1;
while(i<len && s[i] == ' ')
i++;
if(i == len)
return 0;
if(s[i] == '-'){
sign = 0;
... | ALGO | 0.996341 | 5.103168 |
60e22397-65f2-43e4-b57a-12089f4dc7bf | karthikrk0180/Multithreaded-Merge-Sort | src/app/sorting/mergeSort.cpp | #include "mergeSort.hpp"
#include <iostream>
MergeSort::MergeSort(vector<int> *num)
{
this->num = num;
}
MergeSort::~MergeSort() {}
void MergeSort::recursiveSort(int left, int right)
{
if (left >= right)
{
return;
}
int mid = left + (right - left) / 2;
recursiveSort(left, mid);
... | ALGO | 0.999884 | 5.171429 |
10ca37ce-ddfb-4b3a-910e-d7668c191929 | yeacreate-opensources/tools | windows/Source Code/rk_provision_tool-20180918/rk_provision_tool/settings/inifile.cpp | #include "stdafx.h"
#include "inifile.h"
#include <algorithm>
#include <iostream>
#include <fstream>
// Only valid if C++
#ifndef __cplusplus
#error C++ compiler required.
#endif
// In the event you want to trace the calls can define _TRACE_CINIFILE
#ifdef _TRACE_CINIFILE
#define _CINIFILE_DEBUG
#endif
// _CRLF is u... | TOOL | 0.951602 | 4.264237 |
955fe7e8-f9df-4534-ab28-00ae2244820b | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_7040_11.cpp | #include <bits/stdc++.h>
using namespace std;
long long const mod = 1e9 + 7, MAXN = 2e5 + 5, oo = 3e18;
long long tc, n, m;
long long a[MAXN];
double st[MAXN << 2], add[MAXN << 2], mul[MAXN << 2];
void build(long long node = 1, long long tl = 1, long long tr = n) {
add[node] = 0;
mul[node] = 1;
if (tl == tr) {
... | ALGO | 0.999894 | 4.343927 |
902d4677-0443-4c43-be55-503c70f49ae1 | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/Year2021/May/xorEquality_20210508121220.cpp | #include<bits/stdc++.h>
#include<iostream>
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
int n;
cin >> n;
cout << answer % mod << endl;
}
return 0;
} | ALGO | 0.999686 | 3.81878 |
79574d64-58ca-4708-aa24-3363bf795370 | lucelujiaming/mySoxTest | RaytraceGroundUp/Chapter28.3_linux_module/Tracers/PathTrace.cpp | #include "PathTrace.h"
#include "World.h"
#include "ShadeRec.h"
#include "Material.h"
// -------------------------------------------------------------------- default constructor
PathTrace::PathTrace(void)
: Tracer()
{}
// -------------------------------------------------------------------- default constructor
... | ALGO | 0.923644 | 5.058304 |
f5835219-021c-4773-81bc-32132b6f9d77 | dillonhuff/scg | src/geometry/line.cpp | #include <cassert>
#include "geometry/line.h"
#include "utils/check.h"
namespace gca {
ostream& operator<<(ostream& out, line l) {
cout << l.start << " -> " << l.end << endl;
return out;
}
bool same_line(const line l, const line r, double tolerance) {
bool ss = within_eps(l.start, r.start, toler... | ALGO | 0.998847 | 6.080302 |
3d6cfed8-0e26-4da8-833b-bf45841323f3 | kaisub/shorty | silnia/main.cpp | #include <iostream>
using namespace std;
constexpr int silnia(int i)
{
return (i > 1) ? i * silnia(i - 1) : 1;
}
int main()
{
int val = 3;
cout << "silnia: " << val << " : " << silnia(val) << endl;
return 0;
}
| ALGO | 0.999657 | 5.685119 |
e2038a09-a0e2-4b61-bb73-aef3d3bef060 | Rinku2002/basicFlutter | 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 |
d073e586-d168-44de-a5cf-c9d63a030296 | sagarjha07/DP-QUESTIONS | DP_on_trees/nth_catalan_number.cpp | int pow(long long a,int b,int mod){
long long ans=1;
while(b>0){
if(b&1){
ans=(ans*a)%mod;
}
a=(a*a)%mod;
b=b>>1;
}
return (int)ans%mod;
}
int ncr(int n,int r,int mod){
if(r>n-r){
r=n-r;
}
long long res=1;
for(int i=0;i<r;i++){
r... | ALGO | 0.999922 | 4.84304 |
af597fd2-5eec-492f-bcc7-8099a2cb4669 | Ary0405/leetcode_problems | Arrays/trap_rain_water.cpp | // Problem - 42 (Trapping Rain Water)
// Time Complexity = O(n)
// Space Complexity = O (1)
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
int trap(vector<int> &height)
{
int n = height.size();
int left = 0, right = n - 1;
int res = 0;
int maxLeft = 0, m... | ALGO | 0.999934 | 6.827725 |
bc6c634d-5809-4f1a-b75e-abd57da36360 | AlonsoPaulino/competitive-programming | Codeforces/Training Camp Argentina 2020/Contest #9/288666I - Good String.cpp | #include <bits/stdc++.h>
#define pi acos(-1)
#define sz(x) (int) x.size()
#define pii pair<int, int>
#define pill pair<int, long long>
#define mii map<int, int>
#define vi vector<int>
#define vll vector<long long>
#define vs vector<string>
#define vb vector<bool>
#define mp make_pair
#define pb push_back
#define fi fir... | ALGO | 0.999741 | 3.556245 |
b156847b-b08b-4d7f-9c24-2c301bb39091 | ChicoState/tally | main.cpp | #include <iostream>
#include <vector>
#include <cstdlib>
using std::vector, std::cout, std::cin, std::endl;
int main(int argc, char** argv){
char input = ' ';
bool ongoing = true;
unsigned int options = 0 ;
vector <unsigned int> tally;
if( argc == 1 ){
options = 1;
}
else if( argc == 2 && atoi(argv... | ALGO | 0.944225 | 4.040277 |
4135df9d-a992-4f45-8b26-662921931f79 | MehradShm/AlgorithmCodes | marhale3/23/soal5c.cpp | #include <iostream>
using namespace std;
long long a[1002][1002] , b[1002];
int main()
{
b[0]=1;
long long delta , ans=0;
cin >> delta;
for(int i=0;i<=1000;i++)
a[0][i]=1;
for(int i=1;i<=1000;i++)
for(int j=i;j<=1000;j++)
if(i==j)
a[i][j]=1;
else
a[i][j]=(a[i][j-1]+a[i-1][j-1])%delta;
for(int i=... | ALGO | 0.999419 | 3.635821 |
70ee80d9-87d5-404a-b369-ff68721a7301 | ishandutta2007/codeforces | rush_d_cat/normal/1190/B.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
using namespace std;
typedef long long LL;
const int N = 100000 + 10;
int n,a[N];
bool cac() {
LL sum=0;
for(int i=1;i<=n;i++){
sum += a[i]-(i-1);
}
return sum%2;
}
int main() {
scanf("%d",&n);
for(int i=1;i<=... | ALGO | 0.999957 | 3.08695 |
5a2439f5-bddf-4059-95bc-e84a16908b95 | nikhilsp242/GeeksforGeeks-POTD | 31DaysOfCoding(July-2023)/Day-06 (Medium)/day-6.cpp | //{ Driver Code Starts
#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
//HAS PASSED ALL THE TEST CASES (1120 / 1120)
/* Function to print an array */
void printArray(int arr[], int size)
{
int i;
fo... | ALGO | 0.99994 | 6.228518 |
507cee87-c7e1-4d53-925a-441c406a6a75 | ishandutta2007/codeforces | anandoza/normal/1549/B.cpp | #include <bits/stdc++.h>
using namespace std;
// clang-format off
// template {{{
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define f first
#define s second
#define sz(x) int((x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define trav(a, x) for (auto... | ALGO | 0.999986 | 5.94357 |
ddde207c-84d3-488c-817f-6a6ffd72b072 | Daffodils-and-Chocolates/Cpp | CodingNinja/Functions/Concept.cpp | #include <iostream>
using namespace std;
//changes to an argument in a function does not change value
//of the argumet outside the code block
// void doubleValue(int a) {
// a = a * 2;
// cout<<a<<endl;
// }
// int main() {
// int a = 8;
// doubleValue(a);
// cout << a;
// }
//does not change ev... | TOOL | 0.91558 | 5.208107 |
2f855bf1-4ba7-4191-a30d-cb5bc0e1b941 | Sephir0ath/Sorting-death-match | randomNumbersGeneratorBinary.cpp | #include <stdlib.h>
#include <iostream>
#include <fstream>
#include <cstdint> // Para int32_t
#include <vector>
// NOTA: SE PUEDE ASUMIR QUE CADA ELEMENTO DE CADA ARRAY ES POSITIVO?
void randomNumbers(int quantity, int size, int range, std::ofstream& outputFile){
for (int i = 0; i < quantity; i++) { // Cuantos ar... | TOOL | 0.947379 | 4.810783 |
c96b8349-18ff-43ef-82e4-a815f7ff38fd | Foozhan-Fahimzadeh/Data-Structure | Data Structure/Skip List/skiplist.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int data;
Node **next;
Node(int data, int level)
{
this->data = data;
next = new Node*[level+1];
memset(next, 0, sizeof(Node*)*(level+1));
}
};
class SkipList
{
int mxLevel, level;
flo... | ALGO | 0.998352 | 4.092546 |
fe8d33c5-50a7-47d8-a83a-1a62cee09cc1 | merkiff/data-structure-and-algorithm-witch-c-source | ch4_divided_and_conquer/binarySearch.cpp | #include <algorithm>
#include <chrono>
#include <iostream>
#include <random>
#include <vector>
bool linear_search(int N, std::vector<int> &S)
/*선형 검색 함수*/
{
for (auto i : S)
{
if (i == N)
return true;
}
return false;
}
/*부동소수점 숫자로 구성된 벡터를 검색하려면 함수 원형 다음과 같이 변경
bool linear_search(f... | ALGO | 0.997924 | 4.907701 |
be4ae406-f35f-458e-b615-efb20f12537d | gtanish2003/CODES | C++/tut2.cpp | #include <iostream>
using namespace std;
int main()
{
int num1 , num2;
cout << "Enter the value of num1:\n";
cin >> num1 ;
cout<<"Enter the value of num2:\n";
cin >> num2;
cout<<"The sum is "<< num1+num2;
cout<<"\nThe product is "<< num1*num2;
return 0;
} | TOOL | 0.94866 | 3.754853 |
b9edabd1-fde9-4030-9d91-d95a37f8e2be | xyzall1/Struktur-Data-Assigment | MODUL 1. TIPE DATA/Unguided/Untitled-2.cpp | #include <iostream>
#include <map>
using namespace std;
int main()
{
// Membuat map dengan kunci string dan nilai integer
map<string, int> Dosen;
// Menambahkan data ke map
Dosen["Sari"] = 37;
Dosen["Dewi"] = 45;
Dosen["Sri"] = 55;
// Menampilkan data dari map menggunakan iterator
map... | TOOL | 0.885073 | 5.523945 |
2a714608-e3f3-441b-a780-ac0d2eecf52d | aniruddh-joshi/ds_programs | Sorting Technique/Selection Sort.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cout<<"Enter the range of Numbers\n";
cin>>n;
int arr[n];
cout<<"Enter the elements in the list\n";
for(int i=0;i<n;i++)
{
cin>>arr[i];
}
//Selection Sort starts
for(int i=0;i<n-1;i++)
{
int mini=i;
for(int j=i+1;j<n;j++)
{
if(arr[j]<arr[m... | ALGO | 0.999838 | 3.740093 |
dc179e02-c9eb-4388-9f36-55e40b820af1 | Ahashanakash/Cpp_basic_Codes | sum.cpp | #include<iostream>
using namespace std;
int main()
{
int a,b,sum;
cout<<"Enter two intiger numbers = ";
cin>>a>>b;
sum = a+b;
cout<<"total "<<sum;
return 0;
}
| TOOL | 0.891396 | 3.491709 |
a50d6f3f-b1e1-4221-9ec4-366a5166bba5 | iuiuiom/hhvm | hphp/zend/crypt-sha256.cpp | /* SHA256-based Unix crypt implementation.
Released into the Public Domain by Ulrich Drepper <<EMAIL>>. */
/* Windows VC++ port by Pierre Joye <<EMAIL>> */
#include "hphp/zend/php-crypt_r.h"
#include <errno.h>
#include <limits.h>
#include <memory.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#incl... | ALGO | 0.998858 | 6.756093 |
5c1ef7b3-aeef-4122-9a6c-e5d58c3c9d8d | Otsj-2325/Ototsuji_Summary-of-Works | あかずきんちゃんのりんごひろい/ソースコード/main/randam.cpp | #include "randam.h"
void initRand()
{
srand(time(NULL));
}
int getRand()
{
return rand();
}
int getLimitRand(int limit)
{
return rand() % limit;
}
| TOOL | 0.939409 | 4.164246 |
cd072c68-1e5c-44fc-9180-9ada6aa39a96 | sunny2028/DS-IN-CPP | Data Structure practice/Graph/Detect Cycle in a UnDirected Graph.cpp | #include<bits/stdc++.h>
using namespace std;
class Graph
{ int V;
list<int> *l;
bool *visited;
public: Graph(int v)
{
V=v;
l=new list<int>[v];
visited=new bool[v];
memset(visited,false,sizeof(visited));
}
void addEdge(int u,int v)
{
l[u].push_back(v);
l[v].push_back(u);
}
bool detectcycle();
void dfs(int a,b... | ALGO | 0.999851 | 3.69683 |
fc434a4c-48f6-4ab4-bdee-6301256e8612 | Tagore-7/CPP_Daily_Programming | 1791. Find Center of Star Graph.cpp | class Solution {
public:
int findCenter(vector<vector<int>>& edges) {
int n = edges.size();
vector<vector<int>> adj(n+2);
for(int i = 0; i < n ; i++){
adj[edges[i][0]].push_back(edges[i][1]);
adj[edges[i][1]].push_back(edges[i][0]);
}
for... | ALGO | 0.999855 | 5.489285 |
7bbb488c-6308-4ed8-b7e3-eb14ad147b6e | Sup3rFire/CP | loaling/A_Dividing_Orange.cpp | #include <bits/stdc++.h>
using namespace std;
// loal is a cute girl
#define ll long long
#define ld long double
#define pow2(x) (x)*(x)
#define le left
#define ri right
#define fi first
#define se second
#define pb push_back
#define all(v) v.begin(), v.end()
#define pii pair<int, int>
#define pll pair<long, long>
c... | ALGO | 0.99999 | 3.487512 |
f8c67eb2-058a-4b08-858f-c9eae2ce26da | limon27121/Datastructure-and-algorithm | recursion/sum of digit.cpp | #include <iostream>
using namespace std;
int myself(int number){
//base condition
if(number>=0 && number<=9){
return number;
}
else{
int myvalue=number%10;
int restvalue=number/10;
int colsum=myself(restvalue);
myvalue+=colsum;
return myvalue;
... | ALGO | 0.999952 | 4.434189 |
aafa31bb-062d-4223-8d1a-b5693e635f64 | ishandutta2007/codeforces | errichto/normal/742/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
scanf("%d", &n);
if(n) {
n %= 4;
n += 4;
}
int r = 1;
while(n--) r *= 8;
printf("%d\n", r % 10);
} | ALGO | 0.999883 | 3.607719 |
26341316-1a4b-489c-ae8f-1c3ff63f3b8c | innovator-zero/SJTU-OJ | 1359/main.cpp | #include <iostream>
#include <cstring>
using namespace std;
int main()
{
char str[1001];
int sum=0,i;
cin.getline(str,1000);
for(i=0;i<strlen(str);++i)
{
if(str[i]>='A'&&str[i]<='Z')sum+=(str[i]-'A'+1)*(i+1);
if(str[i]>='a'&&str[i]<='z')sum+=(str[i]-'a'+27)*(i+1);
}
cout<<su... | ALGO | 0.998535 | 3.558175 |
25271eaf-5a40-45df-a452-3b61dbb179d4 | Adidier/PlayEngine | ExternalLibs/Bullet/include/BulletInverseDynamics/MultiBodyTree.cpp | #include "MultiBodyTree.hpp"
#include <cmath>
#include <limits>
#include <vector>
#include "IDMath.hpp"
#include "details/MultiBodyTreeImpl.hpp"
#include "details/MultiBodyTreeInitCache.hpp"
namespace btInverseDynamics
{
MultiBodyTree::MultiBodyTree()
: m_is_finalized(false),
m_mass_parameters_are_valid(true),
... | ALGO | 0.993298 | 6.615774 |
6d7c1c77-026c-4dfd-a3fe-e038b1cd54a6 | gpzero/android_frameworks_base | media/libstagefright/codecs/aacdec/inv_long_complex_rot.cpp | /*
Pathname: .inv_long_complex_rot.c
Funtions: inv_long_complex_rot
------------------------------------------------------------------------------
REVISION HISTORY
Description: Change the input argument, no shifts information from long fft_rx4
, do not have to check for shifts.
Date: 10/18/200... | ALGO | 0.999815 | 3.32823 |
2dfd56e2-eaf1-48fb-9dc2-0786aebe55b4 | beetleskin/hrf | myhog.cpp | #include <string>
#include <iostream>
#include <boost/progress.hpp>
#include "opencv2/gpu/gpu.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "HoG.hpp"
#include "GpuHoG.hpp"
using namespace std;
using namespace cv;
string src_file = "/home/stfn/dev/rgbd-dataset/rgbd-scenes/background/background_10/background_10... | ALGO | 0.976132 | 6.44381 |
0fb230d4-fb83-4bda-bb66-5de6d562236b | valmig/groebner_basics | src/idealroots.cpp | #include <fstream>
#include <string>
#include <complex.h>
#include <matrix.h>
#include <ideal_roots.h>
#include <MyTime.h>
#include <thread>
void program_info()
{
std::cout<<"\nCommand: idealroots <File> [number of threads] [output-File]";
std::cout<<"\n=======";
std::cout<<"\nComputation of all roots of a zero-dim... | TOOL | 0.874591 | 3.641393 |
0d715aee-7503-477c-8527-d10402f2dfb1 | windrew/Baekjoon_ac_codes | 2490.cpp | #include <stdio.h>
int main() {
int a,b=0;
for(int i=1;i<=3;i++)
{
for(int j=1;j<=4;j++)
{
scanf("%d",&a);
b+=a;
}
if(b==0)printf("D\n");
if(b==4)printf("E\n");
if(b==3)printf("A\n");
if(b==2)printf("B\n");
if(b==1)printf(... | ALGO | 0.999785 | 3.121552 |
97e9e6d3-611b-427f-8868-ce782293f660 | shimmer12/leetcode | my-folder/0242-valid-anagram/solution.cpp | class Solution {
public:
bool isAnagram(string s, string t) {
//hashtable
int a= s.length();
int b= t.length();
if(a!=b)return false;
int arr[26]={0};
for(int i=0;i<a;i++){
arr[s[i]-'a']++;
arr[t[i]-'a']--;
}
for(int i=0;i<26;i++){
... | ALGO | 0.999996 | 6.023977 |
1a706cb6-4565-4ce3-9fec-beed84fc1346 | codingNoob12/algorithm-study | cpp/바킹독_알고리즘/다이나믹 프로그래밍/2579_3.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
// dp[i]: i번째 계단까지 올라섰을 때, 밟지 않을 계단의 합의 최솟값.
// 단, i번째 계단은 반드시 밟지 않는다.
int stairs[301], dp[301];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n;
for (int i = 1; i <= n; i++)
cin >> stairs[i];
dp[1] = stairs[1], dp[2] = stai... | ALGO | 0.999925 | 4.083293 |
4210da52-a04c-4d17-b50f-695311bc9507 | Coolboymannu/DSA-2nd-sem | project 2nd sem 14 question/11_Polynomial.cpp | /*11. WAP in C++ to implement polynomials using stack
and linked list.
*/
#include <iostream>
#include <math.h>
using namespace std;
class stack;
// Define a node class for the linked list.
struct Node {
public:
int data;
Node *next;
Node(int data) {
this->data = data;
this->next = NULL;
}
};
// Defin... | ALGO | 0.999773 | 5.284654 |
e31b115d-98b9-4043-a033-8d18659aad7a | TobiasFaller/FreiTest | libraries/solver/sat-ipasir-solvers/cadical/test/api/terminate.cpp | #include "../../src/cadical.hpp"
#ifdef NDEBUG
#undef NDEBUG
#endif
extern "C" {
#include <assert.h>
#include <unistd.h>
#include <signal.h>
}
static int n = 11;
static int ph (int p, int h) {
assert (0 <= p), assert (p < n + 1);
assert (0 <= h), assert (h < n);
return 1 + h * (n+1) + p;
}
static CaDiCaL::So... | ALGO | 0.998788 | 6.453704 |
3894db3b-6069-45fb-8520-b5bf4bb4818d | Anujjha19/DSA-with-CPP | Array/E_Remove_Duplicate_Form_Sorted_Array.cpp | int removeDuplicates(vector<int> &nums)
{
set<int> s;
for (int i = 0; i < nums.size(); i++)
{
s.insert(nums[i]);
}
int k = s.size();
int j = 0;
for (auto it : s)
{
nums[j++] = it;
}
return k;
}
/*
int i = 0;
for (int j = 0; j < nums.size(); j++)
{
if (num... | ALGO | 0.999436 | 5.511255 |
fdce17f2-61fb-49a9-b933-7ae886442652 | serna37/sandbox | work/17.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
string S;
cin >> N >> S;
pair<int, int> p = {0, 0};
set<pair<int, int>> st;
st.insert(p);
for (int i = 0; i < N; i++) {
if (S[i] == 'R') {
p.first++;
} else if (S[i] == 'L') {
p.first--;... | ALGO | 0.999997 | 4.724644 |
adedf5ee-4989-459a-9c29-59f20b6295f1 | pranavrananaware/FluttersApp | StatelessApp/indianflag/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.997747 | 6.76775 |
86b28e7f-f06b-48d7-820c-7329f9bded5e | Oreki1107/c-_programs | day1/ptrn2.cpp | #include <iostream>
using namespace std;
int main()
{
int r,c;
for(r=1; r<=5; r++)
{
for(c=1; c<=r; c++)
{
cout<<r;
}
cout<<endl;
}
return 0;
}
| ALGO | 0.998979 | 3.423047 |
08e3ce4f-ab7d-40cc-ba07-a14b19e76f2c | Macesuted/Code | NFLSOJ/12960.cpp | /**
* @file wall.cpp
* @author Macesuted (<EMAIL>)
* @date 2022-04-26
*
* @copyright Copyright (c) 2022
*
*/
#include <bits/stdc++.h>
using namespace std;
bool mem1;
#define maxn 1005
class UnionSet {
private:
int fa[maxn];
public:
void init(int l, int r) {
for (int i = l - 1; i <= r +... | ALGO | 0.999769 | 4.549075 |
e46fce3e-6f8e-43c8-ac3b-62ab65075919 | carsten0x51h/star_recognizer_code_snippets | part3_star_clustering.cpp | #include <iostream>
#include <CImg.h>
#include <CCfits/CCfits>
#include <list>
#include <set>
#include <algorithm>
#include <tuple>
using namespace cimg_library;
using namespace CCfits;
using namespace std;
void readFile(CImg<float> & inImg, const string & inFilename) {
std::unique_ptr<FITS> pInfile(new FITS(in... | ALGO | 0.962408 | 4.626591 |
b28e5f49-da2d-4056-96fa-776ff454769f | sarvex/leetcode-powershell | solution/1500-1599/1575.Count All Possible Routes/Solution.cpp | class Solution {
public:
int countRoutes(vector<int>& locations, int start, int finish, int fuel) {
int n = locations.size();
int f[n][fuel + 1];
memset(f, -1, sizeof(f));
const int mod = 1e9 + 7;
function<int(int, int)> dfs = [&](int i, int k) -> int {
if (k < 0 ... | ALGO | 0.999961 | 5.886081 |
1407f914-a55e-4117-8015-ef282b72cb8a | rjk13637110731/Cplusplus-Language-Learn-Note | Three_Stage/model_example.cpp | #include <iostream>
using namespace std;
//实现通用的对数组进行排序
//规则是从大到小
//算法:选择
//测试:int、char类型
//交换函数模板
template <class T>
void mySwap(T& a,T& b) {
T temp = a;
a = b;
b = temp;
}
//打印数组的模板
template <class T>
void printArray(T arr[],int len) {
for (int i = 0; i < len; i++) {
cout << "arr[" << i << "] = " << arr[i] <<... | ALGO | 0.999078 | 4.656679 |
0ae8de6e-7896-4853-bf5b-dfc1782dcc54 | openharmony-gitee-mirror/third_party_boost | libs/graph/example/bellman-example.cpp | using namespace boost;
template < typename Graph, typename ParentMap > struct edge_writer
{
edge_writer(const Graph& g, const ParentMap& p) : m_g(g), m_parent(p) {}
template < typename Edge >
void operator()(std::ostream& out, const Edge& e) const
{
out << "[label=\"" << get(edge_weight, m_g, ... | ALGO | 0.999352 | 5.895616 |
3df3c91b-fa38-4d00-88c2-c8496e2c6f30 | PeaceTem/competitive-programming | AEasyProblem.cpp | #include <bits/stdc++.h>
using namespace std;
void solve(){
int n; cin>>n;
cout << n - 1 << '\n';
}
int main(){
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr), std::cout.tie(nullptr);
int t; std::cin >> t; while (t--) solve(); return 0;
} | ALGO | 0.999689 | 4.558225 |
e3eb631a-8f32-4cf2-bbcf-1eee417cbc8b | mk28r/Code- | AzCodes/leet.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;
#define int long long
#define ll long long
#define ld long double
#define nline "\n"
#define ff first
#define ss ... | ALGO | 0.99985 | 3.865732 |
a7472295-84de-4a76-b355-88e55321ae11 | icecocoa6/abc | 71/D.cpp | #include <iostream>
using namespace std;
const int MOD = 1000000007;
typedef pair<int, int> edge;
int main(int argc, char *argv[]) {
int N;
cin >> N;
string S1, S2;
cin >> S1 >> S2;
long long ans = 1;
int idx = 0;
bool vert = false;
if (S1[idx] == S2[idx]) {
ans = 3;
vert = true;
idx += 1;
} else ... | ALGO | 0.999994 | 4.342699 |
2e1e664b-d1dc-4243-ab62-5a8806e3ea81 | Oein/PS | jungol/1___/10__/101_/1019/1019.cpp | #include <vector>
#include <algorithm>
#include <queue>
#include <iostream>
#include <map>
#include <set>
#include <math.h>
#include <numeric>
#include <cassert>
#include <stack>
#include <cstring>
using namespace std;
typedef long long ll;
typedef unsigned long ull;
typedef pair<int, int> pii;
typedef signed char i... | ALGO | 0.999804 | 3.508868 |
dd9934ad-a451-4dd7-b15b-c657dc2c356e | vladsuxunun/ALGORITHM | Algorithm/16.11.19/baisa/week10/G1/2.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<int> pi;
int p2(string t){
int m = t.size();
int len = 0;
for(int i = t.size() - 1; i >= 0; --i){
string preff = t.substr(0, i);
string suff = t.substr(m - i, i);
if(preff == suff){
len = i;
... | ALGO | 0.999847 | 4.245452 |
4a40579b-c287-4702-9305-45ed9723677d | sarihammad/DS-and-Algorithms | Linked List/Merge k Sorted Lists/merge_k_sorted_lists.cpp | // Min-heap. Keep track of current min across all lists by using head value as key.
class MergeKSortedLists {
public:
ListNode* mergeKLists(vector<ListNode*>& lists) {
auto comparator = [](ListNode* a, ListNode* b) { // lambda comparator
return a->val > b->val; // b before a
};
... | ALGO | 0.9999 | 5.932264 |
6e739349-0bd2-44ba-848e-0eea539af23e | jordan-fredericks/Assignment3 | JJF.Assignment3/Main.cpp |
// Assignment 3 - Library Book Manager
// Jordan Fredericks
#include <iostream>
#include <conio.h>
#include <cctype> // Included for tolower()
using namespace std;
struct Book
{
string Title;
string Author;
int YearPublished;
int NumPages;
};
void UpdateBook()
{
};
int main()
{
//create the array and add it... | TOOL | 0.928477 | 5.272229 |
bfba8470-84ef-4523-95a2-9c591353c149 | avinashyadav16/Codeforces-CodeSolution-And-OOPs | CPP OOPS CONCEPTS/FULL OOPS/Lecture_54.cpp | /**
* @file: Lecture_54.cpp
* @author: Avinash Yadav
* @brief: Function Objects (Functors) In C++ STL
* @date: 25-11-2023
*/
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////... | ALGO | 0.997386 | 5.38995 |
11a1c18c-6489-4afe-a157-b054f5e1cf1d | soham-mehta/Blind-75 | valid_anagram(2).cpp | //1
class Solution {
public:
bool isAnagram(string s, string t) {
if(s.size() != t.size()) {
return false;
}
sort(s.begin(),s.end());
sort(t.begin(),t.end());
return (s == t);
}
};
//2
class Solution {
public:
bool isAnagram(string s, string ... | ALGO | 0.999982 | 6.137201 |
3e566d63-08e4-4726-ab8e-35c06d0a8e7e | wugangca/competitive-programming | ccc/2015/s2.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int J, A;
cin >> J >> A;
vector<char> jerseys(J + 1, ' ');
for (int i = 1; i <= J; i++) {
cin >> jerseys[i];
}
int total = 0;
// S, M, L
for (int i = 0; i < A; i++) {
char size;
int j;
cin >> size >> j;
if (... | ALGO | 0.999666 | 3.283937 |
6860ea72-d7a6-4d30-8d3b-4ba240a9395b | anmolkgupta/AB-DSA | array.cpp | #include <iostream>
using namespace std;
int main()
{
//declare array and initilization
int B[5] = {2,4,6,8,10};
//accessing array
for(int i = 0; i < 5; i++)
{
cout << B[i];
}
return 0;
}
| ALGO | 0.918962 | 3.247661 |
231cf6a8-2a81-416a-bb6c-b8ec39a7d8ef | dipaliyadav07/C- | OperatorOverloading1.cpp | #include<iostream>
using namespace std;
class Demo
{
public:
int A,B;
Demo(int i = 0, int j = 0)
{
A = i;
B = j;
}
};
Demo operator +(Demo obj1, Demo obj2)
{
int no1 = 0;
int no2 = 0;
no1 = obj1.A+obj2.A;
no2 = obj1.B+obj2.B;
return Demo(no1, no2);
}
int main()
{
Demo X(10,20);
Demo Y(... | ALGO | 0.946277 | 4.7312 |
5ad753a6-2b30-469d-90dd-7f7432090c8a | Himanshu4776/leetcode-submissions | 1-two-sum/2021-10-08 01.22.07 - Accepted - runtime 12ms - memory 10.8MB.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
// this was a brute force approach:
// for(int i=0; i<=nums.size();i++)
// {
// for(int j=i+1; j<nums.size(); j++)
// {
// if(nums[i] + nums[j] == target)
// {... | ALGO | 0.999533 | 6.262597 |
9de46ca6-e6a6-4ec4-85d3-e7e7339127f7 | vickiegpt/bpftrace | src/probe_matcher.cpp | #include <dirent.h>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <regex>
#include <string>
#include <vector>
#include "bpftrace.h"
#include "cxxdemangler/cxxdemangler.h"
#include "dwarf_parser.h"
#include "log.h"
#include "probe_matcher.h"
#include "tracefs.h"
#include "utils.h"
#include <bcc/bc... | TOOL | 0.914076 | 6.451815 |
fc8c0a7c-6026-4d2f-8279-381611a411c7 | Ark2307/LeetHub | 32-longest-valid-parentheses/32-longest-valid-parentheses.cpp | class Solution {
public:
int longestValidParentheses(string s) {
int n = s.size() ;
int maxi = 0 ;
stack<int> st ;
st.push(-1) ;
for(int i = 0 ; i < n ; i++){
if(s[i] == '(')
st.push(i) ;
else{
... | ALGO | 0.999893 | 5.928913 |
559861d1-4ea7-4edd-b5d3-377fe30dc154 | sarvex/leetcode-c | solution/0100-0199/0159.Longest Substring with At Most Two Distinct Characters/Solution.cpp | class Solution {
public:
int lengthOfLongestSubstringTwoDistinct(string s) {
unordered_map<char, int> cnt;
int n = s.size();
int ans = 0;
for (int i = 0, j = 0; i < n; ++i) {
cnt[s[i]]++;
while (cnt.size() > 2) {
cnt[s[j]]--;
if... | ALGO | 0.999962 | 6.189804 |
53bd348e-2ef1-44fd-9fb4-e76cc0f5c38b | chew-in/HPC_in_Finance | hws/B.cpp | #include <iostream>
#include <cmath>
#include <algorithm>
#include <boost/math/distributions/normal.hpp>
#include <chrono> // For measuring execution time
using namespace std::chrono;
using matrix = std::vector<std::vector<float>>;
// Use the function you wrote to multiply two 1000x1000 matrices.
// Measure the execu... | ALGO | 0.999753 | 5.082641 |
162904d6-3075-4521-b034-e5793fd77c7a | Sanghrakshit12/Striver-Sheet | BinarySearchonAnswers/SmallestDivisorgiventhreahold.cpp | #include <bits/stdc++.h>
using namespace std;
// int Brute(vector<int> nums, int k){
// int n = nums.size();
// int mx = INT_MIN;
// for (int i = 0; i < n; i++)
// mx = max(mx, nums[i]);
// for (int i = 1; i <= mx; i++){
// int x = 0;
// for (int j = 0; j < n; j++)
// ... | ALGO | 0.999943 | 4.475139 |
7f8553e6-2d9c-4ef4-9683-1f65d6d5095f | cat-huahua/luogusolution | P1428.cpp | #include <iostream>
using namespace std;
int main()
{
int A[100], n, p;
int i, j;
cin >> n;
for (i = 0; i < n; i++)
{
cin >> A[i];
for (j = 0, p = 0; j < i; j++)
{
if (A[j] < A[i])
{
p++;
}
}
cout << p << " ... | ALGO | 0.999959 | 3.845269 |
f98ad706-60f0-4530-b6ea-39dd543a6172 | Abhinav7076/My-Codes | LeetCode-Solutions-master/C++/split-array-into-fibonacci-sequence.cpp | // Time: O(n^3)
// Space: O(n)
class Solution {
public:
vector<int> splitIntoFibonacci(string S) {
for (int i = 0, a = 0; i + 2 < S.length(); ++i) {
a = 10 * a + S[i] - '0';
for (int j = i + 1, b = 0; j + 1 < S.length(); ++j) {
b = 10 * b + S[j] - '0';
... | ALGO | 0.999931 | 6.142509 |
bfaea543-ddf7-4721-ac81-454fc4450edb | Murad501/Phitron | Semester 3/Weeks/Level-1/Week 3/Day-2/A_Compare_T_Shirt_Sizes.cpp | #include <bits/stdc++.h>
using namespace std;
#define nl '\n'
#define ll long long int
#define MuRAD_BOOST() \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
int main()
{
MuRAD_BOOST();
int t;
cin >> t;
while (t--)
{
string a, b;
cin >> a >> b;
i... | ALGO | 0.999996 | 4.742386 |
2c13caeb-35dc-4381-bc4a-034eec92ba1e | lapisco/PDI_trainingList | issue_22/main.cpp | #include <opencv/cv.h>
#include <opencv/highgui.h>
#include <opencv/cvaux.h>
#include <opencv/cxcore.h>
#include <opencv/ml.h>
#include <stdlib.h>
#include <stdio.h>
using namespace cv;
using namespace std;
void setPoint(int e,int x,int y,int d, void*ptr){
Point*p= (Point*)ptr;
p->x = x;
p->y = y;
}
Mat g... | ALGO | 0.999644 | 4.221682 |
78d339ff-3c07-452e-b77e-c4e6131cf7a5 | mrunaltarwatkar018/Placement_Data_Structures_N_Algorithms | Bit_MAgic/XOR Queries of a Subarray.cpp.cpp | /* Leetcode Problem No.: 1310. XOR Queries of a Subarray */
/*
Company Tags : will update soon
Leetcode Link : https://leetcode.com/problems/xor-queries-of-a-subarray
*/
/******************************************************** C++ *******************************************... | ALGO | 0.999611 | 5.978884 |
528ede79-a5a6-4491-981a-1daa892ab1d7 | abhishekrsingh/GFGProblems | Medium/Count all Possible Path/count-all-possible-path.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int isPossible(vector<vector<int>>paths){
// Code here
for(int i=0;i<paths.size();i++){
int c=0;
for(int j=0;j<paths.size();j++){
if(paths[i][j])c++;
}... | ALGO | 0.999629 | 6.344745 |
eaa61fac-4b18-4bc0-8a70-cc2589971433 | algorithm004-05/algorithm004-05 | Week 3/id_160/33.搜索旋转排序数组.cpp | /*
* @lc app=leetcode.cn id=33 lang=cpp
*
* [33] 搜索旋转排序数组
*/
// @lc code=start
class Solution {
public:
int search(vector<int>& nums, int target) {
int l = 0, r = nums.size()-1;
while (l<=r) {
int mid = (r-l)/2+l;
if (nums[mid] == target)
return mid;
... | ALGO | 0.999981 | 6.468754 |
b0ebde0c-1c59-4170-888e-cc2330300f0d | vatsalvasani/Progrmamming2 | code/Recursion/Sum_Of_Number.cpp | // Online C++ compiler to run C++ program online
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
//trust the function that it will give me sum of number so just get sum of number all accept last and add it with last and base case
int sumofnumber(int n)
{
if(n==0)return 0;
int k = (n%10) + (sumo... | ALGO | 0.999884 | 5.774983 |
a85c6f5f-d98f-4226-83e0-590a657b8ce4 | metaxy/cluster-editing | mgraph.cpp | #include "mgraph.h"
#include <fstream>
#include <sstream>
#include <cassert>
MGraph::MGraph()
{
de("MGraph::Mgraph()");
}
MGraph::MGraph(int nodeCount) : m_nodeCount(nodeCount)
{
de("MGraph::Mgraph(int) ");
m_matrix = new NodeT*[m_nodeCount];
//init vector where is saved whether the node is deleted,
... | ALGO | 0.995778 | 3.966965 |
cc9a75d1-a1ed-4c0a-9fcf-6bc7c3209f21 | xxcxu/SchoolCode | HLP1342.cpp | #pragma region
#include <bits/stdc++.h>
namespace FileHeader {
using i16 = int16_t;
using i32 = int32_t;
using i64 = int64_t;
using ui32 = uint32_t;
using ui64 = uint64_t;
#define ep emplace
#define eb emplace_back
#define all(x) x.begin(), x.end()
FILE* fin, * fout, * ferr;
i32 read() {
i32 t =... | ALGO | 0.999602 | 4.830382 |
532635ae-fa34-44c2-8b40-2e93cbc501cf | neha629/CODENOTE | LINKED_LIST/Swap_pairs.cpp | node* swap_pair(node *head)
{
if(head==NULL || head->next==NULL)
return head;
node *curr,*nxt,*prev=NULL;
curr = head;
nxt = head->next;
head = nxt;
while(curr && curr->next)
{
curr->next = nxt->next;
nxt->next = curr;
if(prev)
prev->next = nxt;
prev = curr;
curr = curr->next;
if(curr)
... | ALGO | 0.999967 | 3.784061 |
f79a7805-09a0-4a3d-9e87-6575fb5e0a85 | prashant-kr5117/Leetcode | 14-longest-common-prefix/14-longest-common-prefix.cpp | class Solution {
public:
//function to find common prfeix between two string
string LCP(string x,string y){
int i=0,j=0;
while(i<x.length()&& j<y.length()){
if(x[i]!=y[j]) break;
i++;
j++;
}
return x.substr(0,i);
}
... | ALGO | 0.999777 | 5.645107 |
a3c18267-2d6f-4ee1-b785-2e82d3ce2da7 | maruf-hossain74/Codechef-Problem-Solve | Rating_1401-1500/Average Permutation.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t; cin>>t; while(t--)
{
int n; cin>>n;
cout<<n-1<<" "<<n-2<<" ";
for(int i = 1; i<=n-3; i++)
cout<<i<<" ";
cout<<n*(n>=3)<<"\n";
}
return 0;
}
| ALGO | 0.999924 | 3.918834 |
48b05686-ea17-4ea9-8738-d77bee97b8b3 | xiaoyangst/Code | 可复用代码/project/src/utils/Config.cpp | /**
******************************************************************************
* @file : Config.cpp
* @author : xy
* @brief : None
* @attention : None
* @date : 2025/3/18
******************************************************************************
*/
#inc... | CONFIG | 0.985314 | 5.601186 |
5b2da8f3-6198-48ad-8766-91838d2daccf | deepesh-mishra3/LEETCODE-POTD | lc-1740.cpp | class Solution {
public:
bool checkPowersOfThree(int n) {
while(n>0){
if(n%3>1) return false;
n=n/3;
}
return true;
}
}; | ALGO | 0.999526 | 5.26437 |
e133a790-6805-4af1-b603-7e045e0de099 | smhemel/Codeforces-Online-Judge | Codeforces Round #434 (Div. 2) - A. k-rounding.cpp | #include <iostream>
#include <algorithm>
using namespace std;
long long n,k,x=1;
int main(){
cin>>n>>k;
for(int i=1;i<=k;i++) x*=10;
cout<<(n*x)/__gcd(n,x) << endl;
return 0;
}
| ALGO | 0.998743 | 3.514896 |
6378937a-17a5-4965-a9dc-22fc82815bff | abtinahmdi/olympiad-codes | george and accommodation.cpp | //Author: ABTIN AHMADI
#include<bits/stdc++.h>
using namespace std;
int n, ans;
int main()
{
cin >> n;
for (int i = 0 ; i < n ; i ++)
{
int a,b;
cin >> a >> b;
if (b - a >=2)
ans++;
}
cout << ans << endl;
} | ALGO | 0.999912 | 3.922463 |
fed2923e-911a-407b-978b-536611e85b8c | KmrAnish04/100DaysOfCode | Trees/9-Bottom_View_Of_Binary_Tree.cpp | /*
Problem: Bottom view of Binary Tree
Question Link:
GFG: https://practice.geeksforgeeks.org/problems/bottom-view-of-binary-tree/1#
LeetCode: **Not Available
***Algorithm:
Method 1 – Using Queue:
The following are steps to print Bottom View of Binary Tree.
1. We ... | ALGO | 0.999994 | 6.299853 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.