uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
efc17917-0906-40e2-ad87-221b2fe23ba0
ysonggit/leetcode
subsetsII.cpp
#include "utils.h" using namespace std; void dfs(vector<vector<int> > & results, vector<int> &S, vector<int>& sol, int start_idx){ map<int, bool> hasDup; for(int i=start_idx; i<S.size(); i++){ if(hasDup.find(S[i]) == hasDup.end()){ hasDup.insert(std::make_pair(S[i], true)); sol.push_back(S[i]); ...
ALGO
0.99876
5.010135
bb088ec8-4098-42ac-9b70-c74fb804e2c4
WilliamJokuS/mywebsite
idek/extday2E.cpp
#include <bits/stdc++.h> #define pb push_back using namespace std; vector <int> a,b,c; int arr[105]; int main(){ int n,pos=0; cin>>n; for(int i=1;i<=n;i++){ cin>>arr[i]; if(arr[i]>0)pos++; } if(pos>=1){ for(int i=1;i<=n;i++){ if(arr[i]>0)b.pb(arr[i]); else if(arr[i]<0&&a.empty())a.pb(arr[i]); else c...
ALGO
0.999981
3.480587
581d67c6-4ca5-4bdf-9306-cc404657b324
ReeceJones/Marlin-Ender3V2
Marlin/src/gcode/bedlevel/abl/G29.cpp
/** * G29.cpp - Auto Bed Leveling */ #include "../../../inc/MarlinConfig.h" #if HAS_ABL_NOT_UBL #include "../../gcode.h" #include "../../../feature/bedlevel/bedlevel.h" #include "../../../module/motion.h" #include "../../../module/planner.h" #include "../../../module/stepper.h" #include "../../../module/probe.h" #...
ALGO
0.976214
7.785397
ad072064-16d0-4403-aa96-079be1119ce2
memade/llvm-project
libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp
// UNSUPPORTED: c++03, c++11, c++14 // <functional> // boyer_moore_horspool searcher // template<class RandomAccessIterator1, // class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>, // class BinaryPredicate = equal_to<>> // class boyer_moore_horspool_searcher { // public: ...
TEST
0.87775
6.538493
635824a5-29f9-43de-9b3f-92b281e73ff6
jpetersen5/school-projects
CSE030/Lab_11/Exercise.cpp
#include <iostream> #include "BTree.h" using namespace std; int main() { BTree myTree; myTree.insert(10); myTree.insert(14); myTree.insert(6); myTree.insert(5); myTree.insert(8); myTree.insert(11); myTree.insert(18); Node *tempNode; cout << "Root has key: "; cout << myTre...
ALGO
0.998781
3.789901
0ab08a92-a2ea-4a7f-9c99-808db484afe1
J0seph-Mart1n/CPP-Data-Structures-and-Algorithms
Linked List/linkedlistprogram.cpp
#include <iostream> using namespace std; //Making class to create nodes class Node { public: int value; Node* next; Node(int value){ this->value = value; next = nullptr; } }; class LinkedList{ private: Node* head; Node* tail; in...
ALGO
0.998315
5.115022
74baee36-5290-4408-abc3-e44df7ba80df
thepyrodancers/Calculator
Functions.cpp
#include <iostream> #include <vector> #include "Variable.h" #include "Errors.h" #include "Gconst.h" #include "Token.h" #include "Functions.h" #include "Token_stream.h" using std::cin; using std::cout; using std::vector; using std::cerr; using std::exception; //---------------------------------------------------------...
TOOL
0.983602
4.148787
b8b8ed13-1700-424a-8b7c-6757f1b20a94
xliu0105/catkin_iiwa
src/iiwa_impedance_controller/pinocchio_impedence_controller/src/pin_impedence_control.cpp
#include "pinocchio_impedence_controller/pin_impedence_control.h" Impedance_controller::Impedance_controller(ros::NodeHandle &nh,Eigen::Matrix<double,6,6> &K_d,Eigen::Matrix<double,6,6> &D_d):K_d_(K_d),D_d_(D_d) { ROS_INFO("Impedance_controller constructor called"); // Initialize the subscriber and publisher ...
ALGO
0.972742
5.570707
d61b8d22-76da-40c7-836e-9033708cb80a
Kawser-nerd/CLCDSA
Source Codes/AtCoder/abc046/A/4625385.cpp
#include <iostream> using namespace std; int main(){ int a,b,c; cin >>a>>b>>c; if(a != b && a != c && b != c){ cout << "3\n"; }else if(a == b && a == c && b == c){ cout << "1\n"; }else{ cout << "2\n"; } return 0; }
ALGO
0.999957
4.517268
d67826f9-5915-4d55-9079-dbd16cf843de
nitinkaplas123/DSA-Daily
Level_1/Mixed_Questions/14)4_sum_leetcode_18.cpp
Solution 1-: Steps-: 1)using 4 loops. 2)we need unique elements in ans vector for that we first sort the array and use set of vectors for unique ans. Code-: Time->O(n4) Space ->O(N) vector<vector<int>> fourSum(vector<int>& nums, int target) { vector<vector<int>>ans; set<vector<int>>s; ...
ALGO
0.999989
5.813047
a4a40e6a-8284-4245-a072-03546e091fd0
coconutstar/Tree
main.cpp
#include "function.h" //ǰ void PreOrder(BiTree p) { if(NULL!=p) { printf("%c",p->c); PreOrder(p->lchild); PreOrder(p->rchild); } } // void MiddleOrder(BiTree p) { if(NULL!=p) { MiddleOrder(p->lchild); printf("%c",p->c); MiddleOrder(p->rchild); } } // void PostOrder(BiTree p) { if(NULL!=p) { PostOr...
ALGO
0.999936
3.469029
5d94b6c1-5582-48f9-8cae-259d6f6b844c
abhishek0948/CodeChef-Starters
starter167/Grid_Construction_Odd.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int #define vll vector<long long> #define pb(x) push_back(x) // Approach - 1]We want to get distinct number from 1 - n in each row and col // - 2]for this start with 1-n in first row then shift the number by 1 in each iteration // - ...
ALGO
0.999947
4.746699
67b8204e-ec5c-4c63-8bf8-c84da9f163b8
danglingpntr/codemachine
Algorithmic_toolbox/Greedy_Algorithms/7_maximum_salary.cpp
/* Task-> Compose the largest number out of a set of integers. Input Format-> The first line of the input contains an integer 𝑛. The second line contains integers 𝑎1, 𝑎2, . . . , 𝑎𝑛. Constraints-> 1 ≤ 𝑛 ≤ 100; 1 ≤ 𝑎𝑖 ≤ 103 for all 1 ≤ 𝑖 ≤ 𝑛. Output Format-> Output the largest number that can be composed ou...
ALGO
0.999912
5.719059
65472046-daf2-4944-a5ca-b009b332a1be
AlokSinghKumar/My-Datastructures
Linked list/Reverse-SinglyLinked-list-2.cpp
#include<bits/stdc++.h> using namespace std; class Node{ public: int data; Node *next; Node(int Node_data){ this->data = Node_data; this->next = nullptr; } }; class linkedList{ public: Node *head; Node *tail; linkedList(){ ...
ALGO
0.99996
5.495067
b5b67d37-a3c8-4709-99a1-f7260be13f84
duxintang/opencv51cto
dnn_tutorial/face_alignment.cpp
#include <opencv2/opencv.hpp> #include <opencv2/face.hpp> #include <math.h> #include <iostream> using namespace cv; using namespace cv::face; using namespace std; const String lbpfilePath = "D:/opencv-3.4/opencv/build/etc/lbpcascades/lbpcascade_frontalface.xml"; bool myDetector(InputArray image, OutputArray faces, C...
TOOL
0.987241
3.291563
a2da401f-dc43-4bba-90b5-adf678c7d47e
redpanda321/Icefox
ios6/mozilla-central/gfx/layers/LayerSorter.cpp
#include "LayerSorter.h" #include "DirectedGraph.h" #include "limits.h" #include "gfxLineSegment.h" #include "Layers.h" #include "mozilla/Assertions.h" namespace mozilla { namespace layers { enum LayerSortOrder { Undefined, ABeforeB, BBeforeA, }; /** * Recover the z component from a 2d transformed point by fi...
ALGO
0.998263
7.459525
9d1792d8-a61e-4523-ad7b-98aa60274963
bioexcel/bioexcel-code-releases
GROMACS/gromacs-2019-beta1/src/gromacs/linearalgebra/gmx_lapack/slansy.cpp
#include <cmath> #include "../gmx_lapack.h" float F77_FUNC(slansy,SLANSY)(const char *norm, const char *uplo, int *n, float *a, int *lda, float *work) { /* System generated locals */ int a_dim1, a_offset, i__1, i__2; float ret_val, d__1, d__2, d__3; int c__1 = 1; /* Local variables */ int ...
ALGO
0.999832
5.697454
7c8e4162-a399-4cae-b1dd-3eb6418b8bb4
vitorguidi/Competitive-Programming
Treinos equipe/arrebento/2018/04-14 (III UFC)/j.cpp
#include <iostream> using namespace std; #define MAXN 100100 int main(){ int n,m,v_now,v_last; char lin_now,lin_prev; cin >> n >> m; v_last=-4; for(int i=0;i<m;i++){ cin >> v_now >> lin_now; if(i==0) lin_prev=lin_now; if(lin_now=='M' || (v_now-v_last<4 && lin_prev!=lin_now)){ cout << "No" << endl; ...
ALGO
0.99999
3.698934
76f742c7-233b-4a36-befb-2cd029f1ccb5
UFO-ETL/ufo
src/crypto/siphash.cpp
#include <crypto/siphash.h> #define ROTL(x, b) (uint64_t)(((x) << (b)) | ((x) >> (64 - (b)))) #define SIPROUND do { \ v0 += v1; v1 = ROTL(v1, 13); v1 ^= v0; \ v0 = ROTL(v0, 32); \ v2 += v3; v3 = ROTL(v3, 16); v3 ^= v2; \ v0 += v3; v3 = ROTL(v3, 21); v3 ^= v0; \ v2 += v1; v1 = ROTL(v1, 17); v1 ^= v...
ALGO
0.999722
6.860593
797618eb-cf92-4624-abf0-73f74258a7fd
learninghome3344/cpp_learning
cbiancheng_base/section4_Inheritance_and_derivation/construct_function_in_inherit.cpp
#include <iostream> using namespace std; /// 基类的普通成员函数可以被继承,可以通过派生类的对象访问,但是基类的构造函数不能被继承。 /// 构造函数不能被继承是有道理的,因为即使继承了,它的名字和派生类的名字也不一样,不能成为派生类的构造函数,当然更不能成为普通的成员函数。 /// 对继承过来的成员变量的初始化工作也要由派生类的构造函数完成,但是大部分基类都有 private 属性的成员变量,它们在派生类中无法访问,更不能使用派生类的构造函数来初始化。 /// 这种矛盾在C++继承中是普遍存在的,解决这个问题的思路是:在派生类的构造函数中调用基类的构造函数。 class Peopl...
TOOL
0.863628
5.412816
d60cfb00-afa5-401b-929c-de6c6fe27ad9
pritthiprokashsarkar/problem-set
atcoder/J - Min, Max and Sum.cpp
#include<bits/stdc++.h> using namespace std; int main() { int n,sum=0; cin>>n; int a[n]; int i; for(i=0; i<n; i++) { cin>>a[i]; sum+=a[i]; } sort(a,a+n); cout<<a[0]<<" "<<a[n-1]<<" "<<sum<<endl; }
ALGO
0.999881
3.094959
4ddef29b-edf2-4e58-ab95-d5a3e395e82c
Fimav2/streasy
str_easy1.cpp
#include <string> #include "str_easy.h" using namespace std; string itc_hello_str(string name ){ return ("Hello, "+ name); } //Написать функцию long long itc_len(string str), которая принимает на вход строку и возвращает на экран целое число количество символов в строке long long itc_len(string str){ long long ...
TOOL
0.966166
3.810341
0545894b-b6d7-4027-9b5d-ba394424a43e
chillcat68/Pb_olimpiada
oji 2015/Gimnaziu/6/6surse/VI_surse_P1_Covor/CPP_SursaOficialaCovor.cpp
#include <fstream> using namespace std; ifstream f("covor.in"); ofstream g("covor.out"); int n,k,r,p,m,c; int main() { f>>n>>k>>c; r=1; while(2*(r+1)*(r+2)-r<=n) r++; if(c==1) g<<r<<'\n'; else { if(k> 2*r*(r+1)-(r-1)) g<<0<<'\n'; else { p=1; m=1+r*(r+1); if(k<=m) { while(k>1+p*...
ALGO
0.999892
3.07383
a4abc79a-04e6-4b62-a586-f8d1171dd058
raincross7/code-similarity
codes/train_code/problem238/problem238_441.cpp
#include <bits/stdc++.h> #define rep3(i, s, n, a) for (int i = (s); i < (int)(n); i += a) #define rep2(i, s, n) rep3(i, s, n, 1) #define rep(i, n) rep2(i, 0, n) using namespace std; using ll = long long; using ull = unsigned long long; using P = pair<int, int>; int main(){ int n, q; cin >> n >> q; vector<...
ALGO
0.999967
4.102181
df6c3739-bf1c-4147-94dc-9bd73a38bed9
macedohc/faculdade
C++/hash-comColisao/main_hash.cpp
#include <iostream> #include "hash.h" using namespace std; int main(){ cout << "Programa gerador de Hash!\n"; int tam_vetor, max; cout << "Digite o tamanho da Hash!\n"; cin >> tam_vetor; cout << "Digite o numero maximo de elementos!\n"; cin >> max; cout << "O fator de carga e: " << (float)...
ALGO
0.969686
4.200483
9d146b37-83b8-4348-bbfc-01bf0345be0f
bigg-S/Leetcode-solutions
groupAnangram/GroupAnagrams.cpp
#include <vector> #include <iostream> #include <string> #include <algorithm> #include <unordered_map> class Solution { public: std::vector<std::vector<std::string>> groupAnagrams(std::vector<std::string>& strs) { std::unordered_map<std::string, std::vector<std::string>> _map; for (std::st...
ALGO
0.999961
6.403943
e5acf5e0-f575-4f0a-a756-374c814f3a73
saurabhkadekodi/peloton
src/postgres/port/rint.cpp
/*------------------------------------------------------------------------- * * rint.c * rint() implementation * * By Pedro Gimeno Fortea, donated to the public domain * * IDENTIFICATION * src/port/rint.c * *------------------------------------------------------------------------- */ #include "c.h" #inc...
ALGO
0.999932
6.556072
7c61b81e-dabc-41ae-a6fa-5d4a3bdb2e6e
TevisEv/algoritmos_2023_1
SEMANA 1/NumeroMayor.cpp
#include <iostream> using namespace std; int main() { int numero1, numero2, numero3; cout << "Ingrese el primer número: "; cin >> numero1; cout << "Ingrese el segundo número: "; cin >> numero2; cout << "Ingrese el tercer número: "; cin >> numero3; if (numero1 >= numero2 && numero1 >...
ALGO
0.999017
4.292364
a04ee171-38f9-4aa8-a449-53b442f9444b
ehsanul-haque/LabPractice
Prime.cpp
#include <iostream> using namespace std; int main() { int count = 0, i, number; cout<<"Enter a number"; cin >> number; for (i = 1; i <= number; i++) { if (number % i == 0) { count++; } } if (count == 2) { cout << "Prime number"; } else ...
ALGO
0.999386
3.7139
353bbf07-8162-4367-b542-dbba7b57f713
janaalbader28/Parallel-Task-Scheduling-for-Deadline-Oriented-System
Task Scheduling Sequential code.cpp
#include <iostream> #include <list> #include <string> #include <map> #include <ctime> #include <algorithm> #include <fstream> #include <sstream> using namespace std; // Task structure struct Task { std::string name; std::tm deadline; // Deadline as a date std::list<std::string> dependencies; // Task dep...
ALGO
0.998682
7.314795
e9bdee6e-24e0-4e4f-af7a-3bb0142f2250
Djokovic0311/LeetCode
problems/minimum_common_value/solution.cpp
class Solution { public: int getCommon(vector<int>& nums1, vector<int>& nums2) { sort(nums1.begin(), nums1.end()); sort(nums2.begin(), nums2.end()); int i = 0, j = 0; int n = nums1.size(), m = nums2.size(); while(i < n && j < m) { if(nums1[i] == nums2[j]...
ALGO
0.999988
5.617229
daef44bc-2024-480d-9dd0-b521f0d19b57
Raiiyf/USTC-COURSES-AI
算法分析与设计/Lab_knapsack/Greedy.cpp
#include "Knapsack.h" bool cmp(std::tuple<int, int, int, float>a, std::tuple<int, int, int, float>b) { return std::get<3>(a) > std::get<3>(b); } // greed on value rate Result Greedy::solution() { auto start = std::chrono::high_resolution_clock::now(); std::vector<std::tuple<int, int, int, float>> A; // i...
ALGO
0.999979
4.779917
c898eda6-c8dc-451b-b97a-5fccb013b896
vbonnici/grafe-sim
analysis/data/p02240/s214786230.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vvi = vector<vi>; using vll = vector<ll>; #define rep(i, n) for (int i = 0; i < (int)(n); i++) void assign(vvi &g, vi &group, int n = 0) { rep(i, g.size()) { if (group[i] != -1) continue; group[i] = i; ...
ALGO
0.999989
5.096825
d4e17b9c-a637-423e-938c-6e73d9562aba
minhaz-ahmed-ayon/Algorithm
1-Factorial-Recursion.cpp
#include<iostream> using namespace std; int factorial(int num){ if(num>1){ return num * factorial(num-1); } else{ return 1; } } int main(){ int n=5; cout <<"Factorial of " << n << "=" << factorial(n) << endl; }
ALGO
0.999725
4.316123
d6859797-4823-4e36-90f6-78bb02049f07
abhikumr7248/CodeInCpp
B_Quick_Sort.cpp
#include <iostream> #include <vector> #include <string> #include <cstdio> #include <algorithm> #include <cmath> #include <bits/stdc++.h> using namespace std; #define ull unsigned long long #define ll signed long long #define ld long double #define to_low(s) transform(s.begin(), s.end(), s.begin(), ::tolower); // conver...
ALGO
0.999876
3.905206
8b1499d4-bedd-4fb0-ba69-462a09e11b3f
UA1ZDC/UHD-Owl
host/utils/uhd_cal_rx_iq_balance.cpp
#include "usrp_cal_utils.hpp" #include <uhd/usrp/multi_usrp.hpp> #include <uhd/utils/algorithm.hpp> #include <uhd/utils/paths.hpp> #include <uhd/utils/safe_main.hpp> #include <boost/format.hpp> #include <boost/program_options.hpp> #include <chrono> #include <cmath> #include <complex> #include <cstdlib> #include <ctime>...
TOOL
0.857039
5.455989
c004ad65-e4cd-4dbf-9d79-bad713b1306c
devangsaraogi/leetcode
3581-the-two-sneaky-numbers-of-digitville/3581-the-two-sneaky-numbers-of-digitville.cpp
class Solution { public: vector<int> getSneakyNumbers(vector<int>& nums) { vector<int> result; sort(nums.begin(), nums.end()); for(int i=0; i<nums.size()-1; i++) { if (nums[i] == nums[i+1]) { result.push_back(nums[i]); i+=1; } ...
ALGO
0.999956
5.276019
9dce0430-675a-4d2a-9f2f-e89c5f31b848
MikeMAMR/CompetitiveProgramming
UVA/11503-Virtual Friends.cpp
#include <bits/stdc++.h> using namespace std; map<string, int> mp; vector<int> p, leng; string a, b; void UnionFind(int n){ leng.assign(n, 1); p.assign(n, 0); for(int i=0; i<n; i++) p[i] = i; } int findSet(int i){ return (p[i] == i) ? i : (p[i] = findSet(p[i])); } bool isSameSet(int i, int j){ return findSet(i) ==...
ALGO
0.999743
3.900074
5e0641c2-d298-4fa7-a5ff-ce4b607b2682
jonathanirvings/toki-open-2018
toki-open-2018-tour/solution-1.cpp
#include "tour.h" #include <bits/stdc++.h> #define sz(a) int((a).size()) #define all(c) (c).begin(),(c).end() #define uniq(c) sort(all((c))), (c).resize(unique(all((c))) - (c).begin()) #define lobo(c, x) (int) (lower_bound(all((c)), (x)) - (c).begin()) #define upbo(c, x) (int) (upper_bound(all((c)), (x)) - (c).begin(...
ALGO
0.999973
4.239697
7abe4e5c-dac9-4da8-a6e3-2b458b7b259c
ArmaanInamdar/LB_3
program282.cpp
#include<iostream> using namespace std; int Addition(int iNo) { int iSum = 0; int i = 1; while(i <= iNo) { iSum = iSum + i; i++; } return iSum; } int main() { int iValue = 0, iRet = 0; cout<<"Enter number : "<<endl; cin>>iValue; iRet = Addition(iValue); c...
ALGO
0.998922
3.881939
44ab587f-c469-4575-9677-d78229975b44
ishandutta2007/codeforces
choutii/normal/906/D.cpp
#include <bits/stdc++.h> #define fir first #define sec second #define MP make_pair #define PB push_back using namespace std; typedef long long LL; typedef unsigned long long u64; template <typename T> inline bool cmin(T & a, const T & b) { return a > b ? a = b, 1 : 0;} template <typename T> inline bool cmax(T & a, c...
ALGO
0.999947
3.799066
ad2864a8-3eb0-4022-801c-566e8844ab86
ishandutta2007/codeforces
dreamoon_love_aa/normal/1685/D1.cpp
/*{{{*/ #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<algorithm> #include<string> #include<iostream> #include<sstream> #include<set> #include<map> #include<queue> #include<bitset> #include<vector> #include<iomanip> #include<limits.h> #include<assert.h> #define SZ(X) ((int)(X).size()) #de...
ALGO
0.999901
3.415968
934a4d92-7b38-4855-a22f-10106b1790e4
momokapapa/hanakapapa
libraries/fc/src/compress/smaz.cpp
#include <string> #include <sstream> #include <string.h> #include <fc/exception/exception.hpp> namespace fc { typedef const char* const_char_ptr; /* Our compression codebook, used for compression */ static const_char_ptr Smaz_cb[241] = { "\002s,\266", "\003had\232\002leW", "\003on \216", "", "\001yS", "\002ma\255\002...
TOOL
0.970496
5.892166
6739f846-05c8-4b67-8030-85d656525f18
RFOF-NETWORK-Ready-for-our-future/Telegram-Contest-Blockchain-round-1
storage/storage-daemon/storage-daemon-cli.cpp
#include "common/bitstring.h" #include "keys/encryptor.h" #include "adnl/adnl-ext-client.h" #include "td/utils/port/signals.h" #include "td/utils/Parser.h" #include "td/utils/OptionParser.h" #include "td/utils/PathView.h" #include "td/utils/misc.h" #include "td/utils/filesystem.h" #include "td/utils/port/path.h" #inc...
TOOL
0.941677
6.9851
b48a2e7f-9fc9-4db9-a034-64c26ad8b427
Rishikarthick58/c-_hk
30.04/7 Find the maximum of Three numbers.cpp
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; if (a >= b) { if (a >= c) { cout << "Maximum: " << a; } else { cout << "Maximum: " << c; } } else { if (b >= c) { cout << "Maximum: " << b; ...
ALGO
0.99989
4.676343
19dbffcf-7c5a-4e09-969e-3fd9316e7c04
bishweashwarsukla/hactoberfest2022
chef_card.cpp
#include<bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef vector <int> vi; //ull c=0; //ull k=0; int cal(int N) { int k=0; while(N>0) { k+=N%10; N=N/10; } // cout<<"k is "<<k<<endl; return k; } int fun(vi arr, vi mar,int n) { int A=0,B=0; ...
ALGO
0.99984
3.288186
23fa47d5-bbc2-4f86-b3ee-8c52a5bade95
globosco/A-modified-SOSD-platform-for-benchmarking-Branchy-vs-Branch-free-search-algorithms
competitors/PGM-index/lib/sdsl-lite/tutorial/expl-15.cpp
#include <sdsl/wavelet_trees.hpp> #include <iostream> #include <utility> using namespace std; using namespace sdsl; template<class value_type, class size_type> ostream& operator<<(ostream& os, const std::pair<value_type, size_type>& p) { return os << "(" << p.first << "," << p.second << ")"; } int main() { w...
ALGO
0.998846
3.590076
6ffbeac9-b691-45c3-b392-7847f0a0eb3c
ammatwain/pianissimo
src/engraving/rendering/dev/beamtremololayout.cpp
#include "beamtremololayout.h" #include <array> #include "../dom/beam.h" #include "../dom/chordrest.h" #include "../dom/chord.h" #include "../dom/note.h" #include "../dom/score.h" #include "../dom/staff.h" #include "../dom/stem.h" #include "../dom/stemslash.h" #include "../dom/tremolotwochord.h" #include "tlayout.h"...
TOOL
0.855681
6.644767
554ada3b-d78d-4abe-8022-e9a8b7a5bac2
Bhawna751/LeetCode-Solutions
39-combination-sum/combination-sum.cpp
class Solution { public: void solve(vector<int>&candidates,int ind,int target, vector<vector<int>>&ans, vector<int>&subset ){ if(target<0 || ind<0)return; if(target == 0){ ans.push_back(subset); return; } solve(candidates,ind-1,target,ans,subset); subs...
ALGO
0.999973
6.425305
be4bd095-284c-4cab-af45-09ebfd1d35ba
Joyal-Patel14/CPP
Patterns/rhombus.cpp
#include <iostream> using namespace std; int main(){ int n; cin>>n; for(int i=1; i<=n; i++) { for(int j=1; j<=n-i; j++) { cout<<" "; } for(int k=1; k<=n; k++) { cout<<"* "; } cout<<endl; } return 0; }
ALGO
0.999939
3.703052
c29e3fb2-dccb-4cfc-8ce3-ae076654d0ee
61--/windage
windageLightVer/src/Frameworks/MultipleMarkerTracking.cpp
/* ======================================================================== * PROJECT: windage Library * ======================================================================== * This work is based on the original windage Library developed by * Woonhyuk Baek (<EMAIL> / <EMAIL>) * Woontack Woo (<EMAIL>) * U...
TOOL
0.978357
4.295242
c8ea29d6-b913-46d8-b226-ceaec4871851
samarsrivastav/IMPORTANT-CODES
encrypting.cpp
#include <iostream> #include <string> using namespace std; int main() { string alphabets{"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"}; string key{"XZNLWEBGJHQDYVTKFUOMPCIASRxznlwebgjhqdyvtkfuompciasr"}; cout << "enter your message: " << endl; string message{}; getline(cin, message); string encry...
ALGO
0.999409
4.467918
f398e77e-f27b-4066-aae1-bc0a90b05ce3
mumba-org/mumba
third_party/boost/src/libs/graph/test/dijkstra_no_color_map_compare.cpp
#include <iostream> #include <map> #include <vector> #include <boost/lexical_cast.hpp> #include <boost/random.hpp> #include <boost/graph/adjacency_list.hpp> #include <boost/graph/dijkstra_shortest_paths.hpp> #include <boost/graph/dijkstra_shortest_paths_no_color_map.hpp> #include <boost/graph/properties.hpp> #include ...
TEST
0.95169
6.316209
52a554a2-79e5-4f41-bbad-c9142f4b5b1e
mitchellnouhan/leetCode
graphs/findIfPathExistsInGraphDFS.cpp
class Solution { public: bool dfs(unordered_map<int, vector<int>>& graph, unordered_map<int, bool>& visited, int current, int destination){ if(current == destination){ return true; } visited[current] = true; for(int neighbor: graph[current]){ if(!visited[neigh...
ALGO
0.999995
6.161747
46b5d95c-a6a2-42fd-8bc5-5fe6cfca8112
ishandutta2007/codeforces
sakurakoujiruna/normal/1/C.cpp
#include <iostream> #include <cmath> #include <iomanip> using namespace std; #define double long double const double Eps = 1e-6; const double Pi = 4 * atan(1); int sgn(double a, double b = 0.0) { a -= b; return (a > Eps) - (a < -Eps); } struct Point { double x, y; Point operator -(Point p) { return Point{x - p....
ALGO
0.999872
3.885979
b5e2e878-8b04-44ba-9543-8a0feb85e855
DraftTin/mycode
GA.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int totalTime = 0; //求图中的各强连通分量的算法 /* * 思想是先用原图做一遍DFS,把所有点的完成时间计算出来,再把图反向 * 之后按照结点完成时间从大到小的顺序对转置图做DFS,用一个数组保存结点 * 用邻接矩阵存储,两遍dfs: O(V^2) 矩阵转置: O(V^2), 所以总的时间复杂度O(V^2) */ class Node{ public: int d; // 开始时间 int f; // 结束...
ALGO
0.999906
4.385168
6b578cdb-1ad8-46c4-ba37-726295ada4c9
hotuanan/codeforces
580A - Kefa and First Steps/main.cpp
#include <bits/stdc++.h> #include <string> using namespace std; void solve() { int n; cin >> n; int last = 0; int ans = 0; int curr = 0; for (int i = 0; i < n; i++) { int x; cin >> x; if (x >= last) { curr++; } else { ans = max(an...
ALGO
0.999454
4.486414
f835ff65-c401-428b-a762-8dfda292f674
antonkanin/learning_bullet
Bullet/Extras/CDTestFramework/Opcode/OPC_TreeCollider.cpp
/* * OPCODE - Optimized Collision Detection * http://www.codercorner.com/Opcode.htm * * Copyright (c) 2001-2008 Pierre Terdiman, <EMAIL> This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. P...
ALGO
0.998505
5.614444
2f50b600-5857-45d0-9fd3-a3f1b4059c7d
Takeoff0518/cpp-learning-code
bct/day6/mineral/mineral.cpp
#include<algorithm> #include<iostream> #include<cstring> #include<cstdio> #include<queue> #include<stack> #define N (1000005) #define M (1000005) #define INF (0x3f3f3f3f) #define mod (998244353) #define ll long long #define PII pair<int,int> #define ls(xxx) (xxx)<<1 #define rs(xxx) (xxx)<<1|1 using namespace std; int n...
ALGO
0.99984
4.033606
8c506ee3-f925-4d27-b95d-7114b3041572
y9g-wang/bustub
src/storage/index/b_plus_tree.cpp
#include <sstream> #include <string> #include "common/exception.h" #include "common/logger.h" #include "common/rid.h" #include "storage/index/b_plus_tree.h" namespace bustub { INDEX_TEMPLATE_ARGUMENTS BPLUSTREE_TYPE::BPlusTree(std::string name, page_id_t header_page_id, BufferPoolManager *buffer_pool_manager, ...
TOOL
0.952372
5.523419
80e2c1cb-e723-4dec-b1a8-2f1f5af7349e
aldragan0/algo-practice
codeforces/easy-bootcamp/day1/p01.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; ++i) { cin >> a[n - i - 1]; } for (int i = 0; i < n; ++i) { cout << a[i] << " "; } }
ALGO
0.999776
3.724619
440e69f5-be65-4317-bc43-03cfe0e11995
marsyas/marsyas
src/apps/kea/kea.cpp
#include <cstdio> #include <cstdlib> #include <cstring> #include <marsyas/Collection.h> #include <marsyas/system/MarSystemManager.h> #include <marsyas/CommandLineOptions.h> #include <marsyas/common_source.h> #include <marsyas/FileName.h> #include <vector> using namespace std; using namespace Marsyas; /* global varia...
ALGO
0.947548
5.93908
a56cb0c6-12b2-4b5a-a8e3-57e8400a4db9
ABUTAYYAB/Programming-Fundamentals
PD-5/task4CP.cpp
#include<iostream> using namespace std; string Project_time_calculation(int hours, int days, int workers); // a function that can calculte that how much time needed to the work in time main() // main body of the function { int hours; //variable dacrlaration int days; int workers; string res...
ALGO
0.999612
3.547308
2834d4fe-68ad-48ca-ae04-1f1ef6995cfa
Prajapat2005/SDE_CP
dp/Array_Description.cpp
#include <bits/stdc++.h> using namespace std; #define int long long // https://cses.fi/problemset/task/1746 /* int solve(vector<int> v, int i, int &m) { if (i == v.size()) { return 1; } if (i - 1 >= 0 && v[i] != 0 && (abs(v[i] - v[i - 1]) > 1)) { return 0; } else if (v[i] ...
ALGO
0.999997
4.634082
26c43545-efd9-48cc-b91d-5f74cf33129b
wickedIllusioner/nstu_lab5
task2/main.cpp
#include <iostream> #include <iomanip> #include <sstream> #include <algorithm> #include <random> #include <vector> #include <map> using namespace std; struct Client { string ticket; int duration; }; // Вывод талонов в одну строку ostream& operator<<(ostream& os, vector<Client> v) { for (auto elem : v) { ...
ALGO
0.994255
5.744044
49eaa6d0-0af9-4fa1-8f4f-4ce730dede13
RoshanChef/DSA-2.0
8 Stack/11.infix_postfix.cpp
#include <bits/stdc++.h> using namespace std; int pre(char ch) { if (ch == '^') return 3; else if (ch == '*' || ch == '/' || ch == '%') return 2; else if (ch == '+' || ch == '-') return 1; return -1; } // associativity char asso(char ch) { if (ch == '^') return 'R';...
ALGO
0.99994
5.200453
4f403d3f-1fe6-46dc-b944-ef415a45a970
Subhanshu1/C-
dynamic pogramming/Count the number of subset with a given difference.cpp
#include<iostream> #include<cstring> using namespace std; /* 4 1 1 2 3 1 */ int SubsetSum(int n,int *wt,int Sum,int t[102][1002]){ if((n==0 && Sum!=0) || Sum<0){ return 0; } if(Sum==0){ return 1; } if(t[n][Sum]!=-1){ return t[n][Sum]; } if(wt[n-1]<=Sum){ return t[n][Sum]=SubsetSum(n-1,wt,Sum-w...
ALGO
0.999985
3.567681
a5df9551-2eb4-483b-b9fa-561117b9f875
AyushSukh/Leetcode
460-lfu-cache/lfu-cache.cpp
class LFUCache { int capacity; int minFreq; unordered_map<int, pair<int, int>> keyVal; unordered_map<int, list<int>> freqList; unordered_map<int, list<int>::iterator> pos; public: LFUCache(int capacity) { this->capacity = capacity; minFreq = 0; } int get(int key) { ...
ALGO
0.999602
6.22306
a99aed8e-f502-49f4-95f8-130050f56c4e
fsy-juruo/noip-2021-js-answer
t2021/JS-0347/sequence/sequence.cpp
#include<bits/stdc++.h> using namespace std; const int N=110,mod=998244353,M=1e7+10; typedef long long LL; LL n,m,k; LL v[N]; LL a[N],ans; LL read(){ LL x=0,f=1; char ch=getchar(); while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();} while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();} return x*f; } void dfs(int u)...
ALGO
0.999972
4.047354
1aeec9d7-5635-48c2-bf18-e9a623f609b6
mishrarahul07/EasyContribution
finding_the_numbers.cpp
#include <iostream> #include <map> #include <vector> using namespace std; int main() { //code map<int, int> m; vector<int> v, single; int N, i, x, j, T; cin>>T; while(T--) { cin>>N; for(i=0; i< (2*N)+2; i++) { cin>>x; m[x]++; //counts number of occurences if(m[x]==1) ...
ALGO
0.999959
3.694188
0d794fbf-e583-4287-9c66-2dcc7f3fed4e
KomalJoshi17/DSA-June
dynamic_programming/prefix_suffix_palindrome.cpp
// Link : https://codeforces.com/contest/1326/problem/D2 #include<bits/stdc++.h> using namespace std; //largest prefix that matches a suffix int kmp(string s) { vector<int> lps(s.size(), 0); for (int i = 1; i < (int)lps.size(); ++i) { int prev_idx = lps[i - 1]; while (prev_idx > 0 && s[i] != s[prev_idx]) {...
ALGO
0.999995
4.365887
30ad758e-fe13-49e0-95e6-735aef1c5dca
baixun2307/asd
lcof/面试题19. 正则表达式匹配/Solution.cpp
class Solution { public: bool isMatch(string s, string p) { int m = s.size(), n = p.size(); int f[m + 1][n + 1]; memset(f, 0, sizeof f); function<bool(int, int)> dfs = [&](int i, int j) -> bool { if (j >= n) { return i == m; } if (f...
ALGO
0.999676
5.430434
403c0d8a-9b42-4544-bdb9-f4bd39d535d3
sanskar8908/Leetcode_Problems
Medium_Problems/55. Jump Game.cpp
#include<bits/stdc++.h> using namespace std; class Solution { public: bool canJump(vector<int>& nums) { //using greedy algorithum........ int n=nums.size(); int goal=n-1; int possible=1; for(int i=n-1;i>=0;i--) { if(nums[i]+i>=goal) { goal=i; ...
ALGO
0.999984
5.669029
1a0cba0c-8929-4851-88f1-22161d332c3e
ishandutta2007/codeforces
ssrs_/normal/1398/A.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int t; cin >> t; for (int i = 0; i < t; i++){ int n; cin >> n; vector<int> a(n); for (int j = 0; j < n; j++){ cin >> a[j]; } if (a[0] + a[1] <= a[n - 1]){ cout << 1 << ' ' << 2 << ' ' << n << endl; } else { cou...
ALGO
0.9987
3.145911
36f830da-a060-46c3-a418-8cfd6bcda454
SavicStefan/CP
test/sol.cpp
#include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <bits/stdc++.h> using namespace std; using namespace __gnu_pbds; typedef long long ll; typedef long double ldb; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef pair<ldb,ldb> pdd; #define ff(i,a,b) for(int i = a; i...
ALGO
0.999777
3.952478
da58a766-23fd-4a5f-a566-63a19a288a1d
RiddhiShirole/DSA-BOOTCAMP-ASSIGNMENT
8.left rotation.cpp
#include <stdio.h> int main() { //Initialize array int arr[] = {1, 2, 3, 4, 5}; //Calculate length of array arr int length = sizeof(arr)/sizeof(arr[0]); //n determine the number of times an array should be rotated int n = 3; //Displays original array prin...
ALGO
0.999793
5.383026
c6ab7d1d-d842-487d-9da7-a32fe11cedca
DevaishiT/DSA2-Data-Structures
week3_hash_tables/matching_with_mismatches.cpp
#include <iostream> #include <vector> using namespace std; vector<int> solve(int k, const string &text, const string &pattern) { vector<int> pos; return pos; } int main() { ios_base::sync_with_stdio(false), cin.tie(0); int k; string t, p; while (cin >> k >> t >> p) { auto a = solve(k, t, p); cout << a.size...
ALGO
0.999086
3.8654
fb135d91-ffa2-4a08-a4a8-31a93bfe15df
RainbowTalaxy/pta_advanced
1069.cpp
#include<iostream> #include<algorithm> #include<string> using namespace std; int main() { string number; int n; char t[10]; cin >> n; sprintf(t, "%04d", n); number = t; do { sort(number.begin(), number.end()); string rvs = number; reverse(rvs.begin(), rvs.end()); ...
ALGO
0.999663
3.635158
23f6acce-12bb-4352-9039-d34cc80f4a21
Lucas3H/MAC0214
Codeforces/660div2/c.cpp
#include<bits/stdc++.h> using namespace std; #define fr(i, n) for(int i = 0; i < n; i++) #define frr(i, n) for(int i = 1; i <= n; i++) #define frm(i, n) for(int i = n-1; i >= 0; i--) #define pb push_back #define f first #define s second typedef long long ll; typedef pair<int,int> pii; typedef vector<vector<ll>> mat...
ALGO
0.999961
4.177472
89c83009-e003-449e-83bc-17dbde177322
p200d/3D-Asteroid-Game
ObjLibrary/ObjModel.cpp
#include <cassert> #include <cctype> #include <cstdlib> // for atoi #include <string> #include <iostream> #include <iomanip> #include <fstream> #include <vector> #include "ObjSettings.h" #ifdef OBJ_LIBRARY_SHADER_DISPLAY #include "../GetGlutWithShaders.h" #else #include "../GetGlut.h" #endif #include "ObjStringPar...
TOOL
0.935118
5.683072
c1970c39-6226-4ca7-b349-04e4483e362e
JaeHyunLee94/Problem_Solving
acmicpc.net/15975.cpp
// // Created by 이재현 on 2020/07/19. // #include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n = 0; cin >> n; vector<vector<int>> arr(n + 1); for (int i = 1; i <= n; i++) { ...
ALGO
0.999965
4.239645
a95e6044-e17d-45a3-9825-975f42e0b219
craigsapp/improv
examples/synthImprov/shadow2.cpp
// // Programmer: Craig Stuart Sapp <<EMAIL>> // Creation Date: 9 January 1998 // Last Modified: 9 January 1998 // Filename: ...sig/doc/examples/improv/synthImprov/shadow2/shadow2.cpp // Syntax: C++; synthImprov 2.0 // // Description: echos a note played on the synthesizer keyboard // Unlike shadow...
TOOL
0.995464
5.847222
427a8510-1f77-495c-a286-f3ebee685cdf
Re-bro/Algorithm-PS
USACO/USACO 2021 December Contest/[BOJ 23880] Walking Home.cpp
#include<bits/stdc++.h> #define ini(x, y) memset(x, y, sizeof(x)); using namespace std; int a[55][55]; int dp[55][55][2][4]; int n, k; int sol(int x, int y, int dir, int cnt) { if (x == n && y == n) return 1; int& ret = dp[x][y][dir][cnt]; if (ret != -1) return ret; ret = 0; if (dir == 0) { if (x + 1 <= n && a[...
ALGO
0.999936
4.306793
8168dc0d-3971-4781-8249-22760164d53b
AbhishekHacks/DSA-Solutions
Arrays/Farthest Smaller Right.cpp
/*You are given an array arr[]. For each element at index i (0-based indexing), find the farthest index j to the right (i.e., j > i) such that arr[j] < arr[i]. If no such index exists for a given position, return -1 for that index. Return the resulting array of answers.*/ //Time Complexity -- O(nlogn) class Solution ...
ALGO
0.99998
5.216482
109dbb9d-e4af-4c7e-9e5b-d6d1630378f9
POTU/potu-leaf
LeafPotu/cocos2d/cocos/math/Mat4.cpp
#include "math/Mat4.h" #include "math/Quaternion.h" #include "math/MathUtil.h" #include "base/ccMacros.h" NS_CC_MATH_BEGIN Mat4::Mat4() { *this = IDENTITY; } Mat4::Mat4(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m3...
TOOL
0.983499
7.258378
3473b4d7-9760-41af-a9e9-7df43d67952b
arangodb/arangodb
3rdParty/boost/1.78.0/libs/graph/example/quick_tour.cpp
#include <boost/config.hpp> #include <iostream> // for std::cout #include <utility> // for std::pair #include <algorithm> // for std::for_each #include <boost/utility.hpp> // for boost::tie #include <boost/graph/adjacency_list.hpp> #include <boost/graph/graphviz.hpp> using namespace boost; template < class Graph > st...
ALGO
0.998237
6.69881
a9066a85-2721-4aab-b275-bb65cc61b7ac
Arpita2209/cpp
binarysearch.cpp
#include<iostream> using namespace std; int main() { int A[7]={4,5,6,7,8,9,10}; int l=0,h=6,mid,key; cout<<"enter key element= "; cin>>key; while(l<=h) { mid=(l+h)/2; if(key==A[mid]) { cout<<"found at"<<mid; return 0; } else if(key...
ALGO
0.999593
3.446357
3bb9b290-1f63-4995-aa30-b9a8358f75f9
UditThakkar/Striver-SDE-Sheet
Day 21/VerticalTraversal.cpp
#include<bits/stdc++.h> /************************************************************ Following is the Binary Tree node class template <typename T = int> class TreeNode { public: T data; TreeNode<T> *left; TreeNode<T> *right; TreeNode(T val) { this->data = val; left = NULL; ...
ALGO
0.999997
5.466764
e9a9f111-fd33-451a-9f53-28d569888fe5
Fishiro/mycode
CandCPP/C folder/Bai 21 - 40/bai24.cpp
#include <stdio.h> int main(){ int a, b, c; printf("Phan mem tim loai tam giac dua tren 3 canh\n"); printf("Nhap lan luot 3 canh cua tam giac: "); scanf("%d %d %d", &a, &b, &c); if (a + b > c && a + c > b && b + c > a){ if (a == b && b == c){ printf("[*] Loai tam giac: Tam giac...
ALGO
0.999173
3.607538
bd6fd59a-65ce-4b9b-8dbc-38e8b27dbcff
eugenelet/SIFT
generateVerilog.cpp
#include <stdio.h> #include <iostream> #include <fstream> #include <cmath> #include <string.h> #include <string> #define KERNEL_SIZE 7 using namespace std; int main() { ofstream fout; char* output_file = "prepare_filter.v";/* char* layer[3][3] = {"buffer_data_1", "buffer_data_0", "img_dout", ...
TOOL
0.929683
3.195188
dcc12dd0-323e-4c17-861b-62041fbe6845
LHS-11/Algorithm
프로그래머스/level2/더 맵게.cpp
#include<bits/stdc++.h> using namespace std; priority_queue<int, vector<int>, greater<int>> q; int solution(vector<int> scoville, int K) { int answer = 0; for (auto c : scoville) q.push(c); // priority_queue<int,vector<int>,greater<int>> q(scoville.begin(),scoville.end()); while (q.size() && q.top() ...
ALGO
0.999637
5.290885
d377cd64-f42b-4c09-945c-766935e0a059
tinhngovnptho/Code
CP/Code THCS/HSG9/TS10_ThanhHoa2223/cau1.cpp
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define mp make_pair #define sz(s) (int)(s).size() #define ALL(v) (v).begin(), (v).end() #define FOR(i, a, b) for (int i = (a), _b = (b); i < _b; ++i) #define FORE(i, a, b) for (int i = (a); i <= (b); ++i) #define FORDE(i, a, b) for (int...
ALGO
0.999637
4.907834
5c2e5ebf-b4e2-4272-8565-a4ffea48990e
Ravindranath-Porandla/LeetCode
0560-subarray-sum-equals-k/0560-subarray-sum-equals-k.cpp
class Solution { public: int subarraySum(vector<int>& nums, int k) { int n = nums.size(); unordered_map<int, int> mp; mp[0]++; int sum = 0; int ans = 0; for (int i = 0; i < n; i++) { sum += nums[i]; int req = sum - k; if (mp.find(r...
ALGO
0.999924
6.366331
148ee560-dd6d-46ac-9b1c-ff2c88c65d18
itsmedurgesh/Coding-Practice-CPP
interviewbit/median_sorted_array.cpp
#include <iostream> #include <vector> using namespace std; double getmedian(const vector<int> &A){ int mid = (A.size()-1)/2; if(A.size()%2) return (double)A[mid]; else ((double)A[mid] + (double)A[mid+1])/(double)2; } double findMedianSortedArrays(const vector<int> &A, const vector<int> &B) { // Do no...
ALGO
0.999961
5.487853
52849bbf-5c3c-479f-aa59-2eba07870a36
czartur/competitive_programming
x_inf473a/td4/c.cpp
#include <bits/stdc++.h> using namespace std; #define db(x) cerr << #x << " == " << x << endl #define dbs(x) cerr << x << endl #define st first #define nd second #define pb push_back #define mp make_pair #define cl(x,y) memset(x, y, sizeof(x)) #define endl '\n' typedef long long ll; typedef pair<int, int> pii; typede...
ALGO
0.999542
3.933328
a101e7d9-5344-43db-9033-77044a564c85
JakubKucharski9/Cpp
Zadanka/zadanie22.cpp
#include <iostream> #include <string> using namespace std; int war; int main(){ int tab[100]; cout<<"Ile danych chcesz wpisac? "; cin>>war; cout<<"Wpisz wartosci: "<<endl; for(int i=0; i<war;i++){ int x; cin>>x; tab[i]=x; } int n=war; while(n>1){ for(int i=0;i<n-1;i++){ if(tab[i]>tab[i+1]){ int ...
ALGO
0.999618
3.557572
0d7bd149-8f05-4658-8c52-58a6bfc50136
chimaoshu/data_structure
课后计分练习2-链表及栈/栈_波兰式.cpp
#include <iostream> #include <string> #include <stack> using namespace std; #define space ' ' int getPriority(char a) { switch (a) { case '*': case '/': return 2; case '+': case '-': return 1; case '(': case ')': return 0; default: return 0; } } ...
ALGO
0.9998
4.439721
31998a7f-f3b2-40c1-9453-4f93281a5936
openjdk/jdk11u-dev
src/hotspot/share/opto/live.cpp
#include "precompiled.hpp" #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" #include "opto/callnode.hpp" #include "opto/chaitin.hpp" #include "opto/live.hpp" #include "opto/machnode.hpp" // Compute live-in/live-out. We use a totally incremental algorithm. The LIVE // problem is monotonic. ...
ALGO
0.979239
7.289551
526d6f2e-37a8-47c4-b3f4-13f4832fbd48
shirishbahirat/algorithm
vpal2.cpp
#include <iostream> #include <vector> using namespace std; class Solution { public: bool validPalindrome(string s) { int i = 0; int j = (s.size() - 1); int count1 = 0; int count2 = 0; while (i < j) { if (s[i] == s[j]) { ++i; --j; } else { ...
ALGO
0.999943
5.978469
02cb90dc-16bf-46a0-b400-0a0a5ab3542b
somye-v01/DSA-Practice-Questions
LinkedList/678-valid-parenthesis-string/valid-parenthesis-string.cpp
class Solution { public: bool solve(string &s, int i, int opencnt, int n, vector<vector<int>>& dp){ if(i>=n) return opencnt == 0; if(dp[i][opencnt]!=-1) return dp[i][opencnt]; bool valid = false; if(s[i]=='*'){ valid = valid | solve(s,i+1,opencnt+1,n,dp); val...
ALGO
0.999648
4.943296