uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
9fef8d68-6c5e-465a-9c52-b6f1e21675d1 | kamrulashraf/Vjudge-mixed- | SPOJ/INVCNT/6780340_AC_320ms_159744kB.cpp | #include <bits/stdc++.h>
using namespace std;
#define NN 10000007
#define ll long long
ll n, tree[NN], a[NN], res, mmax;
void update(ll indx , ll val){
while(indx <= mmax){
tree[indx] += val;
indx += indx & -indx;
}
}
ll query(ll indx){
ll sum = 0;
while(indx){
sum += tree[indx];
indx -= indx & -... | ALGO | 0.999828 | 3.659386 |
82f10844-0874-40f4-aa33-927a2e208ea5 | amitk0091/LeetCode-daily-problem | 739_Daily Temperatures.cpp | class Solution
{
public:
vector<int> dailyTemperatures(vector<int> &temp)
{
// next greater element
// Monotonic stack
int n = temp.size();
vector<int> ans(n);
stack<int> st;
for (int i = n - 1; i >= 0; i--)
{
while (!st.empty() && temp[st.top()] <= temp[i])
{
st.pop(... | ALGO | 0.999956 | 6.18458 |
18d02710-6bd7-49a4-9fcd-cad4efa57f03 | raj21adittya/SPOJ-Classical-Problems-Solutions | Street Parade.cpp | //https://www.spoj.com/problems/STPAR/
//@bl!nd_m0n3y
//reference-----https://www.algorithmist.com/index.php/SPOJ_STPAR
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
while(n!=0){
int a[n];
for(int i=0;i<n;i++)
cin>>a[i];
stack<int> s;
int need=1;
bool ans=true;
for(int i=... | ALGO | 0.999923 | 3.97818 |
6ce4d2c5-ee7d-40eb-81ec-0e5f51a61418 | Simplebankdev/Simple. | src/utilstrencodings.cpp | #include "utilstrencodings.h"
#include "tinyformat.h"
#include <cstdlib>
#include <cstring>
#include <errno.h>
#include <limits>
using namespace std;
static const string CHARS_ALPHA_NUM = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
static const string SAFE_CHARS[] =
{
CHARS_ALPHA_NUM + " ... | TOOL | 0.96967 | 5.662208 |
8a71f426-639a-4a6c-bae1-ab4328811821 | stinkymonkey128/SL-SLAM | Thirdparty/Sophus/examples/HelloSO3.cpp | #include <iostream>
#include "sophus/geometry.hpp"
int main() {
// The following demonstrates the group multiplication of rotation matrices
// Create rotation matrices from rotations around the x and y and z axes:
const double kPi = Sophus::Constants<double>::pi();
Sophus::SO3d R1 = Sophus::SO3d::rotX(kPi / 4... | TEST | 0.850566 | 7.705746 |
6800d15d-fe57-460a-b707-3a6f33762717 | BlenderVR/blender | extern/bullet2/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp | #include "LinearMath/btScalar.h"
#include "SphereTriangleDetector.h"
#include "BulletCollision/CollisionShapes/btTriangleShape.h"
#include "BulletCollision/CollisionShapes/btSphereShape.h"
SphereTriangleDetector::SphereTriangleDetector(btSphereShape* sphere,btTriangleShape* triangle,btScalar contactBreakingThreshold)
... | ALGO | 0.998927 | 7.256827 |
bb3560a5-a0fd-47d4-bb68-694f6dfd4544 | nurakib/OJ-Problems-Solutions | UVa/uva_113.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int ans;
double n, p;
while(scanf("%lf %lf", &n, &p) == 2){
ans = pow(p, 1 / n) + 0.5;
printf("%d\n", ans);
}
return 0;
}
| ALGO | 0.999451 | 3.479153 |
5e06457f-285a-4ed3-b009-67c3b5ec83bc | chichchic/algorithmPrac | BaekJoon/2021/10October/211021_5419.cpp | #include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
using namespace std;
typedef long long ll;
const int SIZE = 1 << 18;
class SegmentTree
{
vector<int> arr;
int sum(int s, int e, int node, int ns, int ne)
{
if (e <= ns || ne <= s)
return 0;
if (s <= ns && e >= ne)
... | ALGO | 0.99987 | 4.902643 |
b4903a5f-6cdb-4090-a993-cf6d01c5ec1d | ishandutta2007/codeforces | yamunaku/normal/1207/A.cpp | //
// Created by yamunaku on 2019/08/22.
//
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define repl(i, l, r) for(int i = (l); i < (r); i++)
#define per(i, n) for(int i = ((n)-1); i >= 0; i--)
#define perl(i, l, r) for(int i = ((r)-1); i >= (l); i--)
#define all(x) (x... | ALGO | 0.999923 | 4.734785 |
1e4ac404-587f-4e3b-b11d-ad5df4c608ef | lattalab/slove-problem | Star 1/uva00948.cpp | //accept
#include <iostream>
using namespace std;
int table[40]={0,1}; //store fib (fib[40] = 102334155 ,is too big)
int main()
{
for(int i=2;i<40;i++) //initialize fib table
{
table[i]=table[i-1]+table[i-2];
}
int N, n, x;
cin >> N;
while (N--){
cin>>n;
cout<<n<<" = ";... | ALGO | 0.999884 | 3.85758 |
068da467-1bce-48f5-9f8d-d141b0a6e973 | KshithijSinghania/dsa | 4-median-of-two-sorted-arrays/median-of-two-sorted-arrays.cpp | class Solution {
public:
double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) {
int n1=nums1.size();
int n2=nums2.size();
if(n1>n2){
return findMedianSortedArrays(nums2,nums1);
}
int n=n1+n2;
int left=(n+1)/2;
int low=0;
in... | ALGO | 0.999983 | 6.2033 |
ae4f4132-5cf6-4f64-a0f4-00fb1a4449dc | zhangw/boost_1_59_0 | libs/polygon/benchmark/voronoi_benchmark_segments.cpp | // Boost.Polygon library voronoi_benchmark.cpp file
// See http://www.boost.org for updates, documentation, and revision history.
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <fstream>
#include <numeric>
#include <vector>
#include <utility>
#include <boost/random/mersenne_twister.hpp>
#includ... | TEST | 0.988862 | 6.895944 |
16f9826b-280f-4111-ab75-68eb5d155d12 | mholyaee/UOG_C_Plus_98-99-2 | Quiz04_StudentAvg.cpp | #include<iostream>
using namespace std;
//Quiz4
int main()
{
float list[10];
int i,count=0;
float avg,grade,sum=0;
for(i=0;i<10;i++)
{
cin>>list[i];
sum+=list[i];
}
avg=sum/10;
for(i=0;i<10;i++)
if(avg<=list[i])
count++;
cout<<"\nAverage is:"<<avg;
cout<<"\nNumber of Top students:"<<count;
}
| ALGO | 0.998877 | 3.189739 |
a43daedc-5a88-4122-9afa-aa924cf4143a | zhouxs1023/myway3d | ThirdParty/EMotionFX/Source/SimpleActorCollisionSystem.cpp | #include "SimpleActorCollisionSystem.h"
#include "Actor.h"
#include "Node.h"
#include "Mesh.h"
#include "SimpleMesh.h"
using namespace MCore;
namespace EMotionFX
{
// constructor
SimpleActorCollisionSystem::SimpleActorCollisionSystem(Actor* actor) : ActorCollisionSystem(actor)
{
}
// destructor
SimpleActorCollision... | ALGO | 0.885025 | 6.606351 |
1beb852a-bc5a-4815-94be-5364189becc3 | ishandutta2007/codeforces | gullesnuffs/normal/110/B.cpp | #include <stdio.h>
using namespace std;
int main()
{
int n;
scanf("%d", &n);
for(int i=0; i < n; ++i)
{
if(i % 4 == 0)printf("a");
if(i % 4 == 1)printf("b");
if(i % 4 == 2)printf("c");
if(i % 4 == 3)printf("d");
}
return 0;
} | ALGO | 0.999667 | 3.199381 |
fb28929d-ad2c-4369-853d-1129459fe374 | alePereira/INF6600 | TP2/SystemC2.0.1_Modifié/src/systemc/utils/sc_pq.cpp | /*****************************************************************************
sc_pq.cpp - Simple heap implementation of priority queue.
Original Author: Stan Y. Liao, Synopsys, Inc.
*****************************************************************************/
/************************************************... | ALGO | 0.986418 | 6.096177 |
f7422cae-f6f4-4c01-a347-701e01263e6f | EthanKim8683/High-School-Competitive-Programming | Codeforces/Problemset/DP/1057c.cpp | #include<bits/stdc++.h>
using namespace std;
using I=int;
using C=char;
using B=bool;
const I N=50;
const I MIN=-1e9;
const I MAX=1e9;
I r_arr[N];
C c_arr[N];
I inds[N];
I dp[N][N*N+1];
B cmp(I a,I b){
return r_arr[a]<r_arr[b];
}
I main(){
cin.tie(0)->sync_with_stdio(0);
fill(&dp[0][0],&dp[0][0]+N*(N*N+1),MIN);
... | ALGO | 0.999977 | 3.374373 |
451477fe-ec5d-4440-b415-d197bd276428 | HosamEissa/Competitive-programming- | Codeforces/CF633-D12-D.cpp | /*
Author: Hossam Eissa
Idea:use nested loop to try every two elemnts as start of the seqance and get the seqance
*/
#include<iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<stack>
#include<map>
#include<vector>
#include<unordered_map>
#include<set>
using namespace std;
#define ll long long
vec... | ALGO | 0.999953 | 3.708134 |
66082a5b-72f3-470f-8d2f-0eea2dab24b6 | apl-mhd/problemSolving | Data Structure and Algo Lab/binaryTree.cpp | #include <stdio.h>
#include <stdlib.h>
#include <iostream>
using namespace std;
struct tree{
char data;
struct tree *left;
struct tree *right;
};
typedef struct tree tree;
tree *root;
void inorder(tree *root){
if(root->left != NULL)
inorder(root->left);
printf("%c ", root->dat... | ALGO | 0.999309 | 3.601023 |
498712b1-9afb-4e7a-9957-4b812f87a92c | iagorrr/Competitive-Programming-Solutions | submissions/Codeforces/2117B.cpp | /*8<{==========~ BEGIN TEMPLATE ~============>8*/
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.cpp"
#else
#define dbg(...)
#endif
#define fastio \
ios_base::sync_with_stdio(0); \
cin.tie(0);
#define all(j) j.begin(), j.end()
#define rall(j) j.rbegin()... | ALGO | 0.99996 | 5.112875 |
43dd566a-1356-4e5c-b1fa-32339dc3b3bc | anuj2801/Cpp-snippets | rainwater.cpp | #include<bits/stdc++.h>
using namespace std;
void printt(vector<int> a)
{
for(auto i=a.end()-1;i>=a.begin();i--)
cout<<*i<<" ";
}
int waterUsingStack(vector<int> a)
{
stack<int> st;
int n=a.size(),ans=0;
for(int i=0;i<n;i++)
{
while(!st.empty() and a[st.top()] <a[i])
{ int cur=st.top()... | ALGO | 0.999967 | 5.024743 |
4105c0d0-a5a8-45c3-b208-5913468c6813 | ClockworkOrigins/clockUtils | libs/compression/src/algorithm/HuffmanFixed.cpp | #include "clockUtils/compression/algorithm/HuffmanFixed.h"
#include "clockUtils/errors.h"
#include <cassert>
#include <limits>
namespace clockUtils {
namespace compression {
namespace algorithm {
std::vector<uint8_t> preVec({
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
7, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,... | ALGO | 0.996492 | 6.44495 |
569f70be-269d-409e-b817-06534b513107 | a-koshmarov/ASD | TreeHeight/main.cpp | #include <iostream>
#include <fstream>
#include <algorithm>
using namespace std;
class Node {
public:
int value_;
Node *left_;
Node *right_;
Node(int val) : value_(val) {
left_ = NULL;
right_ = NULL;
};
// Node(int val, Node left, Node right){
// value_ = val;
// ... | ALGO | 0.999874 | 4.51925 |
9c729dcc-9aff-4ef0-aec0-a96fd7dbe775 | pazhanivel07/frameworks_av-CVE-2020-0218 | media/libstagefright/codecs/mp3dec/src/pvmp3_equalizer.cpp | /*
------------------------------------------------------------------------------
PacketVideo Corp.
MP3 Decoder Library
Filename: pvmp3_equalizer.cpp
Date: 09/21/2007
------------------------------------------------------------------------------
REVISION HISTORY
Description:
----------------------... | ALGO | 0.999102 | 4.754104 |
eaa6f1e8-fc12-4882-83b3-eabd6e466a0e | HisShadow85/SoftUni-Algo | week4_DynamicProgramming/homework/DividingPresents/dividingPresents.cpp | #include<iostream>
#include<vector>
#include<sstream>
#include<map>
using namespace std;
class DividingPresents{
static void dividingPresents(vector<int> &presents,vector<int> &result){
int maxPrezentsValue = 0;//the total presents value
int maxFindPresentSum = 0;//this will represent the most closest sum to... | ALGO | 0.999882 | 3.59965 |
276b9404-f835-424a-9e03-7536db8f3a7d | manfred-exz/leetcode_practice | Lexicographical Numbers.cpp | //
// Created by manfred-exz on 7/17/2017.
//
#include <vector>
#include <iostream>
using namespace std;
class Solution {
public:
vector<int> lexicalOrder(int n) {
if(n == 0) return {};
vector<int> res;
recursive(res, 0, n);
return res;
}
void recursive(vector<int>& res, i... | ALGO | 0.999436 | 6.944139 |
1857547c-2c1c-45dc-93fa-b4ebf7545581 | SamaHadhoud/Problem_solving | Graph/DSU & MST/D1. Mocha and Diana (Easy Version) (CODEFORCES).cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 1e5 + 4, M = 2e4 + 9, mod = 1e9 + 7, inf = 0x3f3f3f;
int par1[N], cnt1[N], par2[N], cnt2[N], n;
void init(){
iota(par1, par1 + n, 0);
fill(cnt1, cnt1 + n, 1);
iota(par2, par2 + n, 0);
fill(cnt2, cnt2 + n, 1);
}
int find... | ALGO | 0.999931 | 4.081822 |
8efdb628-612a-4272-99b1-65b62e5ac9bb | Satar07/code | 1.6编程基础之一维数组/04数组逆序重放.cpp | #include<iostream>
#include<cstdio>
using namespace std;
const int MAX=101;
int a[MAX];
int main(){
int n=0,first=1;
cin>>n;
for (int i=0;i<n;i++)cin>>a[n-1-i];
for(int i=0;i<n;i++){
if(first)first=0;else cout<<" ";
cout<<a[i];
}
}
| ALGO | 0.999875 | 3.133895 |
ec30e6eb-44e2-4bd8-bde3-2dc67e55d3c4 | IlyaLisin/Fox-and-goose | Game_Logic.cpp | #include "CApp.h"
#include <vector>
int CApp::MinMax(int depth, int status,int alpha, int beta)
{
//
if (depth >= 3)
return GetEvaluation();
// ,
if (CheckWin()) return GetEvaluation();
int testVal;
std::vector<int> bestMove;
int MinMax = (status == GAME_STATUS_GOOSE_MM) ? -iNFINITY : iNFINITY;
... | ALGO | 0.993279 | 4.681407 |
0e5b2eda-3aa4-40cc-a83f-fc811cac28d1 | yyy96/problem-solving | Baekjoon/c++/1920.cpp | #include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;
int n, m;
int arr[100001];
vector<int> result;
void fun(int num) {
int start = 0;
int end = n - 1;
while (1) {
if (start > end) {
result.push_back(0);
return;
}
int mid = (start + end)... | ALGO | 0.999993 | 4.693958 |
80498bd6-a214-4df5-93f1-b274a58d0ce2 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_8413_9.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long l;
int main(){
l q;cin>>q;
for(l i=0;i<q;i++){
l x,y;
cin>>x>>y;
if(x>y)swap(x,y);
long double k=sqrt(x*y-0.75)-x+0.5;
cout<<(l)(x-1+k+(x*y-1)/(x+k))-(x!=y)<<endl;
}
}
| ALGO | 0.999743 | 3.779514 |
06eddfe0-b053-4cd2-a7c0-3d290c2c72e5 | seo-wo/BOJ | BRONZE🥉/10810.cpp | #include <iostream>
int main(void)
{
int N(0), M(0);
int start(0), end(0), num(0);
std::cin >> N >> M;
int list[N + 1];
int i(0);
while (++i <= N)
list[i] = 0;
i = -1;
while (++i < M)
{
std::cin >> start >> end >> num;
while (start <= end)
{
list[start] = num;
++start;
}
}
i = 0;
while (++i... | ALGO | 0.999901 | 3.327127 |
0a80efba-5124-4ed7-b7e1-658c370dfcc4 | ishandutta2007/codeforces | cheissmart/normal/1172/B.cpp | #include <bits/stdc++.h>
#define IO_OP std::ios::sync_with_stdio(0); std::cin.tie(0);
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define EB emplace_back
#define int ll
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> vi;
const int M = 998244353... | ALGO | 0.999877 | 4.913896 |
11a020a4-dc9e-4526-b0d2-ee6814793237 | SuperSlot0613/leetcodeProblem | 188-best-time-to-buy-and-sell-stock-iv/188-best-time-to-buy-and-sell-stock-iv.cpp | class Solution {
public:
int maxProfitTD(int ind,int buy,vector<int>& price,vector<vector<vector<int>>>&dp,int cap){
if(cap==0) return 0;
if(ind==price.size()){
return 0;
}
if(dp[ind][buy][cap]!=-1) return dp[ind][buy][cap];
int profit=0;
if(buy){
... | ALGO | 0.999878 | 5.813532 |
8e40875e-1754-4ac9-9ed4-4cd1a1d35ee0 | JJH123123123/codingtest_javafactory | SY/week29/Problem572.cpp | #include <bits/stdc++.h>
using namespace std;
long long Mod = 1'000'000'000;
long long N, dp[105][10][1<<10];
long long Check(int n, int cur, int mask)
{
if(n <= 0) return mask == (1<<10) - 1;
long long& ret = dp[n][cur][mask];
if(ret != -1) return ret;
ret = 0;
if(cur > 0) ret = (ret + Check(n-1, c... | ALGO | 0.999858 | 5.356379 |
fa6f569c-5d28-4013-a84f-831e6b4d610a | Rockroyal305/Practice-Problems | Large Bouquets.cpp | #include <iostream>
using namespace std;
int main()
{
int bouquets, flowers, evens = 0, odds = 0, large_bouquets = 0;
cin >> bouquets;
for(int i = 0; i < bouquets; i++)
{
cin >> flowers;
if(flowers%2 == 0)
evens++;
else
odds++;
}
//cout << "even... | ALGO | 0.999861 | 4.421086 |
4d7aa132-094d-4b3c-b67e-868eee753b4b | VivaswanShukla/C_Plus_Plus | array_3_max_till_i.cpp | #include <iostream>
#include <climits>
using namespace std;
int main()
{
int n;
cin >> n;
int arr[n];
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
int max_no=INT_MIN;
for (int i = 0; i < n; i++)
{
max_no = max(max_no, arr[i]);
cout << "Largest No in the a... | ALGO | 0.999723 | 3.443027 |
f62bdc3d-e097-489b-af1c-0f902f0665c7 | BangKartavya/LeetCode | Remove Nth Node From End of List/main.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* removeNthFr... | ALGO | 0.999989 | 5.854264 |
ae9a51c9-dc20-453d-83fd-2159decce1aa | KimmiGYH/LeetCode_Notes_Public | Section02_Templates/模板01_基础算法/动态规划/记忆化递归-自上而下.cpp | #include <vector>
using namespace std;
vector<int> memo;
int fib( int n ) {
if ( n == 0 )
return 0;
if ( n == 1 )
return 1;
if ( memo[n] == -1 )
memo[n] = fib(n-1) + fib(n-2);
return memo[n];
} | ALGO | 0.999924 | 5.043191 |
c89f98ea-6397-41fe-b73a-ce8a3e70e4c9 | Piotrek12332121/NETSIM | src/simulation.cpp | #include "simulation.hpp"
void simulate(Factory& f, TimeOffset d, const std::function<void (Factory&, Time)>& rf){
if (f.is_consistent()) {
for (Time i = 1; i <= d; i++) {
f.do_deliveries(i);
f.do_package_passing();
f.do_work(i);
rf(f, i);
}
}
... | ALGO | 0.969968 | 5.194553 |
f1069385-e0da-4f64-becd-401a015fedf7 | taut0logy/Arduino_ | _vscode.ino.hex/sketch/A_TubeTube_Feed.cpp | #line 1 "C:\\Users\\LENOVO\\OneDrive\\Documents\\C\\_VScode\\A_TubeTube_Feed.cpp"
#include <bits/stdc++.h>
using namespace std;
#define f(i, a, b, x) for (long long i = a; i < b; i += x)
#define fr(i, a, b, x) for (long long i = a; i >= b; i -= x)
#define pb push_back
#define pf push_front
#define pp pop_back()
#define... | ALGO | 0.999937 | 4.263853 |
4abd047e-cf4c-4e16-9502-bff55a9fea1e | Rizwansheik666/owl | Medium/Factorials of large numbers/factorials-of-large-numbers.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution {
public:
vector<int> factorial(int N){
// code here
vector<int>v;
v.push_back(1);
int car=0,val=0;
for(int... | ALGO | 0.99985 | 6.696547 |
0ba540f6-207c-4ee2-8562-901de2c026e7 | ishandutta2007/codeforces | krk/normal/1246/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n, p;
int main()
{
cin >> n >> p;
if (p == 0)
cout << __builtin_popcountll(n) << endl;
else if (p > 0) {
for (int i = 1; ; i++) {
ll lft = n - p * ll(i);
if (lft < i) break;
if (__bu... | ALGO | 0.999975 | 3.796372 |
18f20976-37b9-4f2e-a626-1c0dbe55555d | jaoandrade/C-PlusPlus | Exercício 2, Topas 2016 - E, de resto/Exercício 2, Topas 2016 - E, de resto/EdeResto.cpp | #include<iostream>
#include<algorithm>
#include<locale.h>
using namespace std;
int apostas[100], i, j;
void verificaAposta(int jogadores, int soma) {
if (apostas[j] > jogadores) {
cout << "[ Aposta invalida! Menor ou igual ao nmero de jogadores! ]\n";
cin >> apostas[j];
}
else{
soma += apostas[j];
}
}
void ma... | TOOL | 0.886238 | 3.725514 |
9fa388e7-17d4-483b-b89c-b21f3d266355 | AOSC-Tracking/ktorrent-trinity | plugins/ipfilter/antip2p.cpp | #include "antip2p.h"
#include <torrent/globals.h>
#include <util/log.h>
#include <util/constants.h>
#include <util/mmapfile.h>
#include <tdeglobal.h>
#include <kstandarddirs.h>
#include <tqstring.h>
#include <tqvaluelist.h>
using namespace bt;
namespace kt
{
bool IPBlock::operator < (const IPBlock & b) const
... | TOOL | 0.901114 | 3.563633 |
1e819f39-aae0-4eb2-aebe-641b070529f0 | AKC217/Cpp_codes | Functions/return_value.cpp | //the question here is cn we have multiple return values in a funtion that is called
//Ans:yes we can have mor than one funtion ,but once a fuction a function return a value it would not return value
//for another return funtion since after first return value only our funtion would we over there only.
//Example:
#incl... | ALGO | 0.999678 | 4.471879 |
822f8119-9439-4f36-8be7-efb22c85d711 | c0deberry/self-balancing-robot | libraries/grblmain/limits.cpp | #include <util/delay.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include "stepper.h"
#include "settings.h"
#include "nuts_bolts.h"
#include "config.h"
#include "spindle_control.h"
#include "motion_control.h"
#include "planner.h"
#include "protocol.h"
#include "limits.h"
#include "report.h"
#define MICROSECONDS_... | TOOL | 0.94158 | 6.848404 |
6a3d5869-e2c9-4edd-a3bc-04841da02639 | Karan-Veer-Singh/Leetcode | Binary Search/34. Find First and Last Position of Element in Sorted Array.cpp | class Solution {
public:
vector<int> searchRange(vector<int>& A, int target)
{
int first = -1, second = -1;
int start = 0, end = A.size() - 1;
while (start <= end) {
int mid = start + (end - start) / 2;
if (A[mid] == target) { first = mid; end = mid - 1; }
... | ALGO | 0.99987 | 6.747473 |
3647ab7e-7120-46a7-aae8-f7f67a956d9c | jashwanth6215/codemind-cpp | Profit_or_Loss.cpp | #include<iostream>
using namespace std;
int main()
{
int x,y;
cin >>x>>y;
if(y>x)
{
cout <<"Profit";
}
else if(y==x)
{
cout <<"No Profit and No Loss";
}
else
{
cout <<"Loss";
}
}
| ALGO | 0.999533 | 3.441278 |
3a9bebb5-2e0c-459d-8fe4-68ce4ddbe130 | J-Kah/BlockLights_Slave | managed_components/espressif__esp-dsp/examples/matrix/main/dspm_matrix_main.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "dsp_platform.h"
#include "esp_log.h"
#include "esp_dsp.h"
static const char *TAG = "main";
// This example shows how to use Mat class from esp-dsp library.
//
// First we create matix A and x, and then calculating matrix b as result
// A*x = b
// T... | ALGO | 0.998937 | 3.792892 |
a5b8b912-9ad9-4a8f-9bb9-023fd94076b4 | amansr18/OhshitLEET | 0050-powx-n/0050-powx-n.cpp | class Solution {
public:
double pow(double x, int n){
double result;
if(n==0){
return 1;
}
result = x * pow(x, n-1);
return result;
}
double myPow(double x, int n) {
if (n == INT_MAX) return (x == 1) ? 1 : (x == -1) ? -1 : 0;
... | ALGO | 0.999793 | 5.534015 |
6ac6b495-9a0b-4e5a-b4db-5b8ad98f6034 | mura-s/learning | cpp/cpp_basic_book/lambda.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
const int N = 16;
vector<int> v;
for (int i = 1; i <= N; i++) v.push_back(i);
sort(v.begin(), v.end(),
[](int lhs, int rhs)->bool {
return lhs < rhs;
}
);
for ... | ALGO | 0.997862 | 3.815121 |
cacd56d9-205f-43e3-a6a3-5ced29368d6e | sam5854/lc_submitter | C++/erect-the-fence-ii.cpp | // Time: O(n) on average
// Space: O(n)
// reference: https://en.wikipedia.org/wiki/Smallest-circle_problem
class Solution {
public:
vector<double> outerTrees(vector<vector<int>>& trees) {
random_shuffle(begin(trees), end(trees));
vector<vector<double>> boundaries;
const auto& result = Wel... | ALGO | 0.999926 | 6.836162 |
8b70f7d0-1670-4320-bb8a-7cfa1b37b4b8 | priyeshwadhwa/ip | hash/easy/bitset_experiments/bits_experiments.cpp |
#include <algorithm>
#include <numeric>
#include <vector>
#include <queue>
#include <list>
#include <tuple>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <regex>
#include <string>
#include <iostream>
#define CATCH_CONFIG_MAIN
#include "..\..\catch\catch.hpp"
using namespace ... | ALGO | 0.995467 | 3.286382 |
b1a253dd-ae9a-43b9-9882-89ede1bdc9db | Veronijaj/OOP | lab2/ConsoleApplication1/trixsignal.cpp | #include "trixsignal.hpp"
#include "signal.hpp"
#include <iostream>
#include <string>
namespace Prog2B {
Vector Vector::operator +=(Vector& obj) {
for (int i = 0; i < n; i++) {
if (array[i].getC() != obj.array[i].getC()) {
array[i].setC(Prog2::MyEnum::UNDEF);
}
array[i].setD(obj.array[i].get_duration()... | ALGO | 0.885276 | 4.155046 |
615a167b-750f-4394-9a53-e4cbc27f7340 | VeYand/OOP | lab2/ExpandTemplate/src/BorTrieUtils.cpp | #include "../include/BorTrieUtils.h"
BohrTrie::BohrTrie() {
m_bohr.emplace_back();
}
int BohrTrie::GetAutoMove(int vertex, char symbol) {
int nextVertex = m_bohr[vertex].nextVertex[static_cast<unsigned char>(symbol)];
int suffixFromLastTransition = m_bohr[vertex].autoMove;
if (suffixFromLastTransition != NOT_USE... | ALGO | 0.999135 | 5.269897 |
f42123da-de2b-4df3-95e2-430c7e7719cf | jeffbrown639/groesticoin | src/common/config.cpp | #include <common/args.h>
#include <common/settings.h>
#include <logging.h>
#include <sync.h>
#include <tinyformat.h>
#include <univalue.h>
#include <util/chaintype.h>
#include <util/fs.h>
#include <util/string.h>
#include <algorithm>
#include <cassert>
#include <cstdlib>
#include <fstream>
#include <iostream>
#includ... | CONFIG | 0.99068 | 7.508236 |
fec4da94-6c5e-439d-8916-84dbe8714f60 | pradnyesh61/CP | LeetCode/28_Find_the_Index_of_the_First_Occurrence_in_a_String.cpp | // 3 March 2023
#include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int strStr(string haystack, string needle)
{
if (haystack.length() < needle.length())
{
return -1;
}
char s = needle[0];
for (int i = 0; i < haystack.length(); i++)
... | ALGO | 0.999951 | 5.801881 |
d8210b15-2544-43a8-b80b-f812cbb1c9c3 | naman152728/DSA | 11_Remove_Nth_Node_from_End.cpp | #include <bits/stdc++.h>
using namespace std;
class Node{
public:
int data;
Node*next;
Node(int val){
data= val;
next = NULL;
}
};
Node * remove(Node*head, int n){
int count = 0;
Node *temp = head;
while(temp){
count++;
temp = temp->next;
}
c... | ALGO | 0.999746 | 4.434562 |
e105d4b2-04e1-4362-bbd7-12b43c5ff60e | Bharat2044/365-days-coding-challanges | Day_287/02_numberOfAtoms.cpp | // Question Link: https://leetcode.com/problems/number-of-atoms/description/
/*
726. Number of Atoms
Given a string formula representing a chemical formula, return the count of each atom.
The atomic element always starts with an uppercase character, then zero or more lowercase letters, representing the name.
One or m... | ALGO | 0.999591 | 5.657641 |
7d84aef8-2435-4a8a-b025-18b558310063 | asperaa/Data_Structure_Problems | linkedList/ll2.cpp | #include <bits/stdc++.h>
using namespace std;
struct node{
int data;
struct node* next;
};
void printNode(struct node* head)
{
struct node* mover;
mover=head;
while(mover!=NULL)
{
cout<<mover->data<<endl;
mover=mover->next;
}
}
struct node* addData()
{
int nodeData;
cin>>nodeData;
struct node* head;
... | ALGO | 0.996486 | 4.010477 |
eb3d6822-05c6-487c-9200-4c6e8cf5bc14 | JefferyXeom/SUSTech-DSAAB-Project | code/blas/mkldgemm.cpp | #include "mkldgemm.h"
int mkldgemm(int rowa, int cola, int colb) {
using namespace std;
double *A, *B, *C;
int a = 1, b = 1;
A = (double *) MKL_malloc(rowa * cola * sizeof(double), 64);
B = (double *) MKL_malloc(cola * colb * sizeof(double), 64);
C = (double *) MKL_malloc(rowa * colb * sizeof(d... | ALGO | 0.989113 | 4.05804 |
4c98b72e-2a6e-4e52-a171-29064b415934 | youbeen2798/SWEA-problems | SWEA_2814_최장경로.cpp | #include <iostream>
using namespace std;
int test_case;
int T;
int n, m;
int a, b;
bool map[11][11];
bool visited[11];
int dfs_mx = 0;
int mx = 0;
void dfs(int k, int cnt) {
if (mx < cnt)
mx = cnt;
for (int i = 1; i <= n; i++) {
if (map[k][i] == 1 && visited[i] == 0) {
visited[i] = 1;
dfs(i, cnt + 1);... | ALGO | 0.999883 | 4.197476 |
33a989fc-f8da-488f-8a7b-de37e84c05fb | harshit-jain52/CP_DSA | hackerearth/connected-components-in-a-graph.cpp | /*
https://www.hackerearth.com/problem/algorithm/connected-components-in-a-graph/
*/
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
vector<int> g[N];
bool visited[N];
void dfs(int vertex)
{
visited[vertex] = true;
for (int child : g[vertex])
{
if (visited[child])
... | ALGO | 0.999891 | 4.786144 |
dfa2a01e-ee1b-483a-9675-73b941a02c4d | tlans21/Algorithm | 프로그래머스/LV.1/하샤드 수.cpp | #include <string>
#include <vector>
using namespace std;
bool solution(int x) {
bool answer = true;
int sum = 0;
int tempX = x;
while(x){
int k = x % 10;
x = x / 10;
sum += k;
if(x == 0){
break;
}
}
if(tempX % sum != 0){
answer = fals... | ALGO | 0.999762 | 5.48501 |
695044d9-8391-4ee8-ba31-d225b22771c2 | TomLeCollegue/TP1-openCV | filtres.cpp | #include "filtres.hpp"
Mat filtreM(Mat input) {
float kernelValues[] = {1.0, 2.0, 1.0, 2.0, 4.0, 2.0, 1.0, 2.0, 1.0};
Mat kernel(3, 3, CV_32FC1, kernelValues);
Mat output;
cv::filter2D(input, output, -1, kernel / 16.0);
return output;
}
Mat contrasteM(Mat input, float alpha) {
// kernel ident... | TOOL | 0.988621 | 5.203599 |
24b1dd8b-e1ed-42d1-a5d8-50056d92a5bc | AdityaSingh-100/C-Codes- | SEC_29_Standard_Template_Library/8_MapContainer.cpp | #include <iostream>
#include <string>
#include <map> // Include map header
using namespace std;
int main()
{
// declaration
std::map<int, string> map1;
// Initialization
std::map<int, string> map2 = {{101, "VeDinesh"},
{201, "Kevin"},
... | TOOL | 0.903756 | 4.018872 |
efaff2fa-b604-42d3-a155-0f65581a6def | manglaishan/C- | main.cpp | #include <iostream>
using namespace std;
/* class honey
{
public:
void read(int *p);
void display(int *p);
};
void honey::read(int *p)
{
for (int i=0;i<5;i++)
{
cin>> *(p+i);
}
}
void honey:: display(int *p)
{
for (int i=0;i<5;i++)
{
cout<< *(p+i)<<endl;
}
delete []p;
}
int main... | ALGO | 0.969509 | 3.3121 |
4045a09e-1ce1-4006-ab6d-77aec97ea781 | akshith-07/Leetcode-Solutions | 3656-minimum-number-of-operations-to-make-elements-in-array-distinct/3656-minimum-number-of-operations-to-make-elements-in-array-distinct.cpp | class Solution {
public:
int minimumOperations(vector<int>& nums) {
int cnt = 0, temp;
while (true) {
unordered_map<int, int> mpp;
temp = 0;
for (int num : nums)
if (++mpp[num] == 2) temp++;
if (temp == 0) break;
nums.erase... | ALGO | 0.999921 | 6.067531 |
53a722b4-e60f-4d4d-b89a-3f6be8e30f2e | Sp-177/CODEFORCES | B_Books.cpp | #include<iostream>
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// #include <ext/pb_ds/trie_policy.hpp>
// #include <ext/pb_ds/priority_queue.hpp>
// using namespace __gnu_pbds;
// // **1. Ordered Set**
// template <typename T>
// using ordered_set = tre... | ALGO | 0.99999 | 4.988848 |
b73b7160-ce36-4674-a986-c00269b3a491 | snjumaheshwari/C-Cpp | Graph/Graph_DFS_TS.cpp | #include<bits/stdc++.h>
#define ll long long
#define f first
#define s second
#define pb push_back
#define pf push_front
const int MOD = int(1e9)+7;
using namespace std;
list<int> *adj;
int n;
void dfshelper(int node,bool *visited,vector<int> &ans){
visited[node]=true;
for(auto neib: adj[node]){
if... | ALGO | 0.999982 | 4.974978 |
f2627db2-2e1c-43c7-8b56-9ee30a4a1c74 | Pankajesc/Leetcode | 0198-house-robber/0198-house-robber.cpp | #pragma GCC optimize("O3")
#pragma GCC optimize("Ofast", "inline", "ffast-math", "unroll-loops", "no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native", "f16c")
static const auto DPSolver = []()
{ std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); std::cout.ti... | ALGO | 0.999943 | 5.345027 |
fbdd34ae-44fa-4485-8bae-55aa6db02018 | ADKaster/serenity-rust | Userland/Libraries/LibCoredump/Backtrace.cpp | #include <AK/LexicalPath.h>
#include <AK/Platform.h>
#include <AK/StringBuilder.h>
#include <AK/Types.h>
#include <LibCore/File.h>
#include <LibCore/MappedFile.h>
#include <LibCoredump/Backtrace.h>
#include <LibCoredump/Reader.h>
#include <LibELF/Core.h>
#include <LibELF/Image.h>
namespace Coredump {
ELFObjectInfo co... | TOOL | 0.883128 | 7.69757 |
5cdf6716-de7c-40bb-9849-3527fb8ba416 | lyaakkaa/leetcode | linkedlist/203.cpp | #include <bits/stdc++.h>
using namespace std;
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* removeElements(ListNode* head,... | ALGO | 0.999812 | 5.181281 |
aa0d2273-5569-4e4c-a809-159a3417f816 | wldhks1959/Algorithm | 프로그래머스/0/181908. 접미사인지 확인하기/접미사인지 확인하기.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
int solution(string my_string, string is_suffix) {
int answer = 0;
// 접미사면 answer = 1;
reverse(my_string.begin(), my_string.end());
reverse(is_suffix.begin(), is_suffix.end());
if(my_string.find(is_suffix)==0) answ... | ALGO | 0.999432 | 4.836682 |
a4bdd16a-902f-4bec-9cda-f2ed98b4a543 | eli9850/Etherfall | Libraries/SFML-3.0.1/src/SFML/Network/Http.cpp | ////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Network/Http.hpp>
#include <SFML/System/Err.hpp>
#include <SFML/System/Utils.hpp>
#include <algorithm>
#include <array>
#include <iterator>
#include <limits>
#include <os... | WEB | 0.877015 | 7.33874 |
87ff1d00-6000-43f2-8b7d-b252fb7b1797 | WizardPenguin/competative-programming | 828 div3/1744E1.cpp | #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>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> p... | ALGO | 0.999934 | 4.619915 |
646afb05-bbf8-4d25-8dcb-05b97bbfc248 | ineedkodeforlife/parallel_programming | lab_5_mpi.cpp | #include <iostream>
#include <vector>
#include <cstdlib>
#include <ctime>
#include <mpi.h>
using namespace std;
void merge(vector<int>& arr, int left, int mid, int right) {
int n1 = mid - left + 1;
int n2 = right - mid;
vector<int> left_half(n1);
vector<int> right_half(n2);
for (int i = 0; i < n... | ALGO | 0.999995 | 5.361183 |
6d79d366-4015-466e-8def-ff652c038dc7 | ihSomik/problem-solving | codeforces/1873A - Short Sort.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
string s;
cin >> s;
int count(0);
if (s[0] != 'a')
count++;
if (s[1] != 'b')
count++;
if (s[2] != 'c')
count++;
if (co... | ALGO | 0.999821 | 4.346509 |
95c9db25-fd63-4caa-8592-252c89d2e2ff | shubhamcodingblocks/DSA | G10-DSA/12-01-2024/first_occurence.cpp | #include<iostream>
using namespace std;
int main(){
int a[1000];
int n;
cin >> n;
for(int i=0;i<n;i++){
cin >> a[i];
}
int target;
cin >> target;
int s = 0, e = n-1; // initial search space
int ans = -1;
while(s<=e){
// step 1: find mid
int mid = (s+e)/2;
// step 2: check conditions
if(a[mid]==targ... | ALGO | 0.99992 | 5.373684 |
ba364f2b-d613-4e9a-85b1-1893879808fb | Stricted/android_hardware_samsung_slsi-linaro_exynos | libvision/kernel/vpu/api/vpu_kernel_internal.cpp | #define LOG_TAG "ExynosVpuKernelInterface"
#include <cutils/log.h>
#include <VX/vx.h>
#include <VX/vx_helper.h>
#include "vpu_kernel_internal.h"
vx_node vxFastCornesMicro0Node(vx_graph graph, vx_image input, vx_scalar strength_thresh, vx_scalar nonmax_suppression, vx_image output)
{
vx_reference params[] = {
... | TOOL | 0.857001 | 4.565456 |
0242d0bc-3e73-4147-a2d4-6ba447a5fd3e | ishandutta2007/codeforces | ainta/normal/873/A.cpp | #include<cstdio>
#include<algorithm>
using namespace std;
int n, K, x, w[110], res;
int main(){
int i;
scanf("%d%d%d",&n,&K,&x);
for(i=1;i<=n;i++)scanf("%d",&w[i]);
sort(w+1,w+n+1);
for(i=1;i<=n;i++){
if(i>n-K)res += x;
else res += w[i];
}
printf("%d\n",res);
} | ALGO | 0.999724 | 3.451374 |
831a43ce-fadc-4912-a768-c2851c32b1e3 | toufu-24/AtCoder | MCC/2025_07_16/2.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define all(v) v.begin(), v.end()
#define SORT(v) sort(v.begin(), v.end())
#define RSORT(v) sort(v.rbegin(), v.rend())
#define REVERSE(v) reverse(v.begin(), v.end())
#define ll long
#define ld long double
#define int ll
int... | ALGO | 0.999954 | 3.531422 |
0d9ba221-575f-4010-915a-0817e8e5e172 | harshav01/data_structure | Tree_again/depth.cpp | #include<bits/stdc++.h>
#include<iostream>
using namespace std;
struct TreeNode{
int data;
TreeNode* left;
TreeNode* right;
TreeNode(int val)
{
data=val;
left=right=NULL;
}
};
TreeNode* buildTree()
{
int d;
cin>>d;
if(d==-1)
return NULL;
TreeNode* root=n... | ALGO | 0.99987 | 4.463054 |
7072a135-3623-4fa4-ac23-3de264e26c82 | ryoyoshi29/algorithm-training | AtCoder/ABC_290/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, x, n) for (int i = x; i < (n); i++)
using ll = long long;
int main()
{
int n, k;
cin >> n >> k;
vector<ll> a(n);
set<ll> s;
rep(i, n)
{
cin >> a[i];
s.insert(a[i]);
}... | ALGO | 0.999946 | 3.79513 |
1735c6da-78d2-4904-9dd3-db706a7a27ea | kvnlpz/x86-Assembly-files | assignment2submission/reverse.cpp | // Author: Kevin Lopez
// Program title: Array Reverser
// Program Description: This program receives a sequence of integers, then puts them into an array
// Then the program prints out the array, then prints out the array in reverse, and finally
// it calculates the mean of the data then passes it to the main func... | ALGO | 0.996506 | 3.95653 |
423d3762-670e-4ffc-a9ed-4491684692f0 | fmemon/Busy | Busy/libs/Box2D/Dynamics/Joints/b2PrismaticJoint.cpp | #include <Box2D/Dynamics/Joints/b2PrismaticJoint.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2TimeStep.h>
// Linear constraint (point-to-line)
// d = p2 - p1 = x2 + r2 - x1 - r1
// C = dot(perp, d)
// Cdot = dot(d, cross(w1, perp)) + dot(perp, v2 + cross(w2, r2) - v1 - cross(w1, r1))
// = -dot... | ALGO | 0.998709 | 7.646193 |
da6a5535-0a21-4cc8-b39b-579cc048ea23 | ishandutta2007/codeforces | ivan100sic/normal/567/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
int n, k;
ll sol;
map<int, ll> b, c;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
cerr.tie(nullptr);
cin >> n >> k;
for (int i=1; i<=n; i++) {
in... | ALGO | 0.999883 | 3.678031 |
da2e4c25-95f4-4798-be2c-8ab0ae4595e0 | jasonz5/ROBOCOM-Spark | src/spark_driver/arm/uArm/swiftpro/src/swiftpro_rviz_node.cpp | #include <string>
#include <ros/ros.h>
#include <std_msgs/String.h>
#include <swiftpro/SwiftproState.h>
#include <sensor_msgs/JointState.h>
#include <tf/transform_broadcaster.h>
#define MATH_PI 3.141592653589793238463
#define MATH_TRANS 57.2958
#define MATH_L1 106.6
#define MATH_L2 13.2
#define MAT... | TOOL | 0.865077 | 5.752316 |
b35c376d-1b96-4e07-98d6-f7f6e1157963 | architcs12b1007/DSA | DP/DP on String/5_WildcardPatternMatching.cpp | #include <iostream>
#include <vector>
using namespace std;
// Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and '*' where:
// '?' Matches any single character.
// '*' Matches any sequence of characters (including the empty sequence).
// The matching should cover... | ALGO | 0.999965 | 6.176848 |
f923fd3f-70a5-478f-bc4c-839f62eca31b | khaledatia25/cp-problems-solutions | spoj/MKTHNUM.cpp | /*
Buggy Code Written By Khaled Waleed ^_^
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <iostream>
#define KHALED_WALEED_ATTIA ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define space " "
#define endl '\n'
#define all(v) v.begin(), v.e... | ALGO | 0.999957 | 5.51228 |
ef8ff0aa-3be4-4681-b3e6-ce7cf57a1e09 | omkarsp45/DSA | 110.cpp | // Reverse An Array
#include<iostream>
using namespace std;
struct Array{
int length;
int size;
int A[10];
};
void display(Array arr){
for(int i = 0 ; i<arr.length ; i++){
cout<<arr.A[i]<<" ";
}
cout<<endl;
}
void reverse(Array *arr ){
int *B;
B = new int[arr->length];
f... | ALGO | 0.995617 | 4.511059 |
73168031-e0aa-4777-98cd-7110016f9962 | priy-am/DSA | 7_insert_singleLinkedList.cpp | /*
Q7. Write a program to insert an element in a singly linked list
a. at front
b. at the end of the list
c. at any specific position
*/
#include <iostream>
using namespace std;
struct Node
{
int data;
Node* next;
//constructor of node
Node(int val): data(val), next(nullptr){}
};
class LinkedList
{
p... | ALGO | 0.999751 | 3.966498 |
2d58715f-86b3-41d1-be53-e7db85a20c60 | ZooInJang/Solo_Project_Second | opencv-4.x/opencv-4.x/modules/calib3d/src/usac/quality.cpp | #include "../precomp.hpp"
#include "../usac.hpp"
namespace cv { namespace usac {
int Quality::getInliers(const Ptr<Error> &error, const Mat &model, std::vector<int> &inliers, double threshold) {
const auto &errors = error->getErrors(model);
int num_inliers = 0;
for (int point = 0; point < (int)inliers.size... | ALGO | 0.989791 | 3.071702 |
a654a5f0-8869-4df9-8ebc-b183c19e6234 | Md-Merazul-Islam/XPSC-Batch-3 | Weekly Task/5th week/day-3/B_Polycarp_Writes_a_String_from_Memory.cpp | /**************بسم الله الرحمن الرحيم*************
***********************❀‿❀************************/
#include <bits/stdc++.h>
#define ll long long
#define dd double
#define pi pair<int, int>
#define pl pair<ll, ll>
#define f first
#define scd second
#define pb push_back
using namespace std;
void solve()
{
strin... | ALGO | 0.999927 | 4.844832 |
4ec3bc96-404b-407a-965f-d9931ea8b590 | Sudhanshusingh1182/-CrackYourPlacement | 08-08-24 challenge/aggressiveCows.cpp | #include <bits/stdc++.h>
using namespace std;
// Problem Code/Link:
#define fio ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define incr_loop(a, n) for (int i = a; i < n; i++)
#define decr_loop(a, b) for (int i = a; i > b; i--)
#define nested_incr_loop(a, b) for (int j = a; j < b; j++)
#define nested_decr_... | ALGO | 0.999989 | 4.513987 |
1c7a7f50-48ca-407b-9a38-089dca5a39eb | raincross7/code-similarity | codes/train_code/problem302/problem302_281.cpp | #include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--)
#define repit(itr,x) for(auto itr = x.begin(); itr != x... | ALGO | 0.999769 | 3.686365 |
cdf2034f-c193-40b4-9b2c-84ea10a03d53 | pedestrian-vis/simulation | pedestrian_sim/Crossing.cpp | /*
* Example file showing a demo with 250 agents initially positioned evenly
* distributed on a circle attempting to move to the antipodal position on the
* circle.
*/
#ifndef RVO_OUTPUT_TIME_AND_POSITIONS
#define RVO_OUTPUT_TIME_AND_POSITIONS 1
#endif
#include <cmath>
#include <cstddef>
#include <vector>
#if RV... | ALGO | 0.999959 | 4.10416 |
d89fa14f-57af-4525-9fc1-0efeae596f10 | everXXfor/C-Cpp-Code | leetcode/dp/基础题目/lcr086/lcr086.cpp | #include<bits/stdc++.h>
class Solution {
public:
vector<vector<string>> partition(string s) {
}
};
int main()
{
} | ALGO | 0.999986 | 4.866055 |
b5626dc5-1051-4937-a66d-9dbe6e77aee3 | hgeorge21/Physical_Animation | libigl/python/py_igl/py_signed_distance.cpp | py::enum_<igl::SignedDistanceType>(m, "SignedDistanceType")
.value("SIGNED_DISTANCE_TYPE_PSEUDONORMAL", igl::SIGNED_DISTANCE_TYPE_PSEUDONORMAL)
.value("SIGNED_DISTANCE_TYPE_WINDING_NUMBER", igl::SIGNED_DISTANCE_TYPE_WINDING_NUMBER)
.value("SIGNED_DISTANCE_TYPE_DEFAULT", igl::SIGNED_DISTANCE_TYPE_DEFAULT)
... | TOOL | 0.884885 | 6.521199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.