uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
eeb9751c-a189-4cb3-9f98-d8b4d3cf8753
commonapi-someip/boost_1_71_0
libs/sort/example/double.cpp
// See http://www.boost.org/libs/sort for library home page. #include <boost/sort/spreadsort/spreadsort.hpp> #include <time.h> #include <stdio.h> #include <stdlib.h> #include <algorithm> #include <vector> #include <string> #include <fstream> #include <iostream> using namespace boost::sort::spreadsort; #define DATA_T...
ALGO
0.997508
4.945207
ac16b0a7-9609-4020-b88c-b2972272bd33
shariar-opu/CFsolve
C_Long_Multiplication.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define int ll #define endl '\n' #define watch(x) cerr << "\n" \ << (#x) << " is " << (x) << endl #define time cerr << "time = " << clock() << " ms" << '\n' #define youhua() \ ios_base ::sync_with_stdio(0); \ ...
ALGO
0.999967
5.189915
cd5853f1-21f9-49d4-bf43-1c5626996b55
satingaux/ProjectEuler
3.cpp
#include<bits/stdc++.h> using namespace std; int prime(long long unsigned int n){ int isPrime=1; for(long long unsigned int i=2;i<=n/2;i++){ if(n%i==0){ // cout<<"z="<<i; isPrime= 0; break; } } return isPrime; } int main(){ long long unsigned int i,n=600851475143; for(i=2;i<n/2;i++){ if(n%i==0 &&...
ALGO
0.999442
3.76684
fad8e8f4-8bfd-471a-a7b6-952246778707
Anandarajsece/OOP_FDP
FDP/algorithm.cpp
#include<iostream> #include<vector> using namespace std; int main() { vector<int> v={4,6,3,4,5}; vector<int> v2(5); int n=v.size(); copy(v.begin(),v.end(),v2.begin()); for(int i=0;i<n;i++) { cout<<v[i]<<" "; } cout<<endl; for(int i=0;i<n;i++) { cout<<v2[i]<<" "; ...
ALGO
0.999514
3.06362
a864a053-ce82-4301-bc4e-f918e49fb737
netpipe/IrrlichtDemos
Other/Luna16-old/TerrainFactory/simplexnoise1234.cpp
#include "simplexnoise1234.h" #define FASTFLOOR(x) ( ((x)>0) ? ((int)x) : (((int)x)-1) ) unsigned char SimplexNoise1234::perm[512] = {151,160,137,91,90,15, 131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23, 190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,...
ALGO
0.999628
6.424263
38f3a6b6-edbf-45a9-94ea-f1a02868c9d0
ProdanRaduMatei/LeetCode
Solutions/136. Single Number/main.cpp
#include <vector> using namespace std; class Solution { public: int singleNumber(vector<int> &nums) { int acc = 0; for (int x : nums) acc ^= x; return acc; } };
ALGO
0.999352
5.583521
71795f9e-7ddd-4680-9b19-302e69a191c2
Rkda8071/PS
JUNGOL/1841_worldcup/main.cpp
#include<bits/stdc++.h> using namespace std; int a[10][3],n=6; bool f(int x,int k){ if(x==n) return 1; bool chk = false; for(int i=k;i<=n;i++){ for(int j=0;j<3;j++){ if(a[x][j]>0 && a[i][2-j]>0){ a[x][j]--; a[i][2-j]--; chk |= f(x,k+1); a[x...
ALGO
0.99987
4.347226
4c48b88d-d2ae-436a-918f-8b4e741f74f4
harsh-solanki21/SI21-CP-MERN
CP (GFG, Leetcode, CodeChef, CSES, etc.)/allSubsetsBitManipulation.cpp
#include<bits/stdc++.h> using namespace std; void subsets(int a[], int n) { for(int i=0; i<(1<<n); i++) { for(int j=0; j<n; j++) { if(i & (1 << j)) { cout<<a[j]<<" "; } } cout<<endl; } } int32_t main() { ios_base::sync_with_stdio(false); ...
ALGO
0.999106
4.479245
5c906778-f069-4943-8d69-104f891062f8
S4ltF1sh/CODE-PTIT-CPP
CPP0142.cpp
#include <iostream> #include <vector> #include <string> #include <cmath> #include <algorithm> using namespace std; long long UCLN(long long a, long long b) { if (a == 0 || b == 0) { return a + b; } return UCLN(b, a % b); } bool isPrime(long long n) { if (n < 2) return false; for ...
ALGO
0.999884
5.117544
00c76978-5f58-49bd-b82d-c2957181ca5a
minislively/Practice
ConsoleApplication168/ConsoleApplication168.cpp
#include <iostream> using namespace std; int main() { int t, a, b; cin >> t; for (int i = 0; i < t; i++) { cin >> a >> b; cout << a + b << '\n'; } }
ALGO
0.999585
5.451596
28611be3-c9bf-4018-a369-b4d59489477f
aakash416/Leetcode
129. Sum Root to Leaf Numbers.cpp
#include <bits/stdc++.h> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode() : val(0), left(nullptr), right(nullptr) {} TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right...
ALGO
0.999981
5.923334
40cd552d-080e-4d2e-a44a-466655d071ec
dmorcos6174/Solved-Problems
UVA/1213/43193566_AC_2690ms_0kB.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef long long ull; typedef vector<ll> vi; typedef vector<bool> vb; typedef vector<char> vc; typedef vector<vector<ll>> vii; typedef vector<vector<vector<ll>>> viii; typedef vector<vector<bool>> vbb; typedef vector<vector<ch...
ALGO
0.99984
3.43539
f8ff716c-fe2c-4142-9245-4125683af80a
stefanroata/problems-and-algorithms-cpp
26.02.2016/nrprime1.cpp
#include <iostream> #define VALMAX 1000001 using namespace std; int v[VALMAX],a[601][601]; void ciur() { int i,j; v[0]=v[1]=1; for(i=4;i<=VALMAX;i+=2) v[i]=1; for(i=3;i*i<VALMAX;i+=2) { if(v[i]==0) { for(j=i*i;j<=VALMAX;j+=i) v[j]=1; } ...
ALGO
0.999931
3.412095
e2ed46bc-f0e1-46c6-bb73-c39d2e2daddc
nomaannm/DS-ALGO-Sheets
TopSWE 100/Q8_NumberOfSetBits.cpp
class Solution { public: int hammingWeight(int n) { if(n == 0 || n == 1) return n; int setBits = 0; while(n > 1){ if(n % 2 == 1) setBits++; n /= 2; } setBits++; return setBits; } };
ALGO
0.999934
6.164217
4bee6bc5-f8e3-4617-8238-e36d000c7dbe
Anmolawasthi117/Dsa_using_C-
mergeSort/inversionCountOptimize.cpp
#include <iostream> #include <vector> #include <bits/stdc++.h> using namespace std; int c = 0; int inversion(vector<int> &a, vector<int> &b) { int count = 0; int i = 0; int j = 0; while (i < a.size() && j < b.size()) { if (a[i] > b[j]) { count += (a.size() - i); ...
ALGO
0.999954
4.74935
d11f9792-e82a-4c7d-b1ef-a958cbec8490
zhouZH704403055/Cpp_program
求正数数组最小不可组成和/test.cpp
#include <iostream> #include <vector> class Solution { public: int getFirstUnFormedNum(std::vector<int> &arr, int length) { int sum = 0,min = arr[0]; int i, j; for(int i = 0; i < length; i++) { sum += arr[i]; min = arr[i] < min ? arr[i] : min; } std::vector<int> dp(sum + 1, 0); for(i = 0; i < l...
ALGO
0.999791
3.655994
3c1da589-42ee-4a4f-8fb6-b44fa04e6849
BoShi-Code/leetcode
algorithms/cpp/rotateArray/rotateArray.cpp
// Source : https://leetcode.com/problems/rotate-array/ // Author : Hao Chen // Date : 2015-03-30 /********************************************************************************** * * Rotate an array of n elements to the right by k steps. * For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated ...
ALGO
0.999896
5.810361
349b613c-4124-4adb-9ff3-ec7aa54b697b
PeterWaIIace/Dojo_CXX
google_interview/q19_url_shortener/main.cpp
#include <functional> #include <iostream> #include <iomanip> #include <cstdlib> #include <sstream> #include <string> #include <random> #include <ctime> #include <map> using url_pair = std::pair<std::string,std::string>; std::map<int, url_pair> long2short; std::map<int, url_pair> short2long; std::string getUUID() { ...
TOOL
0.964334
5.221883
5b8d7409-cf16-49e2-a309-9dd29510471f
Navigine/geometry
src/utils.cpp
#include <algorithm> #include <cctype> #include <cmath> #include <navigine/geometry/utils.h> namespace navigine::geometry { bool checkCloseValues(double v1, double v2) { return std::fabs(v1 - v2) < EPSILON; } bool checkCloseValues( const std::optional<double>& v1, const std::optional<double>& v2) { ...
TOOL
0.941469
6.999824
6849d9ba-2cd0-47d2-ac87-58c09d1cf631
manishhedau/Data-Structure-Algorithm
6. Linked List/Singly Linked List/4_Maximum_and_Minimum_value_in_linked_list.cpp
// Code By - Manish Hedau #include<bits/stdc++.h> using namespace std; class node { public: int data; node *next; // constructor node(int d) { data = d; next = NULL; } }; // converting an array into an linked list node *create_ll(int *arr, int n) { // head pointer node *head = new node(arr[0]); // temp...
ALGO
0.999954
4.84232
590652f9-bb05-4043-b950-9f56c5eeb47d
legosuke/lib
test/01_Math/01_NumberTheory/02.01.05.02_yukicoder-3030.test.cpp
#define PROBLEM "https://yukicoder.me/problems/no/3030" #include "../../../template/template.hpp" #include "../../../01_Math/01_NumberTheory/02.01.05.02_is-prime.miller-rabin.deterministic.hpp" signed main() { int n; cin >> n; for (int i = 0; i < n; ++i) { int x; cin >> x; cout << x << " " << i...
ALGO
0.998936
4.793877
7766209d-f8d5-4f21-a574-243e587f6818
OscarJin/leetcode-cpp
3.longest-substring-without-repeating-characters.cpp
/* * @lc app=leetcode id=3 lang=cpp * * [3] Longest Substring Without Repeating Characters */ // @lc code=start class Solution { public: int lengthOfLongestSubstring(string s) { bool repeat[256]; memset(repeat, false, sizeof(repeat)); int left = 0; int right = 0; int length = 0; ...
ALGO
0.999839
6.234949
6ac77128-7567-4640-a474-509bfc9a382d
bitcointurbokoin/btkblockchain
src/crypto/scrypt.cpp
#include "crypto/scrypt.h" #include "uint256.h" #include "utilstrencodings.h" #include <openssl/sha.h> #include <string> #include <string.h> #include <stdint.h> static inline void be32enc(void *pp, uint32_t x) { uint8_t *p = (uint8_t *)pp; p[3] = x & 0xff; p[2] = (x >> 8) & 0xff; p[1] = (x >> 16) & 0x...
ALGO
0.998799
5.312294
9de3a8ea-6712-462b-a39a-f890a7d03dfc
kendryte/kendryte-tensorflow
tensorflow/lite/tools/make/downloads/eigen/doc/examples/class_CwiseUnaryOp.cpp
#include <Eigen/Core> #include <iostream> using namespace Eigen; using namespace std; // define a custom template unary functor template<typename Scalar> struct CwiseClampOp { CwiseClampOp(const Scalar& inf, const Scalar& sup) : m_inf(inf), m_sup(sup) {} const Scalar operator()(const Scalar& x) const { return x<m_...
ALGO
0.969101
6.417363
3e7626a8-7124-4109-ab77-fb641d2549fb
JunSince99/BaekJoon
C++/2024-12/10/2580.cpp
#include <iostream> using namespace std; bool isvalid(int sudoku[9][9], int x, int y, int num) { for (int i=0;i<9;i++) { if (sudoku[x][i] == num || sudoku[i][y] == num) return false; } int dx = (x/3)*3; int dy = (y/3)*3; for (int i=dx;i<dx+3;i++) { for (int j=dy;j<dy+3;j++) { ...
ALGO
0.999913
5.020525
6492aeef-f175-47ea-93a9-9943d3fe1e49
Swaraj2707/Cpp_DSA
1_ Linked List/9_mergeSort_in_LL.cpp
#include<bits/stdc++.h> using namespace std; class Node{ public: int data; Node* next; Node(int d){ data = d; next = NULL; } }; Node* findMid(Node* head) { Node* slow = head; Node* fast = head -> next; while(fast != NULL && fast -> next != ...
ALGO
0.999993
5.005512
c15fcf4e-f092-43bd-a38a-45480542bc42
bongbo2020/kfr
examples/fir.cpp
#include <kfr/base.hpp> #ifdef HAVE_DFT #include <kfr/dft.hpp> #endif #include <kfr/dsp.hpp> #include <kfr/io.hpp> using namespace kfr; #ifndef PYTHON_IS_INSTALLED #define PYTHON_IS_INSTALLED 1 #endif int main() { // Show KFR version println(library_version()); // ---------------------------------------...
TOOL
0.925559
6.681798
33247d15-de4e-4437-b1c7-de321e54f418
Amylo-jh/baekjoon
16000s/16234.cpp
#include <iostream> #include <vector> #include <queue> using namespace std; vector <vector <int>> area; vector <vector <int>> unions; vector <vector <bool>> visited; int n, l, r; void make_group() { int dy[4] = {-1, 0, 1, 0}; int dx[4] = {0, 1, 0, -1}; int group_count = 1; for(int i = 0; i < n; i++)...
ALGO
0.999905
3.745853
cb594484-c132-4fcd-854d-dc30c2e092ad
qis/experiments
src/heap_hash/top_k_frequent_words.cpp
// https://leetcode.com/problems/top-k-frequent-words/ // ---------------------------------------------------------------------------------------------------- // Benchmark Time CPU Iterations // ------------------------------------------------------...
ALGO
0.997326
6.959043
4bd62fe2-d552-43e3-9c83-51a5f51ef6e3
koder-ko/ps
bojstep/9. basic_math_2/1002.cpp
#include <iostream> using namespace std; int main(){ int t; int x1, x2, y1, y2, r1, r2; int distance, plus, minus; cin >> t; while(t--){ cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2; distance = (x1-x2) * (x1-x2) + (y1 - y2) * (y1 - y2); plus = (r1 + r2) * (r1 + r2); ...
ALGO
0.999838
3.762682
395e07f3-e590-4c67-8a13-33890816e155
Malika-Omarova05/OOP
ШАБЛОНЫ И ИСКЛЮЧЕНИЯ/задание 4.cpp
/*Создайте функцию swaps(), обменивающую значения двух аргументов, по- сылаемых ей. (Возможно, вы догадаетесь передавать эти аргументы по ссылке.) Сделайте из функции шаблон, чтобы она могла использоваться с любыми числовыми типами данных (int, char, float и т. д.). Напишите main() для тестирования функции. */ #inc...
ALGO
0.912216
4.478765
8ab1aa94-060f-46ee-b45c-8f266b0d05af
ankan005/frameworks_av
media/libeffects/loudness/dsp/core/dynamic_range_compression.cpp
//#define LOG_NDEBUG 0 #include <cmath> #include "common/core/math.h" #include "common/core/types.h" #include "dsp/core/basic.h" #include "dsp/core/interpolation.h" #include "dsp/core/dynamic_range_compression.h" #include <android/log.h> namespace le_fx { // Definitions for static const class members declared in /...
ALGO
0.996097
6.419666
699460b5-495a-48e8-a3ea-4986b9c6342a
TomStary/sat-solver
main.cpp
#include <iostream> #include <fstream> #include <memory> #include <random> #include <sstream> #include <string> #include <vector> class Clause { public: Clause(std::vector<int> clause); bool Fulfilled(std::vector<bool> genom); int ClauseWeight(std::vector<bool> genom, std::vector<int> weights); private: ...
ALGO
0.999876
5.425581
bbd811d9-20dd-48e9-b8c5-d6e32682558c
CegghnnoR/boost-searcher
boost_searcher/boost_1_81_0/libs/yap/perf/code_gen_samples.cpp
template<typename T> using term = boost::yap::terminal<boost::yap::expression, T>; namespace yap = boost::yap; namespace bh = boost::hana; namespace user { struct number { double value; friend number operator+(number lhs, number rhs) { return number{lhs.value + rhs.value}...
TOOL
0.95911
7.27844
23492e18-27cb-4d5e-8464-0c410e71160d
itmc-ptit/itmc-cpp-class-2024
bt3.cpp
//tang dan #include <iostream> using namespace std; int main(){ int n;cin>>n; int a[n]; for (int i=0;i<n;i++){ cin>>a[i]; } for (int i=0;i<n;i++){ for(int j=i+1;j<n;j++) if (a[j]<a[i]){ swap(a[j],a[i]); } } for (int i=0;i<n;i++){ cout<<a[i]<<" "; } return 0; }
ALGO
0.999993
3.545815
fd9ac8e1-3bbc-4c36-afd9-1024dbec72d9
Mingkon/ColourCalibrate
cpp/ColorCalibrate.cpp
#include <iostream> #include <algorithm> #include <numeric> #include <time.h> #include <cuda.h> #include <cuda_runtime.h> #include <device_launch_parameters.h> #include "ColorCalibrate.h" bool compare(float A, float B) { return A > B; } extern "C" void useCUDA(); extern "C" void getRGBs(); extern "C" void get...
ALGO
0.963516
4.140348
3ee126fa-1aa4-4986-9122-79398e6b830c
OmarHafez1/Competitive_Programming_Solutions
projecteuler.net/problem_215.cpp
#include <bits/stdc++.h> using namespace std; #define ull unsigned long long #define ll long long #define ld long double #define int ll #define endl '\n' #define newl cout<<endl #define EPS .0000001 #define MOD 1e9+7 vector<pair<int, int>> lines; void go(int n, int ind, int mask) { if(n == 0) { lines.p...
ALGO
0.999646
3.402478
646ceba7-2f52-41ae-a52a-9135b2f1609d
ishandutta2007/codeforces
i_love_tanya_romanova/normal/1468/F.cpp
/* She's got black hair And she has got a black dress She's pretending That her life is a mess But I cannot rest With so many worries I can't lie down And say I am done I live 'cause I need more light I hope I can change today She would never think of changing Too much fucking emo, it's false (I know) She stops me in...
ALGO
0.999732
3.711893
795e53ad-2cb7-4739-a6ca-4492c647a18b
ezterry/GB-framework_base
media/libstagefright/codecs/amrnb/common/src/inv_sqrt_tbl.cpp
/* Filename: /audio/gsm_amr/c/src/inv_sqrt_tbl.c ------------------------------------------------------------------------------ REVISION HISTORY Description: Changed table name to inv_sqrt_tbl Description: Added #ifdef __cplusplus and removed "extern" from table definition. Description: Put "ext...
ALGO
0.998304
3.429776
e4fdb3de-0a2e-4516-a070-f3eab9905035
arnab-zero/Competitive-Programming
2023/August Arc/Solved/A1820.cpp
#include <bits/stdc++.h> using namespace std; #define shuru int main(void){ #define shesh return 0;} #define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define vi vector<int> #define pii pair<int,int> #define pb push_back #define mpr make_pair #define lp(x,n,d) for(int i=x;i<n;i+=d) #define spc " " ...
ALGO
0.999169
3.764192
0c9ec13c-645a-442c-8d59-e7a475ce2efc
lczech/genesis
lib/genesis/utils/tools/date_time.cpp
/** * @brief Implementation of date and time functions. * * @file * @ingroup utils */ #include "genesis/utils/tools/date_time.hpp" #include "genesis/utils/text/string.hpp" #include "genesis/utils/core/info.hpp" #include <array> #include <cerrno> #include <cstdio> #include <cstdlib> #include <ctime> #include <io...
TOOL
0.915721
7.430744
a0bec608-cb13-4305-8c7a-4c2386330927
ww5365/tiny_util
src/leetcode/cpp/leetcode_my/sort_algorithm.cpp
/* * sort_algorithm.cpp * * Created on: Feb 6, 2018 * Author: wangwei69 */ #include "sort_algorithm.h" #include "01_all.h" #include <iostream> /* * 二路归并排序的实现 */ bool Sort::merge_sort(int vec[], size_t start, size_t end){ size_t mid = (start + end)/2; //cout << "test" << " "<< start << ":" << mid...
ALGO
0.998805
4.515805
ef99913f-153d-4f87-a036-7fcc3a420c9e
HarshK97/DSA
Concatenation-Of-Array/code.cpp
#include <iostream> #include <vector> using namespace std; class Solution { public: vector<int> getConcatenation(vector<int> &nums) { int n = nums.size(); vector<int> ans(2 * n); for (int i = 0; i < n; i++) { ans[i] = nums[i]; ans[i + n] = nums[i]; } return ans; } }; int main() {...
ALGO
0.997301
6.046208
ab15c653-757e-4c44-a7d4-520ca4d68026
ducbidapne/quizzappflutter
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
06e3bfeb-0f86-44db-a415-9d66b346040e
jpetito/AyED
parcialesHechos/parcial VENDEDORES.cpp
#include <iostream> #include <stdio.h> using namespace std; struct vendedores{ //max 10 int id; char apynombre [60]; }; struct modelos{ //max 15 int id; char descrip[70]; }; struct ventas{ //archivo sin ordenar int idModelo; int idVendedor; int fecha; char cliente[60]; }; struct Nod...
TOOL
0.863426
4.184604
3d59c4a8-da52-4d4b-8f15-f1c2c263725c
zaegi/kuliah
UAS/program1.cpp
#include <iostream> #include <string.h> using namespace std; struct matkul{ string kd_matkul; string nm_matkul; }; matkul matkul; int main(){ string *pointerkd = &matkul.kd_matkul; string *pointernm = &matkul.nm_matkul; cout<<"Masukan Kode Mata kuliah : "; cin>>matkul.kd_matkul; cout<<"Masuk...
TOOL
0.963664
3.156331
2efc2ccc-3865-4941-9c97-84bbae63c86b
thakurtpr/DSA
410-split-array-largest-sum/split-array-largest-sum.cpp
class Solution { public: bool isPossible(vector<int>& nums, int noOfSubarrays , int mid){ int subarray = 1 , summation = 0; for(int i = 0 ;i<nums.size();i++){ summation +=nums[i]; if(summation>mid){ subarray++; i--; summation=0;...
ALGO
0.999977
5.67639
f744e086-662c-42a8-b0f7-6916454abb16
ppppplus/pl-vins-nx
PL-VINS/feature_tracker/src/feature_tracker.cpp
#include "feature_tracker.h" int FeatureTracker::n_id = 0; bool inBorder(const cv::Point2f &pt) { const int BORDER_SIZE = 1; int img_x = cvRound(pt.x); int img_y = cvRound(pt.y); return BORDER_SIZE <= img_x && img_x < COL - BORDER_SIZE && BORDER_SIZE <= img_y && img_y < ROW - BORDER_SIZE; } void redu...
ALGO
0.87396
5.127923
b41a616d-823d-45fe-908e-bd59088dbfa6
jsh5408/Algorithm
BAEKJOON/SILVER/3/1072. 게임/1072. 게임.cpp
#include <iostream> #include <vector> #include <string> #include <stdlib.h> using namespace std; int main() { long X, Y; scanf("%d %d", &X, &Y); int Z = (Y * 100 / X); if(Z >= 99) { printf("-1"); return 0; } int left = 0, right = 1000000000; while(left <= right) { int mid = (left + right) / 2; int ...
ALGO
0.999742
3.449187
23c463ab-837e-4e41-bed0-8b44888249f1
Chirag29103/C-programming-
pattern3.cpp
#include<stdio.h> int main() { for(int i=1; i<=5; i++) { for ( int j=5; j>i; j--) printf(" "); for ( int j=1; j<=i; j++) printf("*"); printf("\n"); } return 0; }
ALGO
0.999949
3.299956
bcb3fcdf-6b98-4a12-891b-341c48203dfb
WilliamX1/leetcode
Solutions/Minimum-Window-Substring.cpp
class Solution { public: string minWindow(string s, string t) { unordered_map<char, int> smap, tmap; set<int> tset; for (const auto &ch : t) { tmap[ch]++; tset.insert(ch); }; int tot = tset.size(); int start = 0, end = -1, idx = -...
ALGO
0.999992
6.475054
98dc5dc9-2677-4c11-9842-ab486f7032a8
techfoon/MediaQuery
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.9988
6.76073
3552884d-1472-48fa-ab29-1c729d268280
Lqhuy125/c-cpp
soAmstrong.cpp
#include<conio.h> #include<stdio.h> #include<math.h> double tinh(long y) { int q = 1, w; double tong = 0; long y1 = y; // neu k co dong nay thi gia tri y // o while thu 2 se nhan nham gia tri cua // while thu 1 while(y1>10) { y1 = y1/10; q++; } while(y>0) { ...
ALGO
0.999095
3.281168
4c00864a-46b3-4a91-8330-f2f6ad5e567b
PLW/textpoc-2
db/pipeline/accumulator_min_max.cpp
#include "mongo/platform/basic.h" #include "mongo/db/pipeline/accumulator.h" #include "mongo/db/pipeline/expression.h" #include "mongo/db/pipeline/value.h" namespace mongo { using boost::intrusive_ptr; REGISTER_ACCUMULATOR(max, AccumulatorMax::create); REGISTER_ACCUMULATOR(min, AccumulatorMin::create); REGISTER_EXP...
TOOL
0.880292
7.421247
f87d96d0-b7c3-473f-87e7-303f3e9dafae
nirdesh17/codeforces
Chemistry.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long int void solve() { unordered_map<char,int> mp; ll n,k; cin>>n>>k; string s; cin>>s; for(int i=0;i<n;i++) { mp[s[i]]++; } ll odd=0; for(auto i:mp) { if(i.second%2!=0) odd++; } ...
ALGO
0.999968
5.094861
184009b0-615b-42c9-bd8f-ca9e328f074d
Srijanakash/Coding
LeetCode/Practice/RangeAddition.cpp
/* You are given an integer length and an array updates where updates[i] = [startIdxi, endIdxi, inci]. You have an array arr of length length with all zeros, and you have some operation to apply on arr. In the ith operation, you should increment all the elements arr[startIdxi], arr[startIdxi + 1], ..., arr[endIdxi] ...
ALGO
0.999851
6.500778
926e8692-424f-4b86-bfb8-7946ee52f4f5
BIG-A-K/Atcoder
AtCoder_Beginner_Contests/abc315/miss04.cpp
#include <bits/stdc++.h> #define ll long long #define test(i) cout<<"test: "<<i<<endl #define rep(i,n) for(int i = 0;i < (n); i++) #define yes() cout<<"Yes"<<endl #define no() cout<<"No"<<endl using namespace std; int main(){ int H,W; cin>>H>>W; vector<vector<int>> c(H,vector<int>(W)); vector<vector<bo...
ALGO
0.999775
4.160112
3f6eeb88-2ff0-430b-8679-a7f4beb25a8f
abukhalidsiddique/Cpp
com lab 3/1/8.cpp
#include<iostream> using namespace std; int main() { int a,b,c,*x,*y,*z; cin>>a>>b>>c; x=&a; y=&b; z=&c; if(*x>*y) { if(*x>*z) { cout<<"max= "<<*x<<endl; } else cout<<"max= "<<*z<<endl; } else { if(*y>*z) ...
ALGO
0.999898
3.06833
a3e51a20-c1b8-425c-a8f1-f4a84404f71a
kennyrkun/SFLCARS
SFLCARS-utility/SettingsParser.cpp
#include "SettingsParser.hpp" #include <locale> // std::isspace #include <fstream> #include <sstream> #include <vector> namespace sflcars { namespace utility { SettingsParser::SettingsParser() : m_isChanged(false) { } SettingsParser::SettingsParser(const std::string& filename) : m_isChanged(false) { loadFromFile(...
TOOL
0.918348
5.917436
03db8b5f-70c0-44a4-8d00-307e15bd1995
KhaledMosaad/Comptitve_Programming
H - Delete Them.cpp
#include <bits/stdc++.h> using namespace std; #define all(v) (v.begin(),v.end()) #define sz(v) ((int)((v).size())) #define F first #define S second #define pb push_back #define mp make_pair #define endl '\n' typedef long long ll; typedef long double ld; typedef unsigned long long ull; typedef pair<int, int> pii; type...
ALGO
0.999998
4.160282
22ae9951-9acf-4053-b8cb-f9af6816a433
RatnalaRaja/GFG
Easy/Panagram Checking/panagram-checking.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: //Function to check if a string is Pangram or not. bool checkPangram (string s) { // your code here map<char, int>mp;...
ALGO
0.999208
5.54549
5446f512-29fe-4ace-a6d9-195fdd3c4bc6
Glazomer/MATI_IT_ALL
8/2.3.8.0.cpp
#include <iostream> int main(int argc, char **argv) { unsigned x; std::cin >> x; std::cout << ((x & 1) == ((x >> 3) & 1) ? "YES" : "NO") << std::endl; return 0; }
ALGO
0.999322
4.595035
b19c2e18-31b3-4ef7-abe3-eb35963f018d
iceeyyy/DSA_Answers
0215-kth-largest-element-in-an-array/0215-kth-largest-element-in-an-array.cpp
class Solution { public: int findKthLargest(vector<int>& nums, int k) { priority_queue<int> pq; //stores greater elements at top for(int i=0;i<nums.size();i++){ pq.push(nums[i]); } int ans=0; while(k!=0){ ans=pq.top(); pq.pop(); ...
ALGO
0.999881
5.071553
edf47797-03aa-40e0-b50d-798c05827b40
interactivevislab/TrianglePlugin-UE5
TrianglePlugin/Source/libigl-static/include/extract_manifold_patches.cpp
template< typename DerivedF, typename DerivedEMAP, typename uE2EType, typename DerivedP> IGL_INLINE size_t igl::extract_manifold_patches( const Eigen::PlainObjectBase<DerivedF>& F, const Eigen::PlainObjectBase<DerivedEMAP>& EMAP, const std::vector<std::vector<uE2EType> >& uE2E, Eigen::PlainObjectBase<De...
ALGO
0.969672
4.04915
ad750fca-138f-411d-8ce4-387cb691c2ba
byeongkukoh/algorithm
Cpp/BaekJoon/Sliver/S1_5525.cpp
#include <iostream> #include <string> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, m; cin >> n >> m; string str; cin >> str; int cnt = 0, res = 0; for (int i = 1; i < m - 1; i++) { if (str[i - 1] == 'I' && str[i] == 'O' && str[i + 1] == 'I') { ...
ALGO
0.999805
4.066851
b2e80e97-0589-4b65-b670-58ee8fd69be6
subhash5470/computer_networks
dijkstra algorithm cpp.cpp
#include <iostream> #include <vector> #define INT_MAX 10000000 using namespace std; void DijkstrasTest(); int main() { DijkstrasTest(); return 0; } class Node; class Edge; void Dijkstras(); vector<Node*>* AdjacentRemainingNodes(Node* node); Node* ExtractSmallest(vector<Node*>& nodes); int Distance(Node* node1, N...
ALGO
0.999723
4.651825
492059e2-48ad-4b0b-95e6-f60c9a8026ed
Junaid7200/University-Labs
Data Structures/Recursion/.history/Q6_20240426125243.cpp
#include <iostream> using namespace std; long long FibonacciUsingRecursion(int n) { if (n == 0) return 0; else { } } int main () { return 0; }
ALGO
0.999744
3.938217
aa8cab06-3ce3-4f79-8903-26f9c4b6b08b
ishandutta2007/codeforces
zscoder/normal/50/A.cpp
#include <iostream> using namespace std; int main() { int m, n; cin >> m >> n; cout << m*n/2; return 0; }
ALGO
0.997677
3.65913
1000aa95-5f52-4e83-a976-735ee3e465ae
Filinouns/SIM
P3/ParticleSystem.cpp
#include "ParticleSystem.h" //------------------Constructor_Destructor------------- ParticleSystem::ParticleSystem(Vector3 p) { countdown_ = .5; iniCount_ = countdown_; pos_.p = p; } ParticleSystem::~ParticleSystem() { for (auto p : particles_) delete p; } //--------------------------Updates--------------------...
TOOL
0.850157
4.41644
ccd9089e-7c64-4bbe-ae9b-0d35a2686f04
JakubMierzwa02/CryptoVote
src/VotingSystem.cpp
/** * @file VotingSystem.cpp * @brief Implementation of the VotingSystem class */ #include "VotingSystem.h" /** * @brief Constructor for the VotingSystem class * * Initializes the voting system with default values */ VotingSystem::VotingSystem() : votingStatus(false) { } /** * @brief Starts the voting proces...
TOOL
0.911401
6.729195
bcf81af5-815f-40d2-ba9c-a00fcbc29312
ishandutta2007/codeforces
sankear/normal/724/D.cpp
#include <iostream> #include <vector> #include <set> #include <unordered_set> #include <bitset> #include <map> #include <unordered_map> #include <deque> #include <queue> #include <string> #include <tuple> #include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <cmath> #inc...
ALGO
0.999996
3.150153
8470d6d7-2f87-4b95-8400-33857e1f3d80
ngbk1993/spectrum-analyzer-mbed
testing_fft/main.cpp
#include "mbed.h" #include <arm_math.h> float32_t buffer_input[l_probek]; uint16_t i; uint8_t mode; float32_t dt; float32_t freq; bool DoFlag = false; bool UBFlag = false; uint32_t rozmiar = 4*l_probek; union { float32_t f[l_probek]; uint8_t b[4*l_probek]; }data_out; union { float32_t f[l_probek]; ui...
ALGO
0.99819
3.9674
8ee6c4ab-35f6-4ec2-bfdb-5d5374fcbbbd
Ashmita-Srivastav/Cpp
striver/13-left_rotate_by_n_places.cpp
#include<bits/stdc++.h> using namespace std; vector<int>rA(int arr[],int k, int n) { int temp=arr[0]; for(int i=0;i<n;i++){ arr[i]=arr[i+1]; } arr[n-1]=temp; } int main(){ int n = 7; int arr[] = {1,2,3,4,5,6,7}; int k=2; rA(arr,n,k); for(int i=0;i<n;i++){ cout<<a...
ALGO
0.999909
3.361483
31cfe6b6-7bba-41e9-a269-390eef1eec56
tungduong03/algorithm_C_allTheTime
TinhModule/TinhModule.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int x, n=4757; cin>>x; int y=x; for (int i=1; i<2003; i++){ y = (y*x) %n; } cout<<y; }
ALGO
0.999896
3.777927
3e68d4db-9632-46bf-9395-71100a8250b7
SShink0/Ardupilot
libraries/Filter/SlewLimiter.cpp
/* The SlewLimiter filter provides an actuator slew rate limiter for PID controllers. It is used to reduce the P and D gains when the filter detects that the P+D components are pushing the actuator beyond the configured actuator rate limit. This can prevent oscillations that are caused by the output actuation...
ALGO
0.983078
6.120506
a259634c-8874-4bc2-9241-48b642221ebd
ASCcool/dsa
leetcode/array/leetcode_121_122.cpp
// Problem link: https://leetcode.com/problems/best-time-to-buy-and-sell-stock/ class Solution { public: int maxProfit(vector<int>& prices) { int maxProfit = 0, currProfit = 0, minBuy = INT_MAX; for (int i = 0; i < prices.size(); ++i) { // Update minimum buy price if (prices...
ALGO
0.998941
6.474199
14896cf2-ebf4-4005-ba05-6b1cbf8274d5
mtuann/competitive-programming-101
string-algorithms/cses_1733_3.cpp
#include <iostream> #include <vector> #include <string> using namespace std; const int MOD = 1e9 + 7; // Modulo value for hashing const int BASE = 31; // Base for polynomial rolling hash // Function to compute x^y % p using iterative exponentiation by squaring long long modPow(long long x, long long y, long long...
ALGO
0.999886
5.673832
ab1629fa-dc85-4e0b-befd-b90beab70818
ChristianAlbertoGomez/Projects
Pokedex UI/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.998456
6.785645
8880d9ed-640e-4db0-879c-227f1425f588
azharnian/computer-science-fall-2324
10INFORMATIKA/10IPA4/Meet02b/indomie.cpp
#include <iostream> using namespace std; int main(){ int money, price; cout << "Berapa banyak uang yang kamu miliki ? "; cin >> money; cout << "Berapa harga satu bungkus indomie ? "; cin >> price; cout << "Kamu akan mendapatkan " << money / price << " indomie\n"; cout << "Kembalian uang kam...
TOOL
0.948354
3.951489
b54d1d97-fb22-4bf0-aef2-b5b3d1563f40
marvalarva2929/Competitive_Programming
USACO practice problems/Bronze/china.cpp
using namespace std; #include <bits/stdc++.h> #define int long long #define nl '\n' #define pi pair<int, int> #define f first #define s second int n, k; bool grids[10][10][10] = {}; vector<vector<bool>> grid(8, vector<bool>(8)); bool get(int i, int x, int y) { return x < n && x >= 0 && y >= 0 && y < n && grids[i...
ALGO
0.999698
3.169628
90e45d5f-340a-4128-b7dc-60f79160f311
Gourav1695/SDE-Sheet_challenge
Set_missmatch.cpp
public class Solution { public int[] findErrorNums(int[] nums) { Arrays.sort(nums); int dup = -1, missing = 1; for (int i = 1; i < nums.length; i++) { if (nums[i] == nums[i - 1]) dup = nums[i]; else if (nums[i] > nums[i - 1] + 1) missin...
ALGO
0.99504
4.227956
e04a3cec-1eff-4797-8b43-b4049c61cb83
AHussain98/CPP
LinkedList.cpp
#include <iostream> using namespace std; // In simple words, a linked list consists of nodes where each node contains a data field and a reference(link) to the next node in the list. //this is different to an array, which is a contigous form of data retention where all data members are stored sequentially in memory //...
ALGO
0.999723
4.201232
0f7bc98a-5e4f-4e5c-8683-e7171776dd17
AAARKO7/Competitive-Programming-Problem-Solving
Code forces/1926/C_Vlad_and_a_Sum_of_Sum_of_Digits.cpp
/* Solver: Arko7 */ #include<bits/stdc++.h> using namespace std; const int MAX= 200007; int final[MAX]; int SumofDigits(int n){ int sum=0; while(n>0){ sum+=n%10; n/=10; } return sum; } void solve() { int n; cin>>n; cout<<final[n]<<'\n'; } int main() { ios_b...
ALGO
0.99975
4.910129
01b40d23-ac07-49cc-9634-2bf575934ed6
arnob-das/leetcode
155.min-stack.cpp
/* * @lc app=leetcode id=155 lang=cpp * * [155] Min Stack */ // @lc code=start #include<bits/stdc++.h> using namespace std; class MinStack { stack<pair<int, int>> st; public: MinStack() { } void push(int val) { if (st.empty()) { st.push(make_pair(val, val)); }...
ALGO
0.999697
6.898046
219b0f4e-6feb-4655-b848-39b24ad9ae31
Jacoo-ai/ADLS
src/mase_components/hls/scripts/bl_int.cpp
// --- HLS implementation of LLM.int #include <algorithm> #include <ap_axi_sdata.h> #include <ap_fixed.h> #include <ap_int.h> #include <hls_math.h> #include <hls_stream.h> #include <math.h> #include <stdint.h> #include <string.h> using namespace std; typedef ap_int<16> HTYPE; typedef ap_int<4> LTYPE; #define X_ROW 1 ...
ALGO
0.997248
4.016864
b01542b3-e0ea-4226-8c11-89fa9f9ddcc0
ishandutta2007/codeforces
enem/normal/1236/C.cpp
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define M1 1000000007 #define M2 998244353 #define ll long long #define pll pair<ll,ll> #define REP(i,a,b) for(ll i=a;i<b;i++) #define REPI(i,a,b) for(ll i=b-1;i>=a;i--...
ALGO
0.99988
3.630922
d514b933-7c7c-45a2-ae99-c7a03b9f8458
abhinav0223/Leetcode
0357-count-numbers-with-unique-digits/0357-count-numbers-with-unique-digits.cpp
class Solution { public: int countNumbersWithUniqueDigits(int n) { if (n == 0) return 1; if (n == 1) return 10; int count = 10, uniqueDigits = 9, availableNumbers = 9; for (int i = 2; i <= n; i++) { uniqueDigits *= availableNumbers; count += uniqueDigits; availableNu...
ALGO
0.999877
7.441951
7ad0400e-2cbd-4786-baac-5036b6a6e200
libgdx/libgdx
extensions/gdx-bullet/jni/src/bullet/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.998412
7.315638
2a53c89d-fe2e-4fe5-9751-3b7169010507
Ritax2003/DSA
Trees/Count-Leaf-Nodes.cpp
/*Code : Count leaf nodes Given a generic tree, count and return the number of leaf nodes present in the given tree. Input format : The first line of input contains data of the nodes of the tree in level order form. The order is: data for root node, number of children to root node, data of each of child nodes and so ...
ALGO
0.999729
5.519454
63db6948-3771-49ec-a436-29db587cc7d4
rubak3/IMC-Gem5
gem5/src/systemc/tests/systemc/misc/user_guide/chpt4.2/stage3.cpp
/***************************************************************************** stage3.cpp -- Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 *****************************************************************************/ /*****************************************************************************...
ALGO
0.999311
4.191345
032a81d5-c0b8-46f1-9351-84ebccf9302a
AlterFritz88/interactive_learn_cpp
task_3_1_16.cpp
#include <bits/stdc++.h> using namespace std; int main(){ string a, b; cin >> a >> b; if (a.size() > b.size()) cout << a << " " << b; else cout << b << " " << a; return 0; }
ALGO
0.999574
4.497671
85239b10-026b-49bb-a573-18fd56d9928b
DebasritoLahiri/Codeforces
Codeforces/900/405A.cpp
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main() { int cols,temp; cin>>cols; vector<int> tempVec(cols,0); vector<vector<int>> box(100,tempVec); for(int i=0;i<cols;i++){ cin>>temp; for(int j=0;j<temp;j++){box[99-j][i]=1;} } int k; for...
ALGO
0.999697
3.204661
dfc823b2-bad4-42a2-b0e2-e0fbb4c42df8
MelmanRGku/MadMetal
MadMetal/Game Logic/WayPointSystem.cpp
#include "WaypointSystem.h" #include "Game Logic\PathFinding.h" #include "Factory\GameFactory.h" #include "Objects\NavigationalGrid.h" #include <algorithm> static const float WAYPOINT_WIDTH_COLLISION = 2; static const float WAYPOINT_LENGTH_COLLISION = 2; static const float WAYPOINT_HEIGHT_COLLISION = 80; static const ...
TOOL
0.874207
3.998784
b6704343-090a-4c4c-a6ee-6e8d53f37b3c
Macw07/Macw07
Temp&Others/P6410-CROSS.cpp
#include <iostream> using namespace std; int cnt = 0; char map[10][10]; int vis[3][3][15]; int horizontal[10][15]; int vertical[10][15]; // 判断一个点是否合法。 bool check(int i, int j){ int t = map[i][j] - '0'; if (vis[i/3][j/3][t] == 1) return false; if (horizontal[i][t] == 1) return false; if (vertical[j]...
ALGO
0.999154
4.791425
50935ddd-3d49-4490-94b9-6dd24c6a7d4a
Azkellas/adventofcode
2020/20/answer1.cpp
#include <iostream> #include <vector> #include <unordered_map> #include <sstream> #include <set> #include <array> #include <cmath> enum Rotation { rot0 = 0, rot90, rot180, rot270 }; enum Side { N = 0, E, S, W }; enum Flip { flipN = 0, flipH, flipV }; class Operation { pub...
ALGO
0.999154
5.523447
4b210536-923d-4e99-8287-476357eef142
oliverflood/advent-of-code-2022
day17a.cpp
#include <bits/stdc++.h> #include "cpplite.h" using namespace std; #define ll long long /* g++ day17a.cpp cpplite.cpp -o day17a.exe -std=c++1z */ const int CHAMBER_WIDTH = 7; //int highest_rock = -1; struct shape { map<pair<int, int>, bool> area; int width; int height; }; void shape_setup(vector<shape> &shapes...
ALGO
0.999925
4.487023
de912014-be51-4702-b250-266945f8af46
ekxhta/DSA
LinkedList/SinglyLinkedList/Insertion_Deletion/Deletion/deletek.cpp
#include<iostream> #include<vector> using namespace std; class Node { public: int data; Node* next; public: Node(int data1) { data=data1; next=nullptr; } Node(int data1,Node* next1) { data=data1; next=next1; } }; Node* ArrtoLL(vector<int> arr)...
ALGO
0.999862
4.788458
2a337276-93d4-4a0b-ac1d-cc4080345fde
lbryio/lbrycrd-dependencies
boost_1_59_0/libs/random/example/die.cpp
//[die /*` For the source of this example see [@boost://libs/random/example/die.cpp die.cpp]. First we include the headers we need for __mt19937 and __uniform_int_distribution. */ #include <boost/random/mersenne_twister.hpp> #include <boost/random/uniform_int_distribution.hpp> /*` We use __mt19937 wi...
ALGO
0.924958
6.137387
aeeea086-3a87-4288-9284-f8f2cbbe8d20
andrewkreisher/6.837-Fluid-Simulation
gloo/utils.cpp
#include "utils.hpp" #include <cstdio> #include <iostream> #include <fstream> #include <stdexcept> namespace GLOO { std::vector<std::string> Split(const std::string& s, char delim) { std::stringstream ss(s); std::string item; std::vector<std::string> result; while (std::getline(ss, item, delim)) { result...
TOOL
0.970911
6.640052
e5299496-e8e4-4247-b4a9-56e001d428bd
wbhoomika/16April23-MLSA-OS-Talk
sort_array.cpp
#include <iostream> using namespace std; int main() { int n; cout << "Enter the size of array: " << endl; cin >> n; int a[n]; cout << "Enter the elements: " << endl; for (int i = 0; i < n; i++) { cin >> a[i] cout << endl; }; for (int i = 0; i < n; i++) { for (in...
ALGO
0.9998
4.150801