uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
4b94241b-293c-40a8-9031-25625363e883 | Traeyee/leetcode | cpp/P26.cpp | /**
* @author <EMAIL>
* @time 2021-11-10 23:31
* @brief 双指针法会简洁很多,只要是数组,怎么也得想想双指针
*/
#include <algorithm>
#include <climits>
#include <iostream>
#include <queue>
#include <random>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <ve... | ALGO | 0.999959 | 5.801369 |
4efa46f5-1c8b-43ea-811c-bf08551e64df | Kralitos22/code-dapa | function.cpp | #include <iostream>
using namespace std;
float luasLingkaran(float r) {
const float PI = 3.14;
float luas = PI * r * r;
return luas;
}
int main(){
float jari_jari = 9;
float hasil = luasLingkaran(jari_jari);
cout<<"Luas Lingkaran dengan jari jari " << jari_jari << " adalah " << hasil;
return 0;
} | ALGO | 0.99798 | 3.781426 |
1d4c55f1-e8b2-469f-8633-59d1c4638a89 | CharlyGaleana/ICPC | Latin America Regionals 2015/C - Juan - After Contest.cpp | #include <bits/stdc++.h>
#define lld long long int
#define x first
#define y second
using namespace std;
const int MAXN = 100002;
typedef pair < lld, lld > pto;
int n;
pto arr[MAXN];
pto operator-(pto a, pto b) { return {a.x - b.x, a.y - b.y}; }
lld cross(pto p, pto q) { return p.x * q.y - q.x * p.y; }
lld areaTri... | ALGO | 0.999934 | 4.050002 |
24f43423-ff7d-4a53-9f48-d72ec9117c31 | Sharafabdullah/CompetitiveProgramming | difficultyBased.cpp/1600/GoodSubarrays.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(v) ((v).begin()), ((v).end())
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define pb push_back
#define ppb pop_back
#define F ... | ALGO | 0.999882 | 4.230822 |
42e848e1-d551-45ce-b98e-d9c9873ef427 | shyam2520/DSA | 92-reverse-linked-list-ii/92-reverse-linked-list-ii.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* reverseBetw... | ALGO | 0.999997 | 5.646563 |
d1ba9a77-f020-4a91-b296-84ee457b8f7d | MohamedElshame/rick_and_morty_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 |
cd4f26ce-05a0-4474-8a05-49ebfed332b0 | qutrol3264/parsec | pkgs/libs/tbblib/src/src/test/test_lambda.cpp | #define NOMINMAX
#include "tbb/tbb.h"
#include "tbb/combinable.h"
#include <cstdio>
#if !TBB_USE_EXCEPTIONS && _MSC_VER
// Suppress "C++ exception handler used, but unwind semantics are not enabled" warning in STL headers
#pragma warning (push)
#pragma warning (disable: 4530)
#endif
#include <list>
#if !... | TEST | 0.89466 | 5.770907 |
f63a77c6-8606-400a-bb3a-b3e32378f8be | u4usmankhalil/DS-Paper | DATA/queue/implement queue using linklist.cpp | #include <iostream>
#include <stdlib.h>
#include<unistd.h>
using namespace std;
struct node {
int data;
struct node *next;
};
struct node* front = NULL;
struct node* rear = NULL;
struct node* temp;
void Insert() {
int val;
cout<<"Insert the element in queue : "<<endl;
cin>>val;
if (rear == NULL) {
... | ALGO | 0.99687 | 3.742424 |
ff2a5bdb-3a32-4215-ad11-48d7f3fb91a0 | mrdealba/llvm | llvm/lib/Transforms/Utils/LCSSA.cpp | #include "llvm/Transforms/Utils/LCSSA.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/BasicAliasAnalysis.h"
#include "llvm/Analysis/BranchProbabilityInfo.h"
#include "llvm/Analysis/GlobalsModRef.h"
#include "llvm/Analysis/LoopInfo.h"
#i... | ALGO | 0.993867 | 6.953547 |
7d650352-4773-473e-bc29-3d524f23e958 | shohan2032/Competitive-Programming-Practice-Codes | B_Multiplication_and_Sum.cpp | #include <bits/stdc++.h>
using namespace std;
#define db long long
#define ll long long
#define int ll
#define vi vector<int>
#define vs vector<string>
#define vpi vector<pair<int, int>>
#define vpd vector<pair<double, double>>
#define vps vector<pair<string, string>>
#define mp(x, y) make_pair(x, y)
#define pb(x) pu... | ALGO | 0.999565 | 5.086653 |
387e0183-c23b-4be4-b0ef-d86ee6a72cd5 | OLehBlasiuk/6.3.1 | 6.3.1.cpp | #include <iostream>
#include <iomanip>
#include <time.h>
using namespace std;
void Create(int* a, const int size, const int Low, const int High)
{
for (int i = 0; i < size; i++)
a[i] = Low + rand() % (High - Low + 1);
}
void Print(int* a, const int size)
{
for (int i = 0; i < size; i++)
cout << setw(4) << a[i];
... | ALGO | 0.996883 | 4.419168 |
dc1a97b5-9547-4eec-9f86-bb3c0544d265 | Aurorabili/oi-homework | single_files/gdmuoj/T10.cpp | #include <iostream>
int main() {
using namespace std;
int profit, price = 0;
cin >> profit;
switch (profit / 100000) {
case 0:
price = profit * 0.1;
break;
case 1:
price = 10000 + (profit - 100000) * 0.075;
break;
case 2:
case 3:
price = 10000 + 7500 + (profit - ... | ALGO | 0.997274 | 3.974966 |
a134956e-15c8-4128-a1ba-632e2f78a0d1 | Hannan181/Cpp | Graph/17_prims_optimised.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
vector<pair<int,int>>adj[n];
int a,b,wt;
for(int i=0;i<m;i++){
cin>>a>>b>>wt;
adj[a].push_back({b,wt});
adj[b].push_back({a,wt});
}
int parent[n],key[n];
bool mstSet[n];
for(int i=0;i<n;i++){
... | ALGO | 0.999983 | 4.413198 |
235095da-b4e7-4130-9e17-bfc3d237591f | programmer-k/Baekjoon-Online-Judge-Submission | 1699.cpp | #include <iostream>
#include <cmath>
#include <climits>
using namespace std;
int n;
int dp[100001];
void GetInput() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
cin >> n;
}
void Solve() {
for (int i = 1; i <= n; ++i) {
int minimum = INT_MAX;
for (int j = 1; j * j <= i; ++j) {
int prev = i ... | ALGO | 0.999853 | 4.41882 |
a7b8a6d5-d775-48c8-b948-caec23ad3c94 | jeremykvlim/kattis | open/holmes.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int d, m, n;
cin >> d >> m >> n;
vector<vector<int>> adj_list(d + 1);
while (m--) {
int a, b;
cin >> a >> b;
adj_list[b].emplace_back(a);
}
vector<bool> ... | ALGO | 0.999985 | 4.421113 |
b1ad06e1-6091-4b36-a5b0-803e736c7e8a | tholian-network/retrokit | Source/WebKit/UIProcess/API/glib/WebKitFindController.cpp | #include "config.h"
#include "WebKitFindController.h"
#include "APIFindClient.h"
#include "WebKitEnumTypes.h"
#include "WebKitWebViewPrivate.h"
#include <glib/gi18n-lib.h>
#include <wtf/glib/GRefPtr.h>
#include <wtf/glib/WTFGType.h>
#include <wtf/text/CString.h>
using namespace WebKit;
using namespace WebCore;
/**
... | TOOL | 0.979416 | 5.051958 |
7f65aa86-6e09-492e-be2e-afb366b197ac | Hantao-Ye/Struggle-in-LeetCode-v2 | topics/dp/121.cpp | #include <vector>
class Solution
{
public:
int maxProfit(std::vector<int> &prices)
{
std::vector<std::vector<int>> dp(prices.size(), std::vector<int>(2, 0));
dp[0][0] = -prices[0];
for (size_t i = 1; i < prices.size(); i++)
{
dp[i][0] = std::max(-prices[i], dp[i - 1... | ALGO | 0.999972 | 6.128924 |
a3f9ba37-8687-4a17-90d0-37210e0a9862 | FabianGzCa/Competitive-Programming | Codeforces/Contest/Round 1017 (Div. 4)/C.cpp | #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<queue>
#include<stack>
#include<bitset>
using namespace std;
#define all(x) x.begin(), x.end()
#define pb push_back
#define sz(x) (int)(x).size(... | ALGO | 0.998918 | 3.460154 |
e350f525-5358-4b21-a10f-80ab40f4c7d5 | akamya997/PracticeCode | 201912_practice/arc064/c.cpp | #include<bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#define dbg(x...) do{cout << "\033[32;1m" << #x << "->" ; err(x);} while(0)
void err(){cout << "\033[39;0m" << endl;}
template<template<typename...> class T,typename t,typename... A>
void err(T<t> a,A... x){for (auto v:a) cout << v << ' '; err(x...);}
te... | ALGO | 0.999854 | 3.563557 |
cb040330-a7ed-4961-b8e0-a6def87266ce | lisyaoran51/ZometoolConstructor | ZomeToolConstructor1/PolynomialList.cpp | #include "PolynomialList.h"
PolynomialList::PolynomialList()
{
std::pair< int , float > constantTerm( -1 , 0.0f );
polynomial.insert( constantTerm );
isBall = false;
isVirtualBall = false;
}
PolynomialList::PolynomialList( Eigen::SparseMatrix<float,Eigen::RowMajor>* m , Eigen::VectorXf* v )
{
std::pair< int , fl... | TOOL | 0.959906 | 3.120265 |
edb17c66-b538-4816-b09a-1be5c69ecdb6 | ishandutta2007/codeforces | marckess/normal/390/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define fi first
#define se second
#define MOD(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define FOR(i,n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef vector<int... | ALGO | 0.999962 | 3.787694 |
8dddd223-2e7f-459c-82f3-f3d30e760e81 | khaledsliti/CompetitiveProgramming | Codeforces/Contests/CF1285/b.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define endl '\n'
const int N = 1e5 + 5;
int n;
int arr[N];
int main()
{
int T;
scanf("%d", &T);
while(T--){
scanf("%d", &n);
long long sum = 0;
... | ALGO | 0.999971 | 4.657906 |
ebeff141-7bd7-447d-9ffa-923dd7b70cb6 | yash0patel/progress-path | cpp/Inharitance/multilevel.cpp | // Demonstrating Multilevel Inheritance
#include <iostream>
using namespace std;
#include <iostream>
class objA
{
public:
void obj1()
{
cout << "A" << endl;
}
};
class objB : public objA
{
public:
void obj2()
{
cout << "B" << endl;
}
};
class objC : public objB
{
public:
... | TOOL | 0.913079 | 4.262163 |
9b53c3aa-9119-49af-9fd2-46bcf5ed7918 | SecONNds/SecONNds_1_25 | SCI/src/BuildingBlocks/truncation-cheetah.cpp | // Author: Zhichong Huang
#define TRUNC_PRINT_TIME 0
#define TRUNC_PRINT_COMM 0
#if TRUNC_PRINT_TIME || TRUNC_PRINT_COMM
#include <iomanip>
#endif
void Truncation::truncate(int32_t dim, uint64_t *inA, uint64_t *outB,
int32_t shift, int32_t bw, bool signed_arithmetic,
... | ALGO | 0.998968 | 4.792613 |
bd7a1a48-8d54-494f-b57e-1a43f8f04cac | Harsh1118/DSA-PROBLEMS | Detect Loop in Linked list Approach-1.cpp | /*
You are given the head of a singly linked list. Your task is to determine if the linked list contains a loop.
A loop exists in a linked list if the next pointer of the last node points to any other node in the list
(including itself), rather than being null.
Custom Input format:
A head of a singly linked list an... | ALGO | 0.999949 | 5.141356 |
e38cc94d-5388-453f-a7e5-ff79e16474c2 | uditamujumdar/competitive-programming | A_Adjacent_Digit_Sums.cpp | #include <bits/stdc++.h>
using namespace std;
#define tc() int t;cin>>t;while(t--)
#define ll long long
void f(){
int x,y;
cin>>x>>y;
// if(x%10==x && y%10==y){
// if(y-x==1){
// cout << "Yes" << endl;
// }
// else{
// cout << "No" << endl;
// }
... | ALGO | 0.999941 | 4.266736 |
0053de44-a9d7-4626-b305-823706881055 | daliziBest/leetcode | solution146v1.cpp | class LRUCache {
public:
LRUCache(int capacity) {
NUM = capacity;
}
int get(int key) {
auto iter = cache.find(key);
if (iter == cache.end()) //没找到
return -1;
int result = (iter->second).first;
//更新缓存访问时间,变成最新
if (key_in_LRU.front() != key)
... | ALGO | 0.999445 | 5.825534 |
293318bb-31a3-48a4-aa8e-662aa934f7cc | AbhishekNayak-Programmer/Liza-cpp | Q42.cpp | // Linear Search - Go to every element in the array to search for a specific number [Here in linear search the array elements are arranged in any order as order does not matters]
// Binary Search - [Order Matters, Ascending Order]
// 1 2 3 4 5 6 7 8 9 10 11 12 target = 5
// 1 2 3 4 5 target = 5
// 4 5 target = 5
// ... | ALGO | 0.999811 | 6.616764 |
6dc577d9-5937-4e91-b1e9-6addee820505 | iankitnain/SdeSheetChallenge | 3_NextPermutation.cpp | #include <bits/stdc++.h>
vector<int> nextPermutation(vector<int> &p, int n)
{
int i;
for(i=p.size()-1;i>0;i--)
{
if(p[i]>p[i-1])
{
int j=i;
int k=i;
for(;j<p.size();j++)
{
if(p[j]>p[i-1])
k=j;
}
... | ALGO | 0.999965 | 4.898929 |
ec356d14-1501-4bb9-9f43-9b3571d052a7 | alexandraback/datacollection | solutions_5708921029263360_0/C++/penguin2/c.cpp | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<string>
#include<math.h>
#include <algorithm>
using namespace std;
#define LL long long
#define LD long double
#define FM(i,a,b) for(int i=a;i<b;i++) //(b-a) times a ~ b-1
#define P_T "C"
#define I_T "small-attempt0"
#define FILE_OPEN() char name1[50],n... | ALGO | 0.999788 | 3.154769 |
1634d37b-7bd4-4f53-8264-eb0d7a683e27 | aaumar/IFOPTMinGW | IFOPT Example/app/main.cpp | #include <iostream>
#include <ifopt/problem.h>
#include <ifopt/ipopt_solver.h>
#include <problem.hpp>
using namespace ifopt;
int main()
{
// 1. define the problem
Problem nlp;
nlp.AddVariableSet (std::make_shared<ExVariables>());
nlp.AddConstraintSet(std::make_shared<ExConstraint>());
nlp.AddCostSet ... | ALGO | 0.997446 | 5.976162 |
99c3186c-915b-4c78-a226-0be5caf91c6d | ishandutta2007/codeforces | pyqe/normal/1505/B.cpp | #include <bits/stdc++.h>
using namespace std;
long long n;
int main()
{
long long sm;
scanf("%lld",&n);
for(;n>=10;)
{
sm=0;
for(;n;n/=10)
{
sm+=n%10;
}
n=sm;
}
printf("%lld\n",n);
} | ALGO | 0.999984 | 4.4125 |
12d91b1b-6cc2-4d69-be2e-ca321b0f555a | ishandutta2007/codeforces | xlk/normal/220/B.cpp | #include<stdio.h>
#include<iostream>
#include<string.h>
#include<stdlib.h>
#include<algorithm>
#include<vector>
#include<map>
#define X first
#define Y second
using namespace std;
#define fr(i,n) for(int i=0;i<n;i++)
#define fo(i,n) for(int i=1;i<=n;i++)
#define fe(i,n) for(__typeof(n.begin()) i=n.begin();i!=n.end();i+... | ALGO | 0.999943 | 3.4498 |
4f16675c-2493-43f4-aedd-455ae1245b47 | roti-time/sem4 | OS/OS-lab/labs-Ahmad/Lab06/Task#1.cpp | #include <iostream>
#include <sys/wait.h>
#include <unistd.h>
#include <string.h>
#include <cstdlib>
#include <ctime>
#include <random>
using namespace std;
int main()
{
int votes[3] = {0, 0, 0};
int pipfd[2];
if (pipe(pipfd) == -1)
{
cout << "Error in pipe";
return 1;
}
cout <<... | ALGO | 0.999259 | 4.147333 |
20e29afc-bb03-47fe-aefb-34dd4c367ce3 | jlp1701/mrshv2 | src/BloomFilterHash.cpp | //
// Created by Burndi on 04.10.2019.
//
#include "../include/BloomFilterHash.h"
BloomFilterHash::BloomFilterHash(uint32_t m, uint32_t bfMax) : m{m}, bfMax{bfMax}{
bf = 0;
}
void BloomFilterHash::insertHash(uint64_t hashVal){
if (bfList.empty() || bfList.back()->size() >= bfMax){
bfList.emplace_back... | ALGO | 0.96614 | 5.461854 |
7556facb-58dd-4884-bef0-f5a3c56fa788 | yinchunlong/abelkhan-1 | ext/c++/thirdpart/c++/boost/libs/numeric/odeint/examples/harmonic_oscillator.cpp | #include <iostream>
#include <vector>
#include <boost/numeric/odeint.hpp>
//[ rhs_function
/* The type of container used to hold the state vector */
typedef std::vector< double > state_type;
const double gam = 0.15;
/* The rhs of x' = f(x) */
void harmonic_oscillator( const state_type &x , state_type &dxdt , const ... | ALGO | 0.998694 | 7.235958 |
6f9ad30b-dccf-405e-8d8e-210256f3722f | Madhavan0210/TUF-A2Z-DSA | Sliding Window & Two pointer/Number of substrings containing all the three elements.cpp | #include<bits\stdc++.h>
using namespace std;
class Solution{
public:
int NSubstrings(string s)
{
int cnt=0;
int hash[3]={-1,-1,-1};
for(int i=0;i<s.length();i++)
{
hash[s[i]-'a']=i;
cnt=cnt+(1+min(hash[0],min(hash[1],hash[2])));
}
return cnt;
}
};
int main()
{
freopen("input.txt","r",st... | ALGO | 0.999902 | 4.051885 |
173ea22c-5560-49dc-869c-35738760f97d | minblock/seizecoin | src/rpc/net.cpp | #include <rpc/server.h>
#include <banman.h>
#include <chainparams.h>
#include <clientversion.h>
#include <core_io.h>
#include <net.h>
#include <net_processing.h>
#include <netbase.h>
#include <policy/policy.h>
#include <rpc/protocol.h>
#include <rpc/util.h>
#include <sync.h>
#include <timedata.h>
#include <ui_interfac... | WEB | 0.866265 | 4.926382 |
1e6ddcd5-3c7d-4b41-911a-3c6065b1d985 | amujii/DSA_Practice | 6. SEARCHING AND SORTING/using_STL_searching.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
//in array
int arr[]={1,2,3,4,5,6,7,8,9};
int size=7;
if(binary_search(arr,arr +size, 7)){
cout<<"found"<<endl;
}else{
cout<<"not_found"<<endl;
}
//in vector
vector<int>vrr{1,2,3,4,5... | ALGO | 0.999407 | 4.776788 |
a13235ff-8498-402f-a0b2-455b75118279 | koosaga/olympiad | ICPC/Korea/pre18_e.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 500005;
using lint = long long;
using pi = pair<int, int>;
#define sz(v) ((int)(v).size())
int n, w;
lint a[MAXN];
int dp[MAXN];
bool trial(lint x){
dp[0] = 1;
int p1 = 0, p2 = 0;
for(int i=1; i<=n; i++){
while(a[i] - a[p1] >= x) p1++;
while(a[i] -... | ALGO | 0.999908 | 3.630543 |
37bd3913-e375-48ca-b484-befcd14b49e2 | iuyoy/basicCSKnowledge | leetcode/654. Maximum Binary Tree/mbt.cpp | /*
Given an integer array with no duplicates. A maximum tree building on this array is defined as follow:
The root is the maximum number in the array.
The left subtree is the maximum tree constructed from left part subarray divided by the maximum number.
The right subtree is the maximum tree constructed from right par... | ALGO | 0.999996 | 6.799098 |
6770b87a-0168-4e2d-a3dc-30570ff9d0d4 | LeeJuCheon/LDSO_SLAM | thirdparty/g2o/g2o/core/hyper_dijkstra.cpp | #include <queue>
#include <deque>
#include <vector>
#include <assert.h>
#include <iostream>
#include "hyper_dijkstra.h"
#include "../stuff/macros.h"
namespace g2o{
using namespace std;
double HyperDijkstra::TreeAction::perform(HyperGraph::Vertex* v, HyperGraph::Vertex* vParent, HyperGraph::Edge* e){
(void) v... | ALGO | 0.999782 | 4.596799 |
fa5ab2f5-389e-4225-81ba-99a77204c1ce | megacharles56/AdventOfCode | day1.cpp | #include<bits/stdc++.h>
#define io_ ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;
int main(){
io_
int x;
int ans=0;
vector<int> v(200);
for(int i = 0; i < 200; i++){
cin >> v[i];
}
for(int i = 0; i < 198; i++){
cout << i << " = " << v[i] << "\n";
uno... | ALGO | 0.999695 | 3.570536 |
67083856-53f6-4321-87df-232b01c390fd | ishandutta2007/codeforces | teraqqq/normal/1270/C.cpp | #include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define rsz resize
using namespace std;
using vi = vector<int>;
using ll = long long;
using pi = pair<int, int>;
using vpi = vector<pi>;
using vl = vector<ll>;
const ll LINF = 1e18;
const int INF = 1e9;
void solve() {
int n; cin >> n... | ALGO | 0.999388 | 3.259927 |
f9e0b1b6-eeed-48ae-bdbd-67af05d596e6 | Adityaweb3/Data-Structures-and-Algos | neetcode_150/greedy/shortest_job_first.cpp | // Problem Link : https://www.geeksforgeeks.org/problems/shortest-job-first/1
class Solution {
public:
long long solve(vector<int>& bt) {
// code here
long long wt = 0 ;
long long t=0 ;
int n =bt.size() ;
sort(bt.begin() , bt.end()) ;
for(int i = 0 ; i... | ALGO | 0.999945 | 4.760033 |
eca02fb8-be87-4e80-8679-3e7ae99a4d9d | HanYouyang/Computer | 数据结构与算法/PATCode/乙级/basic/1025. 反转链表 (25).cpp | #include<iostream>
#include<algorithm>
const int maxn = 100010;
struct Node
{
int last, next;
int element;
int order = maxn;
}node[maxn];
bool compare(const Node &a, const Node &b)
{
return a.order < b.order;
}
int main()
{
int first, N, K, address;
std::cin >> first >> N >> K;
for (int i = 0; i < N; ++i)
{
... | ALGO | 0.999877 | 3.3795 |
5cc34cf1-cfe5-4e31-b615-a2672da7f5ea | seoyamin/Algorithm-Study | seoyamin/Programmers/[Lv.1] 바탕화면 정리.cpp | #include <string>
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
vector<int> solution(vector<string> wallpaper) {
vector<int> answer;
vector<int> x;
vector<int> y;
int n = wallpaper[0].size();
for(int i=0 ; i<wallpaper.size() ; i++) {
for(int j=0 ... | ALGO | 0.997624 | 3.952305 |
b9dc2f74-e5ab-407a-b20d-134131bc66a4 | URSec/Silhouette-Compiler-Legacy | lib/Bitcode/Writer/ValueEnumerator.cpp | #include "ValueEnumerator.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/IR/Argument.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/DerivedT... | TOOL | 0.937565 | 7.874916 |
143e5fb7-1c6e-4091-9032-2a3a01aed6f2 | akshay-gupta03/LeetCode--Solved-Questions | 0082-remove-duplicates-from-sorted-list-ii/0082-remove-duplicates-from-sorted-list-ii.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* deleteDupli... | ALGO | 0.999949 | 5.699291 |
9af05efc-ff2b-46fb-a283-884739649089 | singhalshubh/Conveyors-Design-Reinvented | testing-with-conveyors/bale_actor/test/triangle_selector_lambda.cpp | /*! \file triangle.upc
* \brief Demo application that counts triangles in a graph.
*/
#include <math.h>
#include <shmem.h>
extern "C" {
#include "spmat.h"
}
#include <std_options.h>
#define USE_LAMBDA
#include "selector.h"
#define THREADS shmem_n_pes()
#define MYTHREAD shmem_my_pe()
int64_t* count_global = nullptr... | ALGO | 0.981218 | 5.29304 |
874bdb2f-9c0f-4c7f-b619-da81e48b7136 | rahimuj570/onlineCp | twins cf.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define bdb(x) cout<<bitset<10>(x)<<endl;
#define db(x) cout<<(x)<<endl;
#define pb push_back;
int main(){
fast;
#ifndef ONLINE_JUDGE
... | ALGO | 0.999941 | 3.757545 |
bf0cc09c-6500-4ed7-b219-7d2d9089ae19 | mahmudulhn/SolvedProblem | Vjudge/LightOJ/1053/17109327_AC_0ms_2088kB.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int test;
scanf("%d",&test);
for(int i=1;i<=test;i++)
{
double a[3];
for(int j=0;j<3;j++)
scanf("%lf",&a[j]);
sort(a,a+3);
if(pow(a[2],2)==(pow(a[1],2)+pow(a[0],2)))
printf("Case %d: yes\n",... | ALGO | 0.999232 | 3.918608 |
9d155103-e2ca-457c-9d1f-c0a24c80de27 | sumayyaDev/cpp | Bootcamp_S13/cf_contest/Round#812_Div-2/D_Tournament.cpp | #include<bits/stdc++.h>
using namespace std;
int ask(vector<int> k)
{
int x;
cout<< "? " << k[0] << " " << k[2] <<endl;
cin>> x;
if(x==1){
cout<< "? " << k[0] << " " << k[3] <<endl;
cin>> x;
if(x==1) return k[0];
else return k[3];
}
else if(x==2){ //2 change
cout<< "... | ALGO | 0.999484 | 3.393342 |
17a4c97e-3959-4b84-b00e-acc02fcc7a80 | ishandutta2007/codeforces | sw2000/normal/1520/C.cpp | #include<bits/stdc++.h>
#define lo (o<<1)
#define ro (o<<1|1)
#define fi first
#define se second
#define mid (l+r>>1)
using namespace std;
typedef long long ll;
typedef unsigned long long ul;
typedef vector<int>vi;
typedef pair<int, int>pii;
const int inf = 0x3f3f3f3f;
const ll linf = 0x3f3f3f3f3f3f3f3f;
const int N = ... | ALGO | 0.999708 | 3.972718 |
aae7d160-872c-428c-a42f-5a6a1a8e843d | raulgoce/porfolio | Medium/12.Punteros/132.01.Ejercicio.Par_impar_punteros.cpp | /* 1. Determinar si un numero es par o impar y sealar la posicion de memoria. */
#include <iostream>
#include <conio.h>
using namespace std;
int main(){
int number,*dir_number;
dir_number=&number;
cout<<"Introduzca un numero: "; cin>>number;
if(*dir_number%2==0){
cout<<"El numero "<<*dir_number<<" es par. "<<... | ALGO | 0.992852 | 3.323222 |
0f76aa87-b7e3-4ff0-83ac-8b24409f3a40 | darele/Darwin-Piche | Codeforces/Unclue Bogdan and country hapiness.cpp | /*
https://codeforces.com/contest/1388/problem/C
*/
#include <bits/stdc++.h>
#define ll long long
#define ii pair <int, int>
#define dl pair <ll, ll>
#define vi vector <int>
#define vl vector <ll>
#define vii vector <ii>
#define graph vector <vi>
#define REP(a, b) for (int i = a; i < b; i++)
#define REP2(a, b) for (in... | ALGO | 0.99989 | 4.272611 |
0a87a9fb-59f8-4c6d-9224-24b7b67d38c9 | Shintaro0105/Competitive-programming | atcoder/abc/320/c.cpp | #include <iostream>
#include <vector>
#include <set>
#include <array>
#include <cmath>
#include <string>
#include <algorithm>
#include <functional>
#include <map>
#include <tuple>
#include <queue>
#include <stack>
#include <bitset>
#include <deque>
#include <iomanip>
#define rep(i,n) for(int i = 0;i <= (n);i++)
#define... | ALGO | 0.999922 | 4.173784 |
58167677-5329-4c00-8012-f6bc032c5545 | son0179/ttt | _PSmine/PS모음/c/a615_2.cpp | #include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main(){
int i,j,a[10]={0};
int s=0, e=9, ch,tmp;
srand((unsigned)time(NULL));
for(i=0 ; i<=9 ; i++){
a[i]=rand()%101;
printf("%4d",a[i]);
}
printf("\n");
do{
ch=0;
for(i=s ; i<e ; i++){
if(a[i]>a[i+1]){
tmp=a[i];
a[i]=a[i+1];
a[i+1]... | ALGO | 0.999841 | 3.113931 |
032a982f-7db1-407f-8bec-6ad2499532c9 | svanshuu/python | rhs111.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cout<<"enter any no n";
cin>>n;
int r=n ,i=1;
while(i<=n)
{
int s=n-i+1;
while(s)
{
cout<<r;
s= s-1;
} cout<<endl;
r=r-1;
}
return 0;
} | ALGO | 0.999855 | 3.576359 |
37db3d77-57b6-47ff-a6fa-57fc450850d5 | darkendth/solved_problems | string/countPalindromSubstrings.cpp |
// Given a string s, return the number of palindromic substrings in it.
// Input: s = "abc"
// Output: 3
// Explanation: Three palindromic strings: "a", "b", "c".
class Solution {
public:
int countSubstrings(string s) {
int n=s.size();
int dp[n][n];
if (n==1)
return 1;
... | ALGO | 0.999596 | 6.761487 |
a960a7f0-5f50-4725-9980-fbd4476fae0c | aditya13902/Leetcode | Number of Provinces - GFG/number-of-provinces.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution {
public:
void bfs(vector<vector<int>>&adj,int v,vector<int>&vis){
queue<int>q;
q.push(v);
vis[v]=1;
while(q.size()){
auto curr=q... | ALGO | 0.999979 | 6.641521 |
d99d7ccc-870d-4e11-b189-16bba871e486 | shekarharsha/programming-sites | HackerRank/SherlockandWatson.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <deque>
using namespace std;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
ios::sync_with_stdio(false);
freopen("sherlock_watson.txt", "r", stdin);
int N, K, Q;
cin >>... | ALGO | 0.999763 | 3.257659 |
38758def-b45d-4c2a-b7dd-54aeba0fcda3 | shivamiitg/MyCpp | PrintSubArray.cpp | #include<iostream>
using namespace std;
void print_subarray(int arr[], int n){
for(int i=0; i<n; i++){
for(int j=i; j<n; j++){
for(int k=i;k<=j;k++){
cout<<arr[k]<<", ";;
}
cout<<endl;
}
}
}
int main(){
int arr[]={10,20,30,40,50};
in... | ALGO | 0.964989 | 4.04787 |
668d8900-2f73-48bd-8bf1-09d70a13977b | chriswengqi/kattis | spiderman/spiderman.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
#define int ll
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> ... | ALGO | 0.999992 | 5.359655 |
f31a1977-1b25-4820-8470-578f4a2e4979 | Ethan707/Sparcraft | source/Player_MoveBackward.cpp | #include "Player_MoveBackward.h"
using namespace SparCraft;
Player_MoveBackward::Player_MoveBackward (const IDType & playerID)
{
_playerID = playerID;
}
void Player_MoveBackward::getMoves(GameState & state, const MoveArray & moves, std::vector<Action> & moveVec)
{
moveVec.clear();
IDType enemy(state.getEnemy(_... | ALGO | 0.991975 | 5.568782 |
4ca1b48f-6b93-4029-8de0-471d2b47c489 | loal123/CP | codeforces/Codeforces_Contest_28/C_Which_floor.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vl vector<ll>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define all(v) v.begin(), v.end()
#define SZ(x) ((int)... | ALGO | 0.999946 | 3.804203 |
1498660b-a8df-4894-b61b-a8efdd9a4144 | AigaGoto/AtCoders | BiginnerContest/274/D.cpp | #include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <iomanip>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int N, x, y, inp;
vector<int> p_X;
vector<int> p_Y;
int nx, ny;
int main() {
c... | ALGO | 0.999995 | 3.827208 |
cf0ce1f8-e190-40e1-b717-421371785b48 | KwanWaiPang/raw_DEVO | thirdparty/eigen-3.4.0/bench/bench_norm.cpp | #include <typeinfo>
#include <iostream>
#include <Eigen/Core>
#include "BenchTimer.h"
using namespace Eigen;
using namespace std;
template<typename T>
EIGEN_DONT_INLINE typename T::Scalar sqsumNorm(T& v)
{
return v.norm();
}
template<typename T>
EIGEN_DONT_INLINE typename T::Scalar stableNorm(T& v)
{
return v.sta... | TEST | 0.979535 | 6.694365 |
bfd9c30d-63a2-4fce-928a-ded7aef80f41 | Shohan07/Problem-Solving | combination_with_recursion.cpp |
#include<bits/stdc++.h>
using namespace std;
long long int ncr(long long int n,long long int r)
{
if(n==r) return 1;
if(r==0) return 1;
return ncr(n-1, r-1) + ncr(n-1, r);
}
int main()
{
long long int n,m;
while(1){
cin>>n>>m;
if(n == 0 && m == 0) break;
cout<<n<<" thing... | ALGO | 0.999821 | 5.266813 |
9cb2bbac-9da3-41bf-9f01-622b44fccc38 | Nodrev/intel-tbb-4.2 | src/test/test_parallel_while.cpp | #include "tbb/parallel_while.h"
#include "harness.h"
const int N = 200;
typedef int Element;
//! Representation of an array index with only those signatures required by parallel_while.
class MinimalArgumentType {
void operator=( const MinimalArgumentType& );
long my_value;
enum {
DEAD=0xDEAD,
... | TEST | 0.949791 | 5.083052 |
28dd6440-af70-4a85-8948-4d013072fff1 | akshat1404/dynamicProgramming | minTrianlgeSum.cpp | #include<bits/stdc++.h>
using namespace std;
/*
recursive+memoize
int t[201][201];
int solve(vector<vector<int>>& triangle,int index,int col,int n){
if(index==n) return 0;
if(t[index][col]!=-1) return t[index][col];
return t[index][col]=min(solve(triangle,index+1,col,n),solve(triangle,index+1,col+1,n))... | ALGO | 0.999913 | 5.304861 |
aeb2141b-5760-455c-a73b-79188d6b00b1 | karan2612/cytoskeleton | cytoskel.cpp | #include "global.h"
#include "init.h"
#include "physics.h"
#include "analysis.h"
#include "inputModule.h"
int main() {
cout << "hello world!" << endl;
init();
physics();
filesClose();
return 0;
}
void init() {
/* Read input, Write Log, Set Output, Seed Rand */
readInput();
printLog();
randInit(... | ALGO | 0.925975 | 3.369194 |
75d5b33d-11bb-431a-ad64-94ed1e9fa9c0 | Atanu0341/0-to-dsa | patterns-III/butterfly-star-pattern/solution.cpp | #include<iostream>
using namespace std;
int main() {
int num;
cout<<"Enter the number of rows for the pattern: ";
cin>>num;
// 1st half
for (int row = 1; row<=num; row++) {
// print star
for (int cols = 1; cols<=row; cols++){
cout<<"*";
}
// print s... | ALGO | 0.999858 | 4.694987 |
3595e2f9-8bf7-4b89-b4a2-36ed683a2851 | tholian-network/retrokit | Source/WebCore/platform/SharedStringHash.cpp | #include "config.h"
#include "SharedStringHash.h"
#include <wtf/URL.h>
#include <wtf/text/AtomString.h>
#include <wtf/text/StringHash.h>
#include <wtf/text/StringView.h>
namespace WebCore {
template <typename CharacterType>
static inline size_t findSlashDotDotSlash(const CharacterType* characters, size_t length, siz... | TOOL | 0.973424 | 7.458014 |
2d18848e-7096-4340-910c-4ca50fcad045 | Crazyhenry123/Calolens | Builds/Il2CppOutputProject/IL2CPP/libil2cpp/icalls/mscorlib/System/MonoType.cpp | #include "il2cpp-config.h"
#include "il2cpp-class-internals.h"
#include "il2cpp-object-internals.h"
#include "il2cpp-tabledefs.h"
#include "gc/Allocator.h"
#include "icalls/mscorlib/System/MonoType.h"
#include "utils/Functional.h"
#include "utils/StringUtils.h"
#include "utils/Il2CppHashMap.h"
#include "vm/Array.h"
#in... | TOOL | 0.872467 | 5.916669 |
bd8e7bf0-eb3d-4d3a-912a-ae85a1a67f05 | UFOsonzz/Competitive-Programming | CODEFORCES/CF_1891/F.CPP | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e5 + 5;
int n, in[MAXN], out[MAXN];
vector<int> adj[MAXN];
vector<tuple<int, int, int>> queries;
struct BIT {
long long *tree;
int n;
BIT(int sz) :
n(sz), tree(new long long[sz + 2]) {
memset(tree, 0, sizeof(long long) *... | ALGO | 0.999831 | 4.483832 |
c465d273-80b2-4098-9a75-395620591827 | tinaoberoi/progreso-diario | Languages/c++/imp-probs/dijkstra/planets.cpp | /*
https://codeforces.com/problemset/problem/229/B
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
unordered_set<int> waits[100001];
unordered_map<ll, list<pair<ll, ll>>> graph;
ll helper(ll n){
vector<ll> dist(n+1, -1);
queue<pair<int,int>> q;
q.push({1, 0});
while(!q.empty()){
ll len = q.... | ALGO | 0.999838 | 3.861711 |
d09016c4-dcb8-4aff-b004-055ad5b7f2c9 | SaintCEN/Data-Structure | 图/PTA/通婚.cpp | #include <bits/stdc++.h>
using namespace std;
struct Person
{
char sex;
pair<int, int> parents;
};
unordered_set<int> getAncestors(int id, unordered_map<int, Person> &people)
{
unordered_set<int> ancestors;
queue<pair<int, int>> q;
int father = people[id].parents.first;
int mother = people[id... | ALGO | 0.999956 | 4.252911 |
ce73f057-0482-4758-bef4-08bbb48bed7c | niranjan-ithape/C-and-DSA | 2Darray3.cpp | #include<iostream>
using namespace std;
int MaxNumber(int arr[][3],int row,int col)
{
int maxi=INT16_MIN;
for(int i=0;i<row;i++)
{
for(int j=0;j<col;j++)
{
if(arr[i][j]>maxi)
{
maxi=arr[i][j];
}
}
}
return maxi;
}
int main()... | ALGO | 0.998936 | 4.039576 |
4fdf3bea-d88e-4b9a-9eb8-894906b2200f | LiuLiC/LeetCodePractice | algorithm/22.generate-parentheses.cpp | /*
* [22] Generate Parentheses
*
* https://leetcode.com/problems/generate-parentheses/description/
*
* algorithms
* Medium (51.45%)
* Total Accepted: 270.1K
* Total Submissions: 525K
* Testcase Example: '3'
*
*
* Given n pairs of parentheses, write a function to generate all combinations
* of well-for... | ALGO | 0.999514 | 6.417339 |
4f676265-1dde-409a-adae-25e4fb1778e6 | hieupham1103/TINHOC | SCHOOL/Thay Huong/Prob/DIS.cpp | #include<bits/stdc++.h>
#define ii pair <int,int>
#define fi first
#define se second
#define int long long
#define double long double
#define endl '\n'
using namespace std;
const int maxN = 2 * 1e3 + 10;
const int inf = 1e18;
const int mod = 1e9 + 7;
int dp[maxN][maxN];
int a[maxN];
int ans[maxN];
signed main(){
... | ALGO | 0.999858 | 3.464442 |
a4405b72-1a4d-49d8-a3e9-0a53b375d167 | minjungsung/Algorithm | LeetCode/Maximum-Number-of-Integers-to-Choose-From-a-Range-I/Solution.cpp | Input: banned = [1,6,5], n = 5, maxSum = 6
Output: 2
Explanation: You can choose the integers 2 and 4.
2 and 4 are from the range [1, 5], both did not appear in banned, and their sum is 6, which did not exceed maxSum.
| ALGO | 0.999992 | 6.480081 |
15c4f341-be61-44ee-b81b-7b60d62b383d | PanGDX/cpp-competitive-programming | try.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int N, W;
ll weight[102], value[102], dp[102][100004]; // dp[i][j] = value from [1,i], j represents weight cumulated
int main() {
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
// freopen("_input.txt","r",stdin);
// freopen("_ou... | ALGO | 0.999997 | 4.569325 |
10e93b58-e50f-49c5-aff1-7db382f70186 | lazygupta/Coding-Problems | Sliding Window/exactly k questions/1248.CountNumberofNiceSubarrays.cpp | // Same as Subarrays with sum excatly k
// #Exactly K times = at most K times - at most K - 1 times
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
int maxSubarray(vector<int> &nums,int k){
int i=0,j=0;
int oddNumbers = 0,count = 0;
while(j<nums.size()){
... | ALGO | 0.999879 | 5.188254 |
78495b63-20b5-4225-a1ff-961462f393ab | mauryavinay1407/DSA-cpp | Graph/DSU/Detect_Cycle_using_DSU.cpp | // problem: https://www.geeksforgeeks.org/problems/detect-cycle-using-dsu/1
/*
Approach- Using Disjoint Set Union
Time Complexity: O(V+E)
Space Complexity: O(V)
*/
class Solution
{
public:
vector<int> parent;
vector<int> rank;
int find(int x){
if(x == parent[x])
return x... | ALGO | 0.99995 | 6.07509 |
155fd8e8-88d2-48c7-abe7-344a6ae8fbeb | SarbajitPbappy/CF | 1788C-MatchingNumbers.cpp | #include <cstdio>
int main(){
long t; scanf("%ld", &t);
while(t--){
long n; scanf("%ld", &n);
if(n % 2 == 0){puts("No"); continue;}
puts("Yes");
for(long p = 1; p <= n; p += 2){printf("%ld %ld\n", p, 2 * n - p / 2);}
for(long p = 2; p < n; p += 2){printf("%ld %ld\n", p,... | ALGO | 0.999521 | 3.847161 |
563ca599-a9cb-415e-939d-2c3a3edd67e6 | virtual1008/ujjvalleetcodesolution | 1679-max-number-of-k-sum-pairs/1679-max-number-of-k-sum-pairs.cpp | class Solution {
public:
int maxOperations(vector<int>& nums, int k) {
map<int,int> m;
for(auto it:nums) m[it]++;
int ans=0;
for(int i=0;i<nums.size();i++){
int rem=k-nums[i];
if(rem==nums[i]){
if(m[rem]>1){
ans+=(m[rem]/2);
... | ALGO | 0.999974 | 5.834728 |
7e76d970-8f7e-4286-bb4b-17e403211c70 | sammochen/cp-submissions | uva/11957.cpp | /*
Original problem:
Author: sammochen
*/
#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
using namespace std;
#define REP(x,l,u) for(ll x = l;x<u;x++)
#define RREP(x,l,u) for(ll x = l;x>=u;x--)
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define MP make_pair
string to_string(string s) {return s;}
s... | ALGO | 0.99989 | 4.32692 |
b14ce183-32ae-4740-a826-4ca1f456a70e | jeong011010/solved.ac | BAEKJOON/9205/9205.cpp | #include <iostream>
#include <queue>
#include <vector>
#include <cmath>
using namespace std;
int t;
int h_x, h_y, p_x, p_y;
vector<pair<int, int>> store;
void input()
{
int n, x, y;
cin >> n;
cin >> h_x >> h_y;
int tmp = store.size();
for (int i = 0; i < tmp; i++)
{
store.pop_back();
... | ALGO | 0.999948 | 4.253973 |
acb0efb1-7a27-4034-adaf-bfb5e5da3bfd | PrashantChoudhary13579/Data-Structure- | 24 September/doublelinkedlist.cpp | #include<iostream>
using namespace std;
struct Node {
int data;
Node *next;
Node *prev;
Node (int d)
{
this -> data = d;
this -> next = nullptr;
this -> prev = nullptr;
}
};
// traversing
void traversing(Node *head)
{
Node *node1 = head;
while (node1 != nullptr)
... | ALGO | 0.999943 | 5.680247 |
101c4059-4026-46a5-b66b-3b3a214030d8 | IcEy-999/MyUESource | Engine/Source/ThirdParty/PhysX3/PhysX_3.4/Source/GeomUtils/src/pcm/GuPCMContactSphereSphere.cpp | #include "GuGeometryUnion.h"
#include "GuContactBuffer.h"
#include "GuContactMethodImpl.h"
#include "PsVecTransform.h"
namespace physx
{
namespace Gu
{
bool pcmContactSphereSphere(GU_CONTACT_METHOD_ARGS)
{
PX_UNUSED(cache);
PX_UNUSED(renderOutput);
using namespace Ps::aos;
const PxSphereGeometry& shapeSphere0 = ... | ALGO | 0.963282 | 6.909424 |
dbb2e6df-013c-48f2-b514-a1690d06dfa9 | kkpan11/apple-llvm-project | libcxx/test/std/algorithms/algorithms.results/min_max_result.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14, c++17
// template <class I1, class I2>
// struct min_max_result;
#include <algorithm>
#include <cassert>
#include <type_traits>
#include "MoveOnly.h"
struct A {
explicit A(int);
};
// no implicit conversion
static_assert(!std::is_constructible_v<std::ranges::min_max_result<A>,... | TEST | 0.866235 | 7.150418 |
4298a3e7-7b95-4686-bf33-3920666dcef4 | AleksaMax24/ABCDE | abcde.cpp | #include "pch.h"
Abcde::Abcde() {}
Abcde::Abcde(const string& param)
{
config_file = param;
act_with_config_file();
init_posterior();
error = new double[count_iter];
}
void Abcde::normalize_weights()
{
double sum = 0.0;
for (int i = 0; i < count_iter; i++)
{
sum += new_posterior.w[i];
}
for (int i = 0; i ... | ALGO | 0.999176 | 3.957142 |
807161cb-c6be-4f59-990a-e855ee0fb10f | Kush134/DSA_VISUAL | public/codes/dfs/dfs.cpp | // CPP program to implement DFS
#include <iostream>
#include <vector>
using namespace std;
// Declaring the vectors to store color, predecessor,
// and time stamps d and f
vector<string> colour;
vector<int> p;
vector<int> d;
vector<int> f;
// Declaring time variable
int time;
/* This function adds an edge to the gra... | ALGO | 0.999982 | 6.649532 |
afe81640-87d8-4cfb-95b5-a8458203d31e | Srikar4510/Leetcode | 14-longest-common-prefix/longest-common-prefix.cpp | class Solution {
public:
string longestCommonPrefix(vector<string>& strs) {
int n = strs.size();
if(n==0) return "";
sort(strs.begin(),strs.end());
string first = strs[0],last =strs[n-1];
int i=0;
while(i<first.size()&&first[i]==last[i]){
i++;
}
... | ALGO | 0.999902 | 5.760604 |
0f91cd1a-8871-4e74-b9cf-78f2ae0a37d3 | hgddingjun/CppStudy | demo2/main.cpp | #include <iostream>
using namespace std;
int fibonacci(int number) {
if (number < 3) {
return 1;
}
return fibonacci(number - 1) + fibonacci(number - 2);
}
void fib_driver(int number) {
cout << "fibonacci(" << number << ")=" << fibonacci(number) << endl;
}
int main()
{
fib_driver(1);
... | ALGO | 0.977585 | 5.05846 |
0fca32e8-9e94-4f8e-9a34-f0e017bb7c24 | maxzil/opencv-docker-pi | opencv/modules/calib3d/src/levmarq.cpp | #include "precomp.hpp"
#include <stdio.h>
namespace cv
{
class LMSolverImpl : public LMSolver
{
public:
LMSolverImpl() : maxIters(100) { init(); }
LMSolverImpl(const Ptr<LMSolver::Callback>& _cb, int _maxIters) : cb(_cb), maxIters(_maxIters) { init(); }
void init()
{
epsx = epsf = FLT_EPSILON... | ALGO | 0.999758 | 6.37447 |
7669a107-77e0-4042-9236-be2036060102 | lepecoder/algorithms | leetcode_cn/1382.将二叉搜索树变平衡.cpp | /*
* @lc app=leetcode.cn id=1382 lang=cpp
*
* [1382] 将二叉搜索树变平衡
*/
// @lc code=start
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
#include <bits/stdc++.h>
using name... | ALGO | 0.999989 | 6.797484 |
dbe28882-45aa-4adc-9005-4db2870119f2 | Fiddich-Dev/Algorithm | week5/17407.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m, k;
int r, c, s;
int a[54][54];
int b[54][54];
int dy[] = {0, 1, 0, -1};
int dx[] = {1, 0, -1, 0};
int ret = 987654321;
struct A {
int r;
int c;
int s;
};
vector<A> v;
vector<int> v_idx;
int count(int b[54][54]) {
int z = 987654321;
for(... | ALGO | 0.999952 | 4.619814 |
ffede871-9e01-454a-97a6-ae0e31ce1537 | kronos/Task-solutions | acmp.ru/0000-0100/0071.cpp | #include <iostream>
using namespace std;
int i,ans=1000000,n;
int W[18];
void rec(int i, int w1, int w2)
{
if (i==n)
ans = min((int)labs(w1-w2),ans);
else
{
rec(i+1,w1+W[i],w2);
rec(i+1,w1,w2+W[i]);
}
}
int main()
{
freopen("input.txt", "rt", stdin);
freopen("output.txt", "wt", stdo... | ALGO | 0.999989 | 3.411932 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.