uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
546b71c4-bda5-4ec3-8074-b5e20d0548a2 | kezewang/ASPL | caffe-master/src/caffe/solvers/rmsprop_solver.cpp | #include <vector>
#include "caffe/sgd_solvers.hpp"
namespace caffe {
#ifndef CPU_ONLY
template <typename Dtype>
void rmsprop_update_gpu(int N, Dtype* g, Dtype* h, Dtype rms_decay,
Dtype delta, Dtype local_rate);
#endif
template <typename Dtype>
void RMSPropSolver<Dtype>::ComputeUpdateValue(int param_id, Dtype r... | ALGO | 0.983585 | 7.287015 |
4ebeb49d-f7c7-4a63-9ff8-78e6f646c6e6 | gmtranthanhtu/competitive-programming | UVa-AC/uva 10018 Reserve and Add.cpp | #include <stdio.h>
#include <math.h>
#include <iostream>
using namespace std;
typedef long long mt;
int T, Time;
mt N, Mu10[20], So[20], Ans;
void Init() {
Mu10[0] = 1;
for(int i = 1; i <= 15; i++){
Mu10[i] = Mu10[i - 1] * 10;
}
}
mt Convert(mt a){
int Tmp = 0... | ALGO | 0.999647 | 3.628155 |
d7a2c496-e727-4be1-9989-6e6c8b357e75 | mohammadali10-12/C-pattern-_code | print1ton.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cout << "Enter the number :";
cin >> n;
int sum = 0;
for (int i = 1; i <= n; i++)
{
sum = sum + i;
}
cout << "sum of " << sum;
} | ALGO | 0.920655 | 3.564463 |
e1896b8d-2493-4846-a3a1-67e6cb55bdfb | devgabize/Curso-Linguagem-C | meusCodigos/02-Listas-de-exercícios/04-Listas-vetores-strings-e-matrizes/ListaVetoresMatrizes/questoesMatrizes/14-cartelaDeBingo.cpp | #include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<locale.h>
#include<time.h>
/*QUESTÃO 14 - Faça um programa para gerar automaticamente números entre 0 e 99 de uma cartela de
bingo. Sabendo que cada cartela deverá conter 5 linhas de 5 números, gere estes dados de modo a não ter números repetidos dentro ... | ALGO | 0.95698 | 4.612206 |
2fdeeb26-c2c9-41ce-a1d0-915020a8ace6 | Xyronix99/Code_Library | codeforces/codeforces 1131E.cpp | #include <bits/stdc++.h>
using namespace std;
// #define MOD 1000000007
#define ll long long
#define N 100005
const ll MOD = 1e9 + 7;
vector<char> s[N];
ll pre[N][30],su[N][30];
ll f[N][30],dp[N][30];
int n;
inline void getString(int x){
char c;
while ((c=getchar())=='\n' || c=='\r' || c==' ');
s[x].push_ba... | ALGO | 0.99977 | 3.723331 |
405fedbd-24a8-4fe4-b1ed-955c2cb949ca | zwfree/C-code | 10.6(1)/main.cpp | #include <iostream>
using namespace std;
void Insert_sort(int *p_array[],int size_a)
{
int temp_array[10];
temp_array[0]=p_array[0];
for(int i=1;i<size_a;i++)
{
for(int j=1;j<i;j++)
{
if(a[i]<=temp_array[j])
{
for(k=i;k>=j;k--)
{... | ALGO | 0.999845 | 3.74967 |
ede27a44-4d27-4bae-83c7-81d95a5f15c3 | amanjhaaa/practice-session | cpp/minnopizaa.cpp | #include<bits/stdc++.h>
#define ll long long
#define endl '\n'
using namespace std;
int main()
{
ios_base::sync_with_stdio(NULL);
cin.tie(NULL);
cout.tie(NULL);
ll t;
cin>>t;
while(t--){
ll n,k;
cin>>n>>k;
ll ans;
ans = lcm(n,k)/k;
cout<<ans<... | ALGO | 0.999913 | 4.395413 |
3dc6ef09-6623-4c95-aee2-1efe92323360 | kosirobwada/AtCoderSubmit | submissions/agc002/a.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
if (a <= 0 && b >= 0)
cout << "Zero" << endl;
else if (a > 0)
cout << "Positive" << endl;
else if (b > 0 && a % 2 == 0)
cout << "Positive" << endl;
else if (b > 0 && a % 2 == 1)
cout << "Negative" << endl;
... | ALGO | 0.999952 | 4.005602 |
6abe6ed0-c6ce-4055-82e3-c40ea1ea0fdb | ryanzhang15/RJ_HKOI | NP1722.cpp |
/*
template by c8kbf
*/
// macOS doesn't have <bits/stdc++.h> (shame)
#include <cstdlib>
#include <iostream>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cmath>
#include <cstring>
#include <ctime>
#include <deque>
#include <string>
#include <stack>
#include <vector>
#include <map>
#include <... | ALGO | 0.999795 | 3.910091 |
09d53546-2c28-4d02-a825-cb2e822c598b | davidinouye/lpmrf | mexcode/eigen/test/denseLM.cpp | #include <iostream>
#include <fstream>
#include <iomanip>
#include "main.h"
#include <Eigen/LevenbergMarquardt>
using namespace std;
using namespace Eigen;
template<typename Scalar>
struct DenseLM : DenseFunctor<Scalar>
{
typedef DenseFunctor<Scalar> Base;
typedef typename Base::JacobianType JacobianType;
typed... | TEST | 0.964722 | 5.862647 |
269f79dd-9c33-4d87-9d14-08d9b0a36559 | openDGM/project_V | source/element.cpp | #include "element.h"
#include "globals.h"
#include "functions1D.h"
#include "functions2D.h"
using namespace Eigen;
using namespace globals;
using namespace functions1D;
element::element() {}
element::element(double theXLeft, double theXRight, double theLNormal, double theRNormal, int theN) :
itsXLeft(theXLeft),
... | TOOL | 0.941637 | 4.952248 |
60814fa0-7bb7-4c85-bd13-efa6ae3b5f1b | Seann0425/LeetCode | finished/2810. Faulty Keyboard.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) {
}
};
struct TreeNode {
int val;
TreeNode *left;
... | ALGO | 0.999966 | 4.529354 |
05be06a1-d9f2-4053-98ec-6622e175c4ed | ahammadshawki8/Phitron | semester 2/Course 4 - Algorithms/Enchanted_Forest_of_Faraway_land.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
vector <int> v[5005];
bool vis[5005];
ll value[5005];
int parent[5005];
// void bfs(int src, int dist) {
// queue <int> q;
// q.push(src);
// vis[src] = true;
// while(!q.empty()) {
// int par = q.front();
// q.pop();
... | ALGO | 0.999882 | 4.73093 |
75357da4-00c1-49c7-bfd8-c823c5e6c3cd | Ajitkumarchai/DSA | DEV C++/set.cpp | #include<iostream>
#include<set>
using namespace std;
int main()
{
set<int>s;
s.insert(19);
s.insert(3);
s.insert(67);
s.insert(10);
s.insert(19);
s.insert(3);
s.insert(4);
for(int i:s)
{
cout<<i<<" ";
}
cout<<endl;
set<int>::iterator it=s.begin();
it++;
s.erase(it);
int n=s.size();
for(int i:s)
{
... | ALGO | 0.92589 | 3.200671 |
8fad9775-954c-47f8-b936-3e39dee868b9 | thegamer1907/Code_Analysis | Implementation/2210.cpp | #include <bits/stdc++.h>
int main()
{
long long k,n,w;
scanf("%I64d%I64d%I64d",&k,&n,&w);
long long sum=w*k+w*(w-1)*k/2;
if (sum<=n)
printf("0\n");
else
printf("%I64d\n",sum-n);
}
| ALGO | 0.999907 | 3.637619 |
4d676cab-9314-46ee-90c5-648738c2e44b | nginH/CP-codeforce | Others/CSES Problem Set/Maximum Subarray Sum.cpp | //
// Maximum Subarray Sum.cpp
// CSES Problem Set
//
// Created by Harsh Anand on 13/11/2023.
//
#include <bits/stdc++.h>
using namespace std;
using namespace chrono;
#ifndef ONLINE_JUDGE
#else
#define debug(x)
#define debug_2(x,y) cerr << #x<<" = " << x <<" "<< #y<< " = " << y <<"\n";
#endif
#define code by Hars... | ALGO | 0.999732 | 6.00839 |
da41be60-f70e-401f-868d-1003b6081cf0 | dennysanthoni/Portafolio-de-ejercicios | Crateres/main.cpp | #include <bits/stdc++.h>
using namespace std;
struct nodo{
int f,c;
};
int movs[4][2]={{-1,0},{0,1},{1,0},{0,-1}};
int f,c;
int mapa[502][502];
bool visitados[502][502];
queue<nodo>cola;
void lectura(){
cin>>f>>c;
for(int i=1;i<=f;i++){
for(int j=1;j<=c;j++){
cin>>mapa[i][j];
}
... | ALGO | 0.999814 | 3.700566 |
bdc88e00-71b3-444c-8a89-8e15a0c3fca7 | maliwik/ProjectOverwatch | sp/src/game/client/splinepatch.cpp | #include "mathlib/vmatrix.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
//-----------------------------------------------------------------------------
// Catmull rom blend weights
//-----------------------------------------------------------------------------
static VMat... | ALGO | 0.884546 | 4.758902 |
f2c43816-97ce-45dc-8a19-e8ec76d806b1 | jkressel/cheri-llvm-flexos | libcxx/test/std/containers/sequences/vector/vector.cons/construct_size_value_alloc.pass.cpp | // <vector>
// vector(size_type n, const value_type& x, const allocator_type& a);
#include <vector>
#include <cassert>
#include "test_macros.h"
#include "min_allocator.h"
#include "asan_testing.h"
template <class C>
void
test(typename C::size_type n, const typename C::value_type& x,
const typename C::allocator... | TEST | 0.878959 | 6.359931 |
06376429-e2aa-42d1-ba72-54d869b6ca54 | kp7742/IL2CPPDumper | jni/libil2cpp-v24/mono/ThreadPool/threadpool-ms.cpp | #include "il2cpp-config.h"
#if NET_4_0
#include <stdlib.h>
#define _USE_MATH_DEFINES // needed by MSVC to define math constants
#include <algorithm>
#include <cmath>
#include <complex>
#include "il2cpp-api.h"
#include "gc/GarbageCollector.h"
#include "gc/GCHandle.h"
#include "icalls/mscorlib/System.Threading/ThreadPo... | TOOL | 0.917638 | 4.841461 |
08407057-099c-4f12-a3ff-acdcab74a38d | amey16/Just-cp-- | Recursion/Recursion1/recursion-vectors/get-kpc.cpp | #include<iostream>
#include<vector>
#include<string>
using namespace std;
vector<string> letters = {".;","abc","def","ghi","jkl","mno","pqrs","tu","vwx","yz"};
vector<string> kpc(string num){
if(num.length()==0)
return {""};
int idx = num[0]-48;
string s = num.substr(1,num.length()-1);
vector<s... | ALGO | 0.998862 | 4.549094 |
92ca894e-042c-4e6e-8f59-d00dfc289525 | rblankley/mofo | src/util/cbnd.cpp | /**
* @file cbnd.cpp
*
* @copyright Copyright (C) 2021 Randy Blankley. All rights reserved.
*
* @section LICENSE
*
* This file is part of mofo.
*
* Money4Options is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Fou... | ALGO | 0.997574 | 6.819348 |
5b917d52-c74c-4d5e-b411-0d5e787f532b | devi5040/Vectors | accessing-elements/frontandback.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> myvector(10);
for (int i = 0; i < myvector.size(); i++)
{
myvector[i] = i * 2 + 1;
}
cout << "The vector is: ";
for (int i = 0; i < myvector.size(); i++)
{
cout << ' ' << myvector[i];
}
... | ALGO | 0.988131 | 4.025704 |
561d047f-87fb-4b1e-bfd5-b926a82c2da5 | zjuws/jobdu-course | 题目3 特殊排序/题目1185:特殊排序.cpp | /**************************************************************
时间限制:1 秒 内存限制:32 兆 特殊判题:否
题目描述:
输入一系列整数,将其中最大的数挑出,并将剩下的数进行排序。
输入:
输入第一行包括1个整数N,1<=N<=1000,代表输入数据的个数。
接下来的一行有N个整数。
输出:
可能有多组测试数据,对于每组数据,
第一行输出一个整数,代表N个整数中的最大值,并将此值从数组中去除,将剩下的数进行排序。
第二行将排序的结果输出。
样例输入:
4
1 3 4 2
样例输出:
4
1 2 3
提示:
如果数组中只有一个数,当第一行将其输出后,第二行请输出"-... | ALGO | 0.99991 | 3.64489 |
900071ae-7bb4-475a-b1bf-c213af6356ae | eungi-aiza/BasicAlgorithm | donghwa/arxiv/topological_sort/2192_all_ancestors.cpp | /* 2192. All Ancestors of a Node in a Directed Acyclic Graph
You are given a positive integer n representing the number of nodes of a Directed Acyclic Graph (DAG). The nodes are numbered from 0 to n - 1 (inclusive).
You are also given a 2D integer array edges, where edges[i] = [fromi, toi] denotes that there is a uni... | ALGO | 0.999986 | 7.086516 |
20de92de-989c-4c21-ae30-bfcd305a788c | matsumoto2004/competitive_programming | archive/archive_practice/ABC197F.cpp | #include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, k, n) for (int i = k; i < (int)(n); i++)
#define repd(i, n) for (int i = n-1; i >= 0; i--)
#define rrepd(i, k, n) for (int i = n-1; i >= (int)(k); i--)
#define all(x) (x).begin(),(x).end()
#define chmax(x,y... | ALGO | 0.999951 | 4.47153 |
c5bd0143-3c6a-4cce-bf68-9b8f55c52ab5 | ROCm/firdev-llvm-project | libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate_copy.pass.cpp | // <algorithm>
// template<ForwardIterator InIter, OutputIterator<auto, InIter::reference> OutIter>
// constexpr OutIter // constexpr after C++17
// rotate_copy(InIter first, InIter middle, InIter last, OutIter result);
// Older compilers don't support std::is_constant_evaluated
// UNSUPPORTED: clang-4, ... | TEST | 0.970889 | 7.481849 |
2fb5d5c2-27af-40b6-94c7-459a6beb87d1 | tsai1247/LeetcodePractice | Algorithms/000417- Pacific Atlantic Water Flow/Solution.cpp | #include<bits/stdc++.h>
using namespace std;
// Time complexity: O( )
// Space complexity: O( )
class Solution {
private:
const int None = 0x00;
const int Pacific = 0x01;
const int Atlantic = 0x10;
const int Both = 0x11;
public:
vector<vector<int>> pacificAtlantic(vector<vector<int>>& heights... | ALGO | 0.999805 | 5.894917 |
e5a95787-4e0b-417d-9493-25b93ccf42b7 | PetarPetrakiev93/C-Study | Syntax/1.Homework/4.PrintNumbers.cpp | #include<iostream>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
cout << i << endl;
}
return 0;
} | ALGO | 0.997467 | 3.831316 |
da26c493-f772-487f-9212-79277ebb1cc1 | wazxser/Online-Judge | leetcode/55_Jump Game.cpp | //题意:给定数组,数组每个元素代表从该位置最多可以前进的步数,问是否能够达到最后一个元素的位置?
//思路:设定一个可以达到位置的数组,遍历原数组,将所有可以达到的位置标记下来,遍历时,如果有元素不能被到达,那最后一个位置肯定也不能达到。
class Solution {
public:
bool canJump(vector<int>& nums) {
vector<bool> judge(nums.size(), 0);
judge[0] = 1;
for(int i = 0; i < nums.size(); i++){
if(judge[i]... | ALGO | 0.999991 | 5.91257 |
1452ce21-a354-44c2-9ef6-38c3c4c454db | MrCryptoBeast/BSTP | src/wallet/crypter.cpp | #include <wallet/crypter.h>
#include <crypto/aes.h>
#include <crypto/sha512.h>
#include <util/system.h>
#include <vector>
int CCrypter::BytesToKeySHA512AES(const std::vector<unsigned char>& chSalt, const SecureString& strKeyData, int count, unsigned char *key,unsigned char *iv) const
{
// This mimics the behavio... | TOOL | 0.935509 | 7.291304 |
32654edd-5904-46fe-b90c-9ab7805e2a51 | AnghelescuAlbert/chess-bot | chess_logic/src/eval/evaluator.cpp | #include "evaluator.hpp"
namespace evaluation {
int Evaluator::eval(const Board &board) {
int result = 0, mgScore = 0, egScore = 0;
int stronger, weaker;
/*TODO: Transposition table search position */
v.gamePhase = 0;
v.mgMob[WHITE] = 0; v.mgMob[BLACK] = 0;
v.egMob... | ALGO | 0.997835 | 5.74055 |
4c03019d-86f1-4646-8310-1c71bb3e3e98 | sajeeshsidh/mesa | src/compiler/glsl/opt_dead_code.cpp | /**
* \file opt_dead_code.cpp
*
* Eliminates dead assignments and variable declarations from the code.
*/
#include "ir.h"
#include "ir_visitor.h"
#include "ir_variable_refcount.h"
#include "compiler/glsl_types.h"
#include "util/hash_table.h"
static bool debug = false;
/**
* Do a dead code pass over instructions... | ALGO | 0.895405 | 7.918088 |
a21de138-5679-4c78-b641-e017ef1c24f3 | IreshEranga/OOC-Object-Orientaion-Concepts | LabSheet/03/Exercise 02.cpp | #include <iostream>
#include <iomanip>
using namespace std;
float Perimeter(float &length, float &width);
float Cost(float Perimeter, float &cperm);
int main()
{
float length = 28;
float width = 15;
float cperm;
cout<<"Perimeter of fence is : "<<Perimeter(length,width)<<" m"<<endl;
cout<<"Enter cost per met... | TOOL | 0.951031 | 4.1007 |
1d22079b-555d-4572-aba1-6e8b29dd1e1f | JacobKong/Leetcode_Solutions | 303_Range Sum Query - Immutable.cpp |
class NumArray {
public:
// vector<vector<int> > nums_sum_vec;
// int** nums_sum_vec;
int* nums_sum_vec;
NumArray(vector<int> nums) {
int nums_size = nums.size();
// nums_sum_vec = new int*[nums_size];
nums_sum_vec = new int[nums_size+1];
for (int i=0; i<num... | ALGO | 0.999736 | 5.394331 |
0bddf5ef-0c2f-4aac-b950-d2fc222894a2 | Didk0/Design-And-Analysis-Of-Algorithms-Practicum | SortingAndSearching/TwoPointers_Bucketing_SlidingWindow/LongestSubstrNoRepeats/LongestSubstrNoRepeats.cpp | #include <iostream>
#include <unordered_map>
#include <string>
using namespace std;
int main()
{
// : https://leetcode.com/problems/longest-substring-without-repeating-characters/description/
string str = "pwwkew";
unordered_map<char, int> char_ind;
int max = 0, curr = 0, start = 0;
for (size_t... | ALGO | 0.999985 | 5.486138 |
9ff89596-7c65-4695-85e0-aabf6108b8b3 | fvizpal/dsA | G14_BridgesInGraph.cpp | /* o> Bridges in a graph
Bridge ek aisi edge hoti hai jisko remove kaarne se no. of connected components increase kar jayenge
brute force approach
har edge ko pakodo aur remove karke check karo; now check using dfs how many components; if no. of connecctes neighbours == 0;
by DFS
// but we shall have an... | ALGO | 0.999851 | 6.101635 |
0920ef59-8c88-4784-8af2-51cb5aa49e6f | marioyc/CP-Library | geometry/polygon.cpp | //verdadero : sentido anti-horario, Complejidad : O(n)
bool ccw(const vector<point> &poly){
//primero hallamos el punto inferior ubicado mas a la derecha
int ind = 0,n = poly.size();
double x = poly[0].x,y = poly[0].y;
for(int i = 1;i < n;i++){
if(poly[i].y > y) continue;
if(fabs(poly[i... | ALGO | 0.999848 | 4.648154 |
7e0bfc1e-885e-4cee-973b-19d79b90015b | AdityaPrakash-26/Leetcode-Solutions | Aditya/0100-0999/102.binary-tree-level-order-traversal.cpp | /*
Accepted
34/34 cases passed (0 ms)
Your runtime beats 100 % of cpp submissions
Your memory usage beats 61.05 % of cpp submissions (12.5 MB)
*/
/*
* @lc app=leetcode id=102 lang=cpp
*
* [102] Binary Tree Level Order Traversal
*/
// @lc code=start
/**
* Definition for a binary tree node.
* struct TreeNode {
*... | ALGO | 0.999921 | 6.546852 |
8e0a45a3-adb3-4fe1-a21d-3bf577d564bf | aroraadivya/LeetCode-Questions | 2202-sum-of-k-mirror-numbers/2202-sum-of-k-mirror-numbers.cpp | class Solution {
public:
long long createPalindrome(long long num, bool odd) {
long long x = num;
if (odd) x /= 10;
while (x > 0) {
num = num * 10 + x % 10;
x /= 10;
}
return num;
}
bool isPalindrome(long long num, int base) {
vector<i... | ALGO | 0.999955 | 5.662604 |
64eca60c-918e-49a9-af8a-71f813dbbcdb | raincross7/code-similarity | codes/train_code/problem469/problem469_295.cpp | /* CREATED BY
STREAM_CIPHER
07-sep-2020
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define double long double
#define debug1(a) cout<<#a<<"="<<(a)<<"\n"
#define debug2(a,b) cout<<#a<<"="<<(a)<<","<<#b<<"="<<(b)<<"\n"
#define debug3(a,b,c) cout<<#a<<"="<<(a)<<","<<#b<<"="<<(b)<<",... | ALGO | 0.999949 | 4.124978 |
6f9b1e7f-6dbc-4d55-884a-865d25c92374 | MY-stone/data_structure | 数据结构(C语言版)(第2版)-源代码/第6章/6.8.cpp | //㷨6.8ķ㷨
#include <iostream>
using namespace std;
typedef char VerTexType;
typedef int ArcType;
#define MVNum 100
#define MaxInt 32767 //ʾֵ
//Ķ壬¼Ӷ㼯UV-UȨֵСı
struct{
VerTexType adjvex; //СUеǸ
ArcType lowcost; //СϵȨֵ
}closedge[MVNum];
//- - - - -ͼڽӱ洢ʾ- - - - -
typedef char VerTexT... | ALGO | 0.999041 | 3.881366 |
3cf9ca26-d0bb-4321-b656-f0402cf4d6e4 | raincross7/code-similarity | codes/train_code/problem415/problem415_188.cpp | #include <iostream>
#include <cstdlib>
#include <math.h>
#include <iomanip>
using namespace std;
struct Point { double x, y; };
void koch(int n, Point a, Point b){
if(n == 0) return;
Point s,t,u;
double th = M_PI * 60.0 / 180.0;
s.x = (2*a.x + b.x)/3;
s.y = (2*a.y + b.y)/3;
t.x = (a.x + 2*b.x)... | ALGO | 0.999864 | 3.686174 |
a89eccfb-65be-4e09-b70d-10673cb259b2 | MahfuzLinkon/Phitron_CS | Basic Data Structures/Module_02_5_Practice_Day_01/J_Count_Letters.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin >> s;
vector<int> c(26, 0);
for (int i = 0; i < s.size(); i++)
{
int index = s[i] - 'a';
c[index]++;
}
for (int i = 0; i < 26; i++)
{
if (c[i] > 0)
{
cout << char(i +... | ALGO | 0.998518 | 3.986284 |
d8573290-2cfb-4ac8-8490-df37cb0b284b | ChristopheEhret/AdventOfCode | 2.cpp | #include <fstream>
#include <iostream>
#include <cmath>
#include <cstdint>
#include <sstream>
#include <optional>
// Returns false if diff does not respect the requirements. Will set 'increasing' if currently std::nullopt.
bool checkDiff(std::optional<bool>& increasing, int diff) {
if (increasing.has_value()) {
... | ALGO | 0.999691 | 5.072676 |
ff784c63-42da-4680-ad34-1f3cf3f2c29c | harshhy2012/CodingPractice | SearchingAndSorting/bubbleSort.cpp | #include<bits/stdc++.h>
using namespace std;
void bubbleSort(vector<int> &arr){
int n = arr.size();
for(int i=0;i<n-1;i++){
for(int j=i+1;j<n;j++){
if(arr[i]>arr[j])
swap(arr[i], arr[j]);
}
for(auto i: arr){
cout<<i<<" ";
}
cout<<... | ALGO | 0.999717 | 4.553623 |
f71d71c7-2c7a-4188-ab76-351b04e904db | hacch141/Coding-Practice | GFG/DP/20.Number-of-Coins.cpp | // Minimum coins
// Memoization
class Solution{
private:
int solve(int idx, int coins[], int V, vector<vector<int>>& dp) {
if(idx==0) {
if(V%coins[0] == 0) {
return V/coins[0];
}
return 1e9;
}
if(dp[idx][V] != -1) return dp[idx][V... | ALGO | 0.999997 | 5.99629 |
ef6e9831-4812-49f3-8729-8302cccb0499 | TTimo/doom3.gpl | neo/framework/Unzip.cpp | #include "../idlib/precompiled.h"
#pragma hdrstop
#include "Unzip.h"
/* for more info about .ZIP format, see
ftp://ftp.cdrom.com/pub/infozip/doc/appnote-970311-iz.zip
PkWare has also a specification at :
ftp://ftp.pkware.com/probdesc.zip */
/* @(#) $Id: unzip.c,v 1.2 1999/09/07 20:51:25 zoid Exp $ */... | TOOL | 0.871493 | 5.34022 |
46fa8bd8-d5a6-4309-abd6-fcbc1a374690 | motokimura/SCTracker | eigen-eigen-6b38706d90a9/bench/sparse_setter.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
// -DNOGMM -DNOMTL -DCSPARSE
// -I /home/gael/Coding/LinearAlgebr... | ALGO | 0.986036 | 4.152793 |
eece6025-1071-4df5-8c09-f744dff4974b | tgog111/Samyung-test | SAMYUNG_TEST/Library/PackageCache/com.unity.ide.visualstudio@2.0.22/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include <fcntl.h>
#include <io.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call m... | TOOL | 0.919183 | 6.933585 |
b1157342-b675-40ca-9675-10328314660e | raincross7/code-similarity | codes/train_code/problem136/problem136_193.cpp | #include<bits/stdc++.h>
#define rep(i,f,n) for(ll i=(f); (i) < (n); i++)
#define repe(i,f,n) for(ll i=(f); (i) <= (n); i++)
using namespace std;
using ll = long long;
#define MOD (ll)1000000007
#define PI 3.14159265359
#define debug(x) cout<<#x<<" :: "<<x<<"\n";
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "... | ALGO | 0.999993 | 4.071967 |
66c7148b-82e9-460a-9567-d6095c315b9e | adityajamwal02/LeetcodeProblemSet1 | DesignGraphWithShortestPathCalculator.cpp | /*
There is a directed weighted graph that consists of n nodes numbered from 0 to n - 1. The edges of the graph are initially represented by the given array edges where edges[i] = [fromi, toi, edgeCosti] meaning that there is an edge from fromi to toi with the cost edgeCosti.
Implement the Graph class:
Graph(int n, int... | ALGO | 0.999968 | 6.490314 |
b54dbb1f-458a-44a2-9172-bcd64bf4fa23 | randbatch-md/lammps-rbe | src/MEAM/meam_dens_final.cpp | // clang-format off
#include "meam.h"
using namespace LAMMPS_NS;
void
MEAM::meam_dens_final(int nlocal, int eflag_either, int eflag_global, int eflag_atom, double* eng_vdwl,
double* eatom, int /*ntype*/, int* type, int* fmap, double** scale, int& errorflag)
{
int i, elti;
int m;
double rh... | ALGO | 0.993506 | 5.517433 |
7aae75fe-d584-4520-b92e-3edbbfbe0265 | ayuk007/Leetcode_Solutions | 0334-increasing-triplet-subsequence/0334-increasing-triplet-subsequence.cpp | class Solution {
public:
bool increasingTriplet(vector<int>& nums) {
if(nums.size()<3) return false;
int smallest = INT_MAX;
int middle = INT_MAX;
for(int i = 0; i<nums.size(); i++){
if(nums[i]>middle) return true;
else ... | ALGO | 0.999962 | 5.975125 |
045e3edf-4707-4334-ae68-2ef7c7fa54a4 | jin3811/BAEKJOON | 2533.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
vector<vector<int>> gh, dp;
void input() {
int a, b;
cin >> n;
gh.resize(n + 1), dp.resize(n + 1, vector<int>(2, -1));
for (int i = 1; i < n; i++) {
cin >> a >> b;
gh[a].push_back(b);
gh[b].push_back(a);
}
}
int dfs(int cur, int parent, int state) {
... | ALGO | 0.999854 | 4.679458 |
902e30fd-7c76-4109-9877-cb3df693166a | raincross7/code-similarity | codes/train_code/problem497/problem497_463.cpp | #include<algorithm>
#include<cstdio>
#define N 100001
using namespace std;
int b[N],f[N],h[N],i,n,s[N];long long a[N],t;
inline bool cmp(int u,int v){return a[u]<a[v];}
int main()
{
scanf("%d",&n);
for(i=1;i<=n;i++)scanf("%lld",a+i),s[b[i]=i]=1;
sort(b+1,b+n+1,cmp);
for(i=n;i>1;i--)
{
if(s[b[i]]<<1>=n)return 0*... | ALGO | 0.999954 | 3.114948 |
adefd82e-7f28-44ce-80d2-94013925974b | Tsukumo3/Atcoder | ABC/167/cpp/E.cpp | #include <iostream>
#include <string>
using namespace std;
int main(){
int h1;
int h2;
cin >> h1 >> h2;
int ans;
ans = h1 - h2;
cout << ans << endl;
return 0;
} | ALGO | 0.999772 | 3.026366 |
5560131f-8ebc-47fe-b6e0-7144fb9eeb81 | wx-csy/ACM-Code-Library | ACM-Codebook/Book2 - Number Theory/number-theory/pollard-rho.cpp | ULL gcd(ULL a, ULL b) {return b ? gcd(b, a % b) : a;}
ULL PollardRho(ULL n){
ULL c, x, y, d = n;
if (~n&1) return 2;
while (d == n){
x = y = 2;
d = 1;
c = rand() % (n - 1) + 1;
while (d == 1){
x = (mulmod(x, x, n) + c) % n;
y = (mulmod(y, y, n) + c) %... | ALGO | 0.999764 | 4.20319 |
7dcd66b6-c22e-4c12-b144-b1b4546ce414 | itz-AmdadulHaque/Learning-DSA-Solves- | Searching algo/Binary_search/6_leetcode69_squreRoot.cpp | #include<iostream>
using namespace std;
// int squreRoot(int x){
// if(x < 0) {
// return -1;
// }
// int ans = 0;
// for(long long int i = 0; i *i <= x; i++){
// ans = i;
// }
// return ans;
// }
int squreRoot(int x){
int s = 0;
int e = x;
long long int mid = s + ... | ALGO | 0.999872 | 4.288013 |
3b616475-c8f5-48fd-9c41-7711cd2a95f3 | raincross7/code-similarity | codes/train_code/problem251/problem251_306.cpp | /*------------------------------------
........Bismillahir Rahmanir Rahim....
..........created by Abdul Aziz.......
------------------------------------*/
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <unordered_... | ALGO | 0.999632 | 4.822734 |
03f8b876-b398-42eb-9b64-3387720d38be | aguaimale/Counter_flutter | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
4625f075-3865-44f2-b5e6-8f5dde76a497 | albertusdev/competitive-programming | CF/Edu33/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vii;
#define pb push_back
#define mp make_pair
#define fi first
#d... | ALGO | 0.999993 | 4.679969 |
192047c3-a04a-4377-9434-ac1f7e18999d | thisisaman408/DSA | DSAinC++/Lecture34(Dynamic Programming)/LDeque.cpp | // https://atcoder.jp/contests/dp/tasks/dp_l?lang=en
/*
Problem Statement
Taro and Jiro will play the following game against each other.
Initially, they are given a sequence
a=(a
1
,a
2
,…,a
N
). Until
a becomes empty, the two players perform the following operation alternately, starting from Taro:
Remove the... | ALGO | 0.999994 | 4.927897 |
70b84463-129a-4891-806c-25e4c35bbdbe | DericsonPablo/estruturadedados | Programas/setSTL.cpp | #include <iostream>
#include <set>
using namespace std;
set <int>conjunto;
set <int>::iterator it;
main{
conjunto.insert(40);
conjunto.insert(10);
conjunto.insert(20);
conjunto.insert(30);
conjunto.insert(50);
for(it = conjunto.begin(); it != conjunto.end(); it++)
cout << *it << " "... | ALGO | 0.996296 | 3.472826 |
f68177ba-448f-411b-bb2c-82fff1a67f11 | GuillermoTafoya/AlgoToolboxSolutions | Self Tests/HackerRank/flippingMatrix/flippingMatrix.cpp | #include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
vector<string> split(const string &);
/*
* Complete the 'flippingMatrix' function below.
*
* The function is expected to return an INTEGER.
* The function accepts 2D_INTEGER_ARRAY matrix as parameter.
*/
i... | ALGO | 0.999929 | 5.863869 |
42f92a8e-d2b6-4189-81b3-a3c6c51851a3 | Alaxe/noi2-ranking | 2017/solutions/A/VLV-Plovdiv/sdiv.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
using namespace std;
long long n,m;
string s;
int main ()
{
long long ans;
cin>>s;
cin>>n>>m;
ans=(ans+rand())%m;
cout<<ans<<endl;
return 0;
}
| ALGO | 0.999882 | 3.132392 |
4617d2cf-08c7-458e-8353-2fcfa577d16e | rahulsrs/OOPS-cpp | isprime.cpp | #include <iostream>
using namespace std;
bool isprime(int x){
if(x<0)
return false;
else if (x==0||x==1)
return false;
else{
for(int i=2;i<x;i++){
if(x%i==0)
return false;
}
return true;
}
}
int main(){
int x;
cout << "Enter t... | ALGO | 0.999323 | 3.557983 |
22bdb65f-d605-4543-8ae2-4c95f3d597c5 | brute136/C--Problems_Solutions | FuntionSloved.cpp | #include <iostream>
#include <string>
using namespace std;
int fun(int a, int b, int c, int d){
// int b =
int v = max(a, b);
int g = max(c, d);
if (v>g){
return v;
}
else{
return g;
}
}
//func//
int main(){
int a,b,c,d;
scanf("%d %d %d %d", &a, &b, &c, &d);
cout<<fun(a, b, c, d);
ret... | ALGO | 0.999666 | 4.291575 |
1ac89ca9-8ab6-4bab-9fd5-ac4f9c9b2000 | alexandraback/datacollection | solutions_5634947029139456_0/C++/ZachP/main.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <string.h>
#include <cmath>
#include <vector>
#include <algorithm>
#include <iomanip>
#define MAX 100
#define test(a) cout << "TEST " << a << endl;
#define go(a,b) for(int a=0; a<b; a++)
#define case(a) fout << "Case #"<< a << ": " <<
using namespace st... | ALGO | 0.999657 | 3.877037 |
7cbeff13-e993-47f1-9d85-da7f905fc15d | tickbh/VisualUIEditor_2dx_demo | cocos2d/cocos/vr/CCVRDistortion.cpp | #include "vr/CCVRDistortion.h"
#include <math.h>
NS_CC_BEGIN
Distortion::Distortion()
{
_coefficients[0] = 0.441f;
_coefficients[1] = 0.156f;
}
void Distortion::setCoefficients(float *coefficients)
{
for (int i = 0; i < s_numberOfCoefficients; i++)
{
_coefficients[i] = coefficients[i];
}
... | TOOL | 0.931826 | 5.829333 |
36fdbc5d-3a2b-48fc-aca6-0c8e8ba3749b | yundonghae/CPP2409 | challenge/week4/switch_eng_number.cpp | #include <iostream>
using namespace std;
int main() {
int number;
cout << "숫자를 입력하시오:";
cin >> number;
switch (number) {
case 0:
cout << "zero" << endl;
break;
case 1:
cout << "one" << endl;
break;
default:
cout << "many" << endl;
}
return 0;
} | ALGO | 0.994735 | 4.266302 |
3882acdb-3cb8-4de9-aabc-712856e235d2 | julianguerrero13/Sprint2 | 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 |
464cadd1-e8ab-4492-94bb-87f7466729f0 | Sy0307/Self_Practice_For_Algorithm | CF/ECR 134/A.cpp | #include <bits/stdc++.h>
using namespace std;
using ui = unsigned int;
using ull = unsigned long long;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int maxn = 1e5 + 10;
const int mod = 1000000007;
#define inl inline
#define fr(i, a, b) for (int i = a; i <= b; i++)
#define ford(i, a,... | ALGO | 0.999677 | 4.751656 |
1471fa6c-5ff5-4b1d-893f-2d9c7c01d288 | Cha-V/AllCodesCloser | CodeForces/518AVitalyAndStrings.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string a, b;
cin>>a>>b;
int i=0;
int n=a.length();
i=n-1;
while(i>=0){
if(a[i]=='z'){
a[i]='a';
}
else{
a[... | ALGO | 0.999961 | 3.557123 |
d36dfb40-ad64-4997-8060-ec1bbe065568 | ammar-n-abbas/sim2real-ur-gym-gazebo | ur_ikfast/ur10e/ikfast_wrapper.cpp | /*
* THIS IS A MODIFIED VERSION OF THE FOLLOWING:
*
* IKFast Demo
*
* Shows how to calculate FK from joint angles.
* Calculates IK from rotation-translation matrix, or translation-quaternion pose.
* Performance timing tests.
*
* Run the program to view command line parameters.
*
*
* To compile, run:
* ... | ALGO | 0.981994 | 5.49495 |
be75a3d5-8fa2-45c8-9cfe-0aabdaeb2b49 | nguyenhongduc2411/Nostalgia | CTDL>/2024-2025/HK1-K23/GiuaKy/23TNT1TN/Cau1.cpp | #include <iostream>
using namespace std;
const int m = 4;
const int n = 3;
const int INF = 100;
void print(int Y[m][n])
{
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
cout << Y[i][j] << " ";
}
cout << "\n";
}
}
// 2. O(m + n): Liên tưởng đến thao tác lấy phầ... | ALGO | 0.999965 | 3.800064 |
55427480-9669-4451-a4f6-6d1f133be044 | neuskb/leetcode | 合并两个有序链表.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* mergeTwoLis... | ALGO | 0.999961 | 5.899672 |
0959ca88-f752-4b13-be70-e02a5cc971f5 | aospa-pp/android_packages_modules_adb | adb_listeners.cpp | #include "adb_listeners.h"
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <list>
#include <memory>
#include <android-base/stringprintf.h>
#include <android-base/strings.h>
#include <android-base/thread_annotations.h>
#include <cutils/sockets.h>
#include "socket_spec.h"
#include "sysdeps.h"
#in... | TOOL | 0.986948 | 6.890182 |
fed9dd84-8692-4deb-9cae-60cc1080658b | aadil124/Data-Structure-and-Algorithm-Assignments | quickSort.cpp | #include <iostream>
using namespace std;
int partition(int a[], int s, int e)
{
int pivot = a[e];
int i = s - 1;
int temp;
for (int j = s; j < e; j++)
{
if (a[j] < pivot)
{
i++;
temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
... | ALGO | 0.999934 | 4.519384 |
38f5db82-2039-4232-9cfc-506069fa9d62 | permanentbelief/programmer_road | ACwing/数独.cpp | #define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;
const int N = 25;
bool books[N];
int index = 0;
void dfs(vector<vector<int>... | ALGO | 0.999975 | 3.615738 |
c561771b-4761-40a9-9d8e-00078eb690b0 | zayedrmdn/langify | 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 |
e5485b83-3112-433f-80e1-81f0755c0b3e | wonhong-choi/Algorithm | Mathematics.cpp | #include <iostream>
#include <climits>
#include <vector>
#include <math.h>
// the number of digits in integer n
// Given:
// n>0
int countDigit(int n){
int count{0};
while(n>0){
n/=10;
++count;
}
return count;
}
// palindrome number
// Given:
// n>=0
bool isPalindrome(int n){
if(n/10==0)
return true;
in... | ALGO | 0.999699 | 5.928431 |
409402e4-c6b2-4c10-ab32-7d619cf1e694 | cbkpar/BOJ | boj_25184.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int iN;
cin >> iN;
for (int i = 1;i <= iN;++i)
{
if (i % 2 == 0)
{
cout << i / 2;
}
else
{
cout << (iN + 1 + i) / 2;
}
cout << (i ==... | ALGO | 0.999816 | 3.819587 |
da9499a8-4da1-4fd7-b929-22e8a85735d0 | ChenRunyang/PAT | 1091_n_self.cpp | #include<iostream>
using namespace std;
int main()
{
int num;
cin>>num;
int src[num];
for(int i=0;i<num;i++)
{
cin>>src[i];
}
int det;
bool flag=false;
bool det_flag=false;
int tmp;
int tmp1;
int j,m;
for(int i=0;i<num;i++)
{
det_flag=false;
... | ALGO | 0.999866 | 3.019463 |
7c4684b3-ffe4-4f6f-8171-ba271d74f447 | ishandutta2007/codeforces | t1dus/normal/1290/B.cpp | // --------------------------------------------------<TEMPLATE>--------------------------------------------------
// --------------------<optimizations>--------------------
#pragma GCC optimize("O3")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN NEEDED)\
#pr... | ALGO | 0.999973 | 4.021468 |
43155fab-e6a7-4caa-af2b-186a21d9dff4 | triptisharma827/week1-DP5-CipherSchools | mergeSortArray2_itr.cpp | #include<bits/stdc++.h>
using namespace std;
// with iterative approach
int firstOcc(vector<int> &nums,int low,int high,int element, int left){
while(low<=high){
int mid=low+(high-low)/2;
if(nums[mid]==element){
left=mid;
high=mid-1;
}
else if(nums[m... | ALGO | 0.999932 | 5.487847 |
564c0cb0-d5a8-47c7-8d1e-39de5d2467f3 | DukeHuangWP/GoExample-GoCV-Install-In-Windows | opencv-4.6.0/modules/imgproc/src/phasecorr.cpp | #include "precomp.hpp"
#include <vector>
namespace cv
{
static void magSpectrums( InputArray _src, OutputArray _dst)
{
Mat src = _src.getMat();
int depth = src.depth(), cn = src.channels(), type = src.type();
int rows = src.rows, cols = src.cols;
int j, k;
CV_Assert( type == CV_32FC1 || type == C... | ALGO | 0.989961 | 5.94201 |
c1d71d4a-81aa-4696-809b-aa5d5a537a66 | mvrkxsaleh/Lab-25a | function4.cpp | /******************************************************************************
* AUTHOR : Nick Terrazes & Mark Saleh
* STUDENT ID : 1080548 & 1060488
* Lab #25a : Array Train - set #1
* CLASS : CS1A
* SECTION : MW-8am
* DUE DATE : 4/24/18
*********************************************************... | TOOL | 0.988765 | 4.543794 |
2bff9fd9-5ab4-4d7d-9908-70b251ada86f | antmanler/PebbleEngine | Dependence/Bullet/Extras/GIMPACTUtils/btGImpactConvexDecompositionShape.cpp | #include "btGImpactConvexDecompositionShape.h"
#include "BulletCollision/CollisionShapes/btConvexHullShape.h"
#include "ConvexBuilder.h"
class GIM_ConvexDecomposition : public ConvexDecomposition::ConvexDecompInterface
{
protected:
btGImpactConvexDecompositionShape * m_compoundShape;
btAlignedObjectArray<btCollisi... | ALGO | 0.993556 | 6.733342 |
336bb1bf-5f27-4084-a633-25dcab171d74 | boms03/data-structures-and-algorithms | Segment Tree/5419.cpp | #include<iostream>
#include<cmath>
#include<climits>
#include<vector>
#include<algorithm>
using namespace std;
vector<vector<int>>mst;
vector<pair<int,int>>coord;
int t,n;
bool comp(pair<int,int> a , pair<int,int>b){
if (a.first != b.first) return a.first > b.first;
return a.second < b.second;
}
void init(in... | ALGO | 0.999893 | 4.36877 |
f5afa725-35e3-4b26-9265-6f214f9b1423 | shubhkush57/LeetQues | Unique rows in boolean matrix - GFG/unique-rows-in-boolean-matrix.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
#define MAX 1000
vector<vector<int>> uniqueRow(int M[MAX][MAX],int row,int col);
// } Driver Code Ends
class Solution
{
public:
// #define MAX 1000
vector<vector<int>> uniqueRow(int M[MAX][MAX],int row,int col)
{
//Your code h... | ALGO | 0.999424 | 4.661107 |
967172ea-e4d7-4ff7-9eec-69777a5af8c0 | bishakh17/CP | Problems/D_Absolute_Sorting.cpp | #include <iostream>
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
#define cout(x) cout<<(x)<<endl
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
int T = 1;
void solve(){
int n; cin>>n;
vector<int> a(n);
for(int i = 0; i<n; i++) cin>>a[i]... | ALGO | 0.998594 | 4.790728 |
f41e295b-5b61-4ac3-ac01-058c51d48cf6 | zzs456/Qt_projects | TeachingSystem/src/Algo_GA/algo_ga.cpp | #include "algo_ga.h"
#include <QtGlobal>
#include <QDebug>
#include <QtMath>
#include <algorithm>
#include <stdlib.h>
#include <time.h>
Algo_GA::Algo_GA(QObject *parent)
: QObject{parent}
{}
void Algo_GA::initGA()
{
if(m_proId == 1){
m_funcPopus.clear();
}else if(m_proId == 2){
m_pathPopu... | ALGO | 0.999755 | 4.909144 |
7227dba8-00e4-4282-a350-eee347ae1a90 | RajMakkad/LeetCode | 733-flood-fill/733-flood-fill.cpp | class Solution {
public:
vector<vector<int>> floodFill(vector<vector<int>>& img, int sr, int sc, int nC) {
int n = img.size();
int m = img[0].size();
int colour;
queue<pair<int,int>> q;
if(img[sr][sc]!=nC){
q.push({sr,sc});
colour = img[sr][sc];
... | ALGO | 0.988641 | 6.852737 |
fcbe4aac-9e07-4147-b8c4-0a05770b4a05 | Alls-DeV/CSES | IntroductoryProblems/Repetitions.cpp | // https://cses.fi/paste/787d5c07427cb8b287967c/
#include <bits/stdc++.h>
#ifdef ALE
#include "/home/alls/CompetitiveProgramming/Library/debug.h"
#else
#define dbg(...)
#endif
using namespace std;
void solve() {
string s; cin >> s;
s.push_back('_');
int ans = 1;
for (int i = 1, tmp = 1; i < (int)s.si... | ALGO | 0.999822 | 3.777438 |
5d370d13-f010-454a-8e4b-b9569c8cf8b4 | Keshav76/DSA-with-C- | Pointer.cpp | // * gives value of variable at the location stored in operand
// & gives address of variable
#include<iostream>
using namespace std;
void swap(int *a, int *b) //for pass by refernce, we should accept parameters as pointers; so we get address of variable
{
int temp = *a;
*a = *b;
*b = temp;
}
int m... | TOOL | 0.966277 | 4.56645 |
31f56aeb-cbb6-442c-9b36-d2f6f0538540 | PritishDoc/DSA-in-C- | Array/SmallestandLargestIndex.cpp | #include<iostream>
using namespace std;
int main() {
int size = 6;
int arr[size] = {3, 99, 67, 4, 2, 34};
// Initialize smallest and largest to extreme values
int smallest = INT16_MAX;
int largest = INT16_MIN;
// Variables to store the index of the smallest and largest elements
int sm... | ALGO | 0.999954 | 5.395386 |
f3616adb-9dec-4813-991a-4510aecaff17 | glennychen/cp3 | leetcode/QtcreatorProjects/untitled43/main.cpp | // https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string/solution/
#include <iostream>
#include <deque>
using namespace std;
class Solution {
public:
string removeDuplicates(string S) {
deque<char> d;
for(const auto& c:S){
if(!d.empty() && d.back()==c){ //d.back() can ... | ALGO | 0.999184 | 6.177238 |
b654dd96-42c4-4278-93e4-2f6ba0a41f48 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_10961_1.cpp | #include <bits/stdc++.h>
using namespace std;
const int OO = 2e9;
const int MOD = 1e9 + 7;
const double Pi = 3.141592653589793;
const int N = 1e5 + 5;
int a[N], b[N], fact[N], cnt[3000], d = 0, n, m = 0, mxv = 0, k, res = 0;
long long dp[3000][3000];
bool lucky(int x) {
if (x == 0) return false;
while (x) {
if ... | ALGO | 0.999865 | 4.085217 |
82fceb08-ac6a-44ca-917d-5f290beef6c8 | KatsuyaKikuchi/ProgrammingContest | AtCoder/AtCoder Regular Contest/ARC111/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> pll;
#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(40)
const ll MOD = 1000000007;
const ll INF = (ll) 1e15;
ll C[105];
struct Vertex {
vector<ll> edge;
}... | ALGO | 0.999997 | 4.09876 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.